-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScreen.hpp
42 lines (33 loc) · 856 Bytes
/
Screen.hpp
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
//
// Screen.h
// Chip-8 Emu
//
// Created by Daniel Hauser on 19.12.14.
// Copyright (c) 2014 Daniel Hauser. All rights reserved.
//
#pragma once
#include <string>
#include <SDL2/SDL.h>
#include "Preferences.hpp"
namespace UI
{
class Screen final
{
private:
SDL_Window *mWindow = nullptr;
SDL_Renderer *mRenderer = nullptr;
SDL_Texture *mTexture = nullptr;
int mTexWidth, mTexHeight;
bool mSuccess = false;
unsigned int mDrawColor = Preferences::RenderDrawColor();
unsigned int mClearColor = Preferences::RenderClearColor();
public:
// Getters & setters
bool Success() const { return mSuccess; }
// Ctors & dtor
Screen(const std::string &title, int width, int height, int texWidth, int texHeight);
~Screen();
// Methods
void Draw(const uint8_t *vram);
};
}