diff options
Diffstat (limited to 'include/common.hpp')
-rw-r--r-- | include/common.hpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/include/common.hpp b/include/common.hpp index e082a87..2442f5c 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -151,16 +151,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; @@ -175,6 +184,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) @@ -201,6 +223,7 @@ extern GLuint textShader; extern GLint textShader_attribute_coord; extern GLint textShader_attribute_tex; extern GLint textShader_uniform_texture; +extern GLint textShader_uniform_color; extern GLuint worldShader; extern GLint worldShader_attribute_coord; |