-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender.h
More file actions
29 lines (24 loc) · 792 Bytes
/
render.h
File metadata and controls
29 lines (24 loc) · 792 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
#pragma once
#include <string>
#include <SDL.h>
class RenderWindow {
static const Uint32 _winflags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_MAXIMIZED;
static const Uint32 _renflags = SDL_RENDERER_ACCELERATED;
SDL_Window* _window;
SDL_Renderer* _renderer;
SDL_Surface* _icon;
RenderWindow();
public:
RenderWindow(const RenderWindow&) = delete;
RenderWindow& operator=(const RenderWindow&) = delete;
~RenderWindow();
void render(SDL_Texture*, const SDL_Rect*) const;
void render(SDL_Texture*, const SDL_Rect*, const SDL_Rect*) const;
void clear(Uint8, Uint8, Uint8) const;
void display() const;
static RenderWindow& get_instance();
SDL_Renderer* get_renderer() const;
void get_size(int*, int*) const;
void get_position(int*, int*) const;
void set_title(const std::string&);
};