diff options
Diffstat (limited to 'src/renderer.h')
| -rw-r--r-- | src/renderer.h | 42 |
1 files changed, 42 insertions, 0 deletions
| diff --git a/src/renderer.h b/src/renderer.h new file mode 100644 index 0000000..de5fc31 --- /dev/null +++ b/src/renderer.h | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | #include <GL/glew.h> | ||
| 2 | #include <GLFW/glfw3.h> | ||
| 3 | #include <glm/glm.hpp> | ||
| 4 | |||
| 5 | using namespace glm; | ||
| 6 | |||
| 7 | #ifndef RENDERER_H | ||
| 8 | #define RENDERER_H | ||
| 9 | |||
| 10 | struct Rectangle { | ||
| 11 | int x; | ||
| 12 | int y; | ||
| 13 | int w; | ||
| 14 | int h; | ||
| 15 | |||
| 16 | Rectangle() {}; | ||
| 17 | |||
| 18 | Rectangle(int m_x, int m_y, int m_w, int m_h) | ||
| 19 | { | ||
| 20 | x = m_x; | ||
| 21 | y = m_y; | ||
| 22 | w = m_w; | ||
| 23 | h = m_h; | ||
| 24 | } | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct Texture { | ||
| 28 | GLuint texID; | ||
| 29 | int width; | ||
| 30 | int height; | ||
| 31 | }; | ||
| 32 | |||
| 33 | GLFWwindow* initRenderer(); | ||
| 34 | void destroyRenderer(); | ||
| 35 | Texture* createTexture(int width, int height); | ||
| 36 | void destroyTexture(Texture* tex); | ||
| 37 | Texture* loadTextureFromBMP(char* filename); | ||
| 38 | void fillTexture(Texture* tex, Rectangle* loc, int r, int g, int b); | ||
| 39 | void blitTexture(Texture* srctex, Texture* dsttex, Rectangle* srcrect, Rectangle* dstrect); | ||
| 40 | void renderScreen(Texture* tex); | ||
| 41 | |||
| 42 | #endif | ||
