diff options
author | Ixtli <cg@325i.org> | 2010-03-01 02:57:23 +0900 |
---|---|---|
committer | Enne Walker <ennewalker@users.sourceforge.net> | 2010-04-24 10:19:38 -0400 |
commit | a79a36f5a6e26c71f977378f9c25d66a5cf81ba9 (patch) | |
tree | 9aac554d98ce601c58f34cd900d2eefec187cdc6 /crawl-ref/source/glwrapper.h | |
parent | 8067f73bd6766fb11c099994c77d86e1848021da (diff) | |
download | crawl-ref-a79a36f5a6e26c71f977378f9c25d66a5cf81ba9.tar.gz crawl-ref-a79a36f5a6e26c71f977378f9c25d66a5cf81ba9.zip |
Added glwrapper, which expands the GLStateManager class from tilebuf into a (g)raphics (l)ibrary wrapper. Also updated the makefile to include it when making with GL=y
Diffstat (limited to 'crawl-ref/source/glwrapper.h')
-rw-r--r-- | crawl-ref/source/glwrapper.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/crawl-ref/source/glwrapper.h b/crawl-ref/source/glwrapper.h new file mode 100644 index 0000000000..7f4a84039f --- /dev/null +++ b/crawl-ref/source/glwrapper.h @@ -0,0 +1,44 @@ +#ifndef GLWRAPPER_H +#define GLWRAPPER_H + +#ifdef USE_TILE +#ifdef USE_GL + +struct GLState +{ + GLState(); + + // vertex arrays + bool array_vertex; + bool array_texcoord; + bool array_colour; + + // render state + bool blend; + bool texture; + bool depthtest; + bool alphatest; + unsigned char alpharef; +}; + +class GLStateManager +{ +public: + static void init(); + static void set(const GLState& state); + static void drawPTVert(long int size, int mode, int count, + void *vert_pointer, void *tex_pointer); + static void drawPCVert(long int size, int mode, int count, + void *vert_pointer, void *color_pointer); + static void drawPTCVert(long int size, int mode, int count, + void *vert_pointer, void *tex_pointer, void *color_pointer); + static void drawP3TCVert(long int size, int mode, int count, + void *vert_pointer, void *tex_pointer, void *color_pointer); + static void pushMatrix(); + static void popMatrix(); + static void translatef(float x, float y, float z); +}; + +#endif // use_gl +#endif // use_tile +#endif // include guard
\ No newline at end of file |