diff options
author | Ixtli <cg@325i.org> | 2010-03-09 04:19:42 +0900 |
---|---|---|
committer | Enne Walker <ennewalker@users.sourceforge.net> | 2010-04-24 10:19:43 -0400 |
commit | cd3e3d5b0563f32c2ce4007d6c42462351b408a8 (patch) | |
tree | 63ca72419d03675fee9c31229d14d925189a6a43 /crawl-ref/source/glwrapper.h | |
parent | c7744f87e94ba4513617ec217559eb14e8fc2bcc (diff) | |
download | crawl-ref-cd3e3d5b0563f32c2ce4007d6c42462351b408a8.tar.gz crawl-ref-cd3e3d5b0563f32c2ce4007d6c42462351b408a8.zip |
Removed drawTextBox and drawColoredBox and replaced them with calls to draw_primitive. Also added GLStateManager methods for setting the current drawing color, and a GLW_4VF struct for completeness.
Diffstat (limited to 'crawl-ref/source/glwrapper.h')
-rw-r--r-- | crawl-ref/source/glwrapper.h | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/crawl-ref/source/glwrapper.h b/crawl-ref/source/glwrapper.h index cface9263c..4918e32a8d 100644 --- a/crawl-ref/source/glwrapper.h +++ b/crawl-ref/source/glwrapper.h @@ -14,11 +14,37 @@ struct GLW_3VF GLW_3VF() {}; GLW_3VF(float l, float m, float n) : x(l), y(m), z(n) {} + inline void set(float l, float m, float n) + { + x = l; + y = m; + z = n; + } + float x; float y; float z; }; +struct GLW_4VF +{ + GLW_4VF() {}; + GLW_4VF(float l, float m, float n, float p) : x(l), y(m), z(n), t(p) {} + + inline void set(float l, float m, float n, float p) + { + x = l; + y = m; + z = n; + t = p; + } + + float x; + float y; + float z; + float t; +}; + enum MipMapOptions { MIPMAP_CREATE, @@ -43,7 +69,7 @@ struct GLPrimitive // Primitive Metadata drawing_modes mode; - unsigned int vertSize; // Coords per vertex + unsigned int vert_size; // Coords per vertex long unsigned int size; size_t count; @@ -55,6 +81,9 @@ struct GLPrimitive // Primitive render manipulations GLW_3VF *pretranslate; GLW_3VF *prescale; + + // State manipulations + GLW_3VF *color; }; struct GLState @@ -86,17 +115,12 @@ public: static void reset_view_for_resize(coord_def &m_windowsz); static void set_transform(GLW_3VF *translate, GLW_3VF *scale); static void reset_transform(); + static void set_current_color(GLW_3VF &color); + static void set_current_color(GLW_4VF &color); // Drawing GLPrimitives static void draw_primitive(const GLPrimitive &prim); - // Drawing tiles-specific objects - static void drawTextBlock(unsigned int x_pos, unsigned int y_pos, - long unsigned int stride, bool drop_shadow, size_t count, - const void *pos_verts, const void *tex_verts, const void *color_verts); - static void drawColorBox(long unsigned int stride, size_t count, - const void *pos_verts, const void *color_verts); - // Texture-specific functinos static void delete_textures(size_t count, unsigned int *textures); static void generate_textures(size_t count, unsigned int *textures); |