Code cleanup
[crawl.git] / crawl-ref / source / glwrapper-ogl.h
blob464ba48e28b9f1703ba3edff49e55cb8fd3360f5
1 #ifndef OGL_GL_WRAPPER_H
2 #define OGL_GL_WRAPPER_H
4 #ifdef USE_TILE
5 #ifdef USE_GL
7 #include "glwrapper.h"
9 class OGLStateManager : public GLStateManager
11 public:
12 OGLStateManager();
14 // State Manipulation
15 virtual void set(const GLState& state);
16 virtual void pixelstore_unpack_alignment(unsigned int bpp);
17 virtual void reset_view_for_redraw(float x, float y);
18 virtual void reset_view_for_resize(const coord_def &m_windowsz);
19 virtual void set_transform(const GLW_3VF &trans, const GLW_3VF &scale);
20 virtual void reset_transform();
22 // Texture-specific functinos
23 virtual void delete_textures(size_t count, unsigned int *textures);
24 virtual void generate_textures(size_t count, unsigned int *textures);
25 virtual void bind_texture(unsigned int texture);
26 virtual void load_texture(unsigned char *pixels, unsigned int width,
27 unsigned int height, MipMapOptions mip_opt);
28 protected:
29 GLState m_current_state;
32 class OGLShapeBuffer : public GLShapeBuffer
34 public:
35 OGLShapeBuffer(bool texture = false, bool colour = false,
36 drawing_modes prim = GLW_RECTANGLE);
38 virtual const char *print_statistics() const;
39 virtual unsigned int size() const;
41 virtual void add(const GLWPrim &rect);
42 virtual void draw(const GLState &state);
43 virtual void clear();
45 protected:
46 // Helper methods for adding specific primitives.
47 void add_rect(const GLWPrim &rect);
48 void add_line(const GLWPrim &rect);
50 drawing_modes m_prim_type;
51 bool m_texture_verts;
52 bool m_colour_verts;
54 std::vector<GLW_3VF> m_position_buffer;
55 std::vector<GLW_2VF> m_texture_buffer;
56 std::vector<VColour> m_colour_buffer;
57 std::vector<unsigned short int> m_ind_buffer;
60 #endif // USE_GL
61 #endif // USE_TILE
62 #endif // OGL_GL_WRAPPER_H