SimpleGL  1.1.0
A framework for platform independent rendering
batching_gl.hpp
Go to the documentation of this file.
1 
8 #ifndef BATCHING_GL_HPP
9 #define BATCHING_GL_HPP
10 
11 #include <SimpleGL_gl/SimpleGL_gl_Export.h>
12 
13 #include <string>
14 
15 #include <SimpleGL/batching.hpp>
16 
17 #include "gl_general.hpp"
18 #include "vertex_array_object.hpp"
19 #include "vertex_buffer_object.hpp"
20 #include "shader_objects.hpp"
21 #include "texture_object.hpp"
22 
23 namespace sgl {
24 
30  class SIMPLEGL_GL_EXPORT BatchGL : public Batch {
31 
32  private:
34  static std::string vertexSource;
35 
37  static std::string fragmentSource;
38 
40  static Texture* defaultTexture;
41 
43  static ShaderProgram* defaultShaderProgram;
44 
46  VertexArray* vao;
47 
49  Buffer* vbo;
50 
52  Buffer* cbo;
53 
55  Buffer* tbo;
56 
58  Buffer* nbo;
59 
61  ShaderProgram* shaderProgram;
62 
64  Primitive mode;
65 
66  public:
73  BatchGL(int capacity = 1024 * 1024);
74 
76  ~BatchGL(void);
77 
79  void begin() override;
80 
86  void begin(Primitive mode);
87 
89  void flush() override;
90 
92  void specifyVertexAttributes();
93 
95  void applyTransform();
96 
98  void resetShaderProgram();
99 
105  ShaderProgram* getShaderProgram();
106 
112  void setShaderProgram(ShaderProgram* program);
113  };
114 }
115 
116 #endif /* BATCHING_GL_HPP */
This class is used for batch rendering with OpenGL.
Definition: batching_gl.hpp:30
Primitive
This enum wraps Primitive types of OpenGL.
Definition: gl_general.hpp:60
This class wraps an OpenGL vertex array object.
This class wraps an OpenGL shader program.
This class wraps an OpenGL buffer object.
Generic namespace for the SimpleGL framework.
Definition: application.hpp:18
This class wraps an OpenGL texture object.
This class defines methods for batch rendering.
Definition: batching.hpp:26