summaryrefslogtreecommitdiff
path: root/Widgets/FrameBufferSDL.h
blob: f85b633d6468937db04fe623564eb1e54986ae80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include "AbstractScreen.h"
#include <SDL.h>

class FrameBufferSDL final : public AbstractScreen {
public:
    FrameBufferSDL(unsigned width, unsigned height);
    virtual ~FrameBufferSDL() override;

    void show();

    SDL_Surface* surface() { return m_surface; }
    SDL_Window* window() { return m_window; }

    static FrameBufferSDL& the();

private:
    void initializeSDL();

    SDL_Window* m_window { nullptr };
    SDL_Surface* m_surface { nullptr };
};