diff options
author | Marvin Borner | 2021-03-28 14:01:53 +0200 |
---|---|---|
committer | Marvin Borner | 2021-03-28 14:01:53 +0200 |
commit | 60750501da4eb0c020e971b45ae3a964c903e12d (patch) | |
tree | fc95ff546a7acaa22327bd27dc098230f820c531 /libs/libgui/gfx.c | |
parent | ba2c07447ba1278d8ad38ca58a8ae94c82d2d008 (diff) |
Fun with widgets
Diffstat (limited to 'libs/libgui/gfx.c')
-rw-r--r-- | libs/libgui/gfx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/libgui/gfx.c b/libs/libgui/gfx.c index 259b03f..a0f5b22 100644 --- a/libs/libgui/gfx.c +++ b/libs/libgui/gfx.c @@ -96,13 +96,13 @@ static void draw_rectangle(struct context *ctx, vec2 pos1, vec2 pos2, u32 c) } } -struct context *gfx_new_ctx(struct context *ctx) +struct context *gfx_new_ctx(struct context *ctx, vec2 size, u8 bpp) { - /* struct message msg = { 0 }; */ - assert(0); - /* assert(msg_send(pidof(WM_PATH), GFX_NEW_CONTEXT, ctx) > 0); */ - /* assert(msg_receive(&msg) > 0); */ - /* memcpy(ctx, msg.data, sizeof(*ctx)); */ + ctx->size = size; + ctx->bpp = bpp; + ctx->pitch = size.x * (bpp >> 3); + ctx->bytes = ctx->pitch * ctx->size.y; + ctx->fb = zalloc(ctx->bytes); return ctx; } |