redesigned display peripheral
This commit is contained in:
@@ -2,16 +2,22 @@
|
||||
|
||||
#include "Peripherals.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <SDL2/SDL_video.h>
|
||||
|
||||
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() const;
|
||||
|
||||
private:
|
||||
using Framebuffer = std::array<chocochip8::Scanline, chocochip8::gcHeight>;
|
||||
std::unique_ptr<Framebuffer> mpFramebuffer;
|
||||
SDL_Window *mpWindow;
|
||||
Uint32 mFgColor;
|
||||
Uint32 mBgColor;
|
||||
|
||||
Reference in New Issue
Block a user