#pragma once #include "Peripherals.hpp" #include #include #include #include class DisplaySDL : public chocochip8::Display { public: DisplaySDL(int w, int h, uint32_t fgCol = 0xffffff, uint32_t bgCol = 0x000000); ~DisplaySDL() override; void clear() override; int blit(const chocochip8::Scanline &scanline, int y) override; void updateWindow(bool forceWindowUpdate = false) const; private: using Framebuffer = std::array; std::unique_ptr mpFramebuffer; mutable std::unique_ptr mpDisplayState; SDL_Window *mpWindow; Uint32 mFgColor; Uint32 mBgColor; mutable bool mDoClear; };