feat: implement double buffering

This commit is contained in:
2022-05-17 06:53:37 -03:00
parent 660c8a2d62
commit daf977ef06
2 changed files with 54 additions and 12 deletions

View File

@@ -169,7 +169,7 @@ pub fn main() anyerror!void {
}
// FIXME: Is it OK just to copy the Emulator's Frame Buffer to SDL?
const buf_ptr = cpu.bus.ppu.framebuf.ptr;
const buf_ptr = cpu.bus.ppu.framebuf.get(.Renderer).ptr;
_ = SDL.SDL_UpdateTexture(texture, null, buf_ptr, framebuf_pitch);
_ = SDL.SDL_RenderCopy(renderer, texture, null, null);
SDL.SDL_RenderPresent(renderer);