From 7f0e8c7ef70c62814c274f110367db92f01cbb26 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 10 Mar 2015 00:41:59 -0400 Subject: C++11'd everything! Also moved location information from physics components into entity. --- src/renderer.h | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'src/renderer.h') diff --git a/src/renderer.h b/src/renderer.h index a4e21f7..509e935 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -1,9 +1,5 @@ #include #include -#include -#include - -using namespace glm; #ifndef RENDERER_H #define RENDERER_H @@ -13,33 +9,29 @@ struct Rectangle { int y; int w; int h; - - Rectangle() {}; - - Rectangle(int m_x, int m_y, int m_w, int m_h) - { - x = m_x; - y = m_y; - w = m_w; - h = m_h; - } }; -struct Texture { - GLuint texID; - int width; - int height; +class Texture { + public: + Texture(int width, int height); + Texture(const char* file); + Texture(Texture& tex); + Texture(Texture&& tex); + ~Texture(); + Texture& operator= (Texture tex); + friend void swap(Texture& tex1, Texture& tex2); + void fill(Rectangle loc, int r, int g, int b); + void blit(Texture& src, Rectangle srcrect, Rectangle dstrect); + void renderScreen(); + Rectangle entirety(); + + private: + GLuint texID; + int width; + int height; }; GLFWwindow* initRenderer(); void destroyRenderer(); -Texture* createTexture(int width, int height); -void destroyTexture(Texture* tex); -Texture* loadTextureFromFile(char* filename); -void saveTextureToBMP(Texture* tex, char* filename); -void fillTexture(Texture* tex, Rectangle* loc, int r, int g, int b); -void blitTexture(Texture* srctex, Texture* dsttex, Rectangle* srcrect, Rectangle* dstrect); -void renderWithoutEffects(Texture* tex); -void renderScreen(Texture* tex); #endif -- cgit 1.4.1