-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRenderer.hpp
More file actions
28 lines (21 loc) · 765 Bytes
/
Renderer.hpp
File metadata and controls
28 lines (21 loc) · 765 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
#ifndef GLContext_HPP
#define GLContext
#include <SDL2/SDL.h>
#include <SDL2/SDL.h>
#include "Window.hpp"
namespace TIE {
class Renderer : public Window{
public:
SDL_Renderer* sdlRenderer;
Renderer(const int& width = 640, const int& height = 480, const char* title = "", const int& x = SDL_WINDOWPOS_CENTERED, const int& y = SDL_WINDOWPOS_CENTERED, const unsigned int windowFlags = 0, const unsigned int rendererFlags = 0) : Window(title, x, y, width, height, windowFlags){
sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, rendererFlags);
}
void Refresh(){
SDL_RenderPresent(sdlRenderer);
}
~Renderer(){
SDL_DestroyRenderer(sdlRenderer);
}
};
}
#endif