gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
webgl1es2_vertex_format.h
1 // © 2018 Joseph Cameron - All Rights Reserved
2 
3 #ifndef GDK_GFX_VERTEXFORMAT_H
4 #define GDK_GFX_VERTEXFORMAT_H
5 
6 #include <gdk/opengl.h>
7 #include <gdk/webgl1es2_shader_program.h>
8 #include <gdk/webgl1es2_vertex_attribute.h>
9 
10 #include <string>
11 #include <vector>
12 
13 namespace gdk
14 {
27  {
29  std::vector<webgl1es2_vertex_attribute> m_Format;
30 
32  webgl1es2_vertex_attribute::size_type m_SumOfAttributeComponents = 0;
33 
34  public:
36  void enableAttributes(const webgl1es2_shader_program &aShaderProgram) const;
37 
39  int getSumOfAttributeComponents() const;
40 
45 
50 
52  webgl1es2_vertex_format(const std::vector<webgl1es2_vertex_attribute> &aAttributes);
53 
56 
59 
62  };
63 }
64 
65 #endif
Definition: camera.h:9
webgl1es2_vertex_format & operator=(const webgl1es2_vertex_format &)=default
copy semantics
void enableAttributes(const webgl1es2_shader_program &aShaderProgram) const
prepares gl context to draw vertex data formatted according to this vertex format ...
static const webgl1es2_vertex_format Pos3uv2Norm3
{3 position, 2 uv, 3 normal} format
Definition: webgl1es2_vertex_format.h:61
static const webgl1es2_vertex_format Pos3
{3 position} format
Definition: webgl1es2_vertex_format.h:55
int getSumOfAttributeComponents() const
Total number of components (sum of length of attributes)
Specifies drawing behaviours at the two programmable stages in the OpenGL ES 2.0/WebGL 1...
Definition: webgl1es2_shader_program.h:24
webgl1es2_vertex_format(const webgl1es2_vertex_format &)=default
copy semantics
informs the gl context how to interpret the currently bound vertex data.
Definition: webgl1es2_vertex_format.h:26
static const webgl1es2_vertex_format Pos3uv2
{3 position, 2 uv} format
Definition: webgl1es2_vertex_format.h:58