summaryrefslogtreecommitdiffstats
path: root/include/video.hpp
blob: 3c2a238f14b5ebcfb5b1a949a1378c0a826ad6f6 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once

#include <string>
#include <array>

extern "C" {
#include <SDL2/SDL_video.h>
#include <SDL2/SDL_render.h>
}

namespace wrapsdl2 {
    typedef SDL_Point point;
    typedef SDL_Rect rect;

    class window {
    public:
        window() = delete;
        window(const window& other) = delete;

        window(const std::string& title, std::size_t width, std::size_t height);
        ~window();

        // setters
        void open();
        void close();


        void show();
        void hide();
        void raise();

        // getters
        bool is_open();
        bool is_visible();

        // rendering
        void update();

    private:
        bool m_open;
        SDL_Window *m_window;
        SDL_Renderer *m_renderer;
    };
}