diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/common.hpp | 26 | ||||
-rw-r--r-- | include/texture.hpp | 1 |
2 files changed, 25 insertions, 2 deletions
diff --git a/include/common.hpp b/include/common.hpp index bbe852f..eb8a290 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -146,16 +146,25 @@ public: float red; float green; float blue; - Color() + float alpha; + Color() { - red = green = blue = 0; + red = green = blue = alpha = 0; } Color(float r, float g ,float b) { red = r; green = g; blue = b; + alpha = 255; } + Color(float r, float g, float b, float a) + { + red = r; + green = g; + blue = b; + alpha = a; + } Color operator-=(float a) { red-=a; green-=a; @@ -170,6 +179,19 @@ public: } }; +/* + * A function used to tell the program what shader, attributes, and uniforms + * we want to draw our rectangles to. See below | + * \|/ + */ +void useShader(GLuint *sh, GLint *tu, GLint *ca, GLint *ta); + +/* + * A function to draw a colored box for opengl + * To use it, the lower left hand and upper right hand coords are passed along + */ +void drawRect(vec2 ll, vec2 ur); + // gets the length of `n` HLINEs template<typename T> inline T HLINES(const T &n) diff --git a/include/texture.hpp b/include/texture.hpp index ecf85e4..df2a83c 100644 --- a/include/texture.hpp +++ b/include/texture.hpp @@ -26,6 +26,7 @@ namespace Texture { */ GLuint loadTexture(std::string fileName); + GLuint genColor(Color c); void freeTextures(void); |