-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.hpp
More file actions
37 lines (27 loc) · 727 Bytes
/
Copy pathwindow.hpp
File metadata and controls
37 lines (27 loc) · 727 Bytes
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
#ifndef WINDOW_HPP
#define WINDOW_HPP
#include <SDL2/SDL.h>
#include <cstdint>
#include <string>
#include <array>
class Window
{
public:
Window(const std::string& str, int width, int height, int chip_width, int chip_height);
~Window();
void event_handler(std::array<uint8_t, 16>& keypads) noexcept;
void update(std::array<uint32_t, 2048>& display) noexcept;
constexpr bool is_running() noexcept
{
return running;
}
private:
SDL_Window* window = nullptr;
SDL_Renderer* renderer = nullptr;
SDL_Texture* texture = nullptr;
int m_chip_width;
bool running = true;
// let chip8 access all of window members
friend class Chip8;
};
#endif // WINDOW_HPP