display now only draws chipxels that have changed

This commit is contained in:
2025-03-14 17:35:31 -04:00
parent ac5313a6ca
commit 22526c1b90
2 changed files with 51 additions and 25 deletions

View File

@@ -13,12 +13,14 @@ public:
~DisplaySDL() override;
void clear() override;
int blit(const chocochip8::Scanline &scanline, int y) override;
void updateWindow() const;
void updateWindow(bool forceWindowUpdate = false) const;
private:
using Framebuffer = std::array<chocochip8::Scanline, chocochip8::gcHeight>;
std::unique_ptr<Framebuffer> mpFramebuffer;
mutable std::unique_ptr<Framebuffer> mpDisplayState;
SDL_Window *mpWindow;
Uint32 mFgColor;
Uint32 mBgColor;
mutable bool mDoClear;
};