1 #ifndef OGL_GL_WRAPPER_H
2 #define OGL_GL_WRAPPER_H
9 class OGLStateManager
: public GLStateManager
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
);
29 GLState m_current_state
;
32 class OGLShapeBuffer
: public GLShapeBuffer
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
);
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
;
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
;
62 #endif // OGL_GL_WRAPPER_H