Double buffer framebuffer drawing
This commit is contained in:
@@ -113,7 +113,7 @@ static void drawCharacter(gfx_context *ctx, uint64_t x, uint64_t y, uint32_t clr
|
||||
uint64_t loc = \
|
||||
y * ctx->pitch + \
|
||||
x * ctx->bpp;
|
||||
uint32_t *fb = incptr(P2V(ctx->addr), loc);
|
||||
uint32_t *fb = incptr(ctx->buffer, loc);
|
||||
for(int row = 0; row < 16; row++)
|
||||
{
|
||||
for(int col = 0; col < 8; col++)
|
||||
@@ -143,6 +143,7 @@ void fbterm_init(gfx_context *ctx)
|
||||
{
|
||||
term_fb = framebuffer_make_subcontext(ctx, 20, 20, 8*VGA_COLS+8, 16*VGA_ROWS+8);
|
||||
draw_border(term_fb, RGB(255, 0, 0));
|
||||
flip(term_fb);
|
||||
term_fb = framebuffer_make_subcontext(ctx, 24, 24, 8*VGA_COLS, 16*VGA_ROWS);
|
||||
setup = 1;
|
||||
}
|
||||
@@ -163,4 +164,5 @@ void fbterm_flush(struct vga_cell *buffer)
|
||||
drawCharacter(term_fb, col*8, row*16, 0xFFFFFF, 0, (char)buffer[i++].c);
|
||||
}
|
||||
}
|
||||
flip(term_fb);
|
||||
}
|
||||
Reference in New Issue
Block a user