globjects  1.0.0.000000000000
Strict OpenGL objects wrapper.
VertexAttributeBinding.h
Go to the documentation of this file.
1
2#pragma once
3
4#include <glm/fwd.hpp>
5
6#include <glbinding/gl/types.h>
7#include <glbinding/gl/boolean.h>
8
10
11#include <globjects/globjects_api.h>
12
13
14namespace globjects
15{
16
17
18class Buffer;
19class VertexArray;
20
21class GLOBJECTS_API VertexAttributeBinding : public Referenced
22{
23 friend class AbstractVertexAttributeBindingImplementation;
24
25public:
27 VertexArray * vao
28 , const gl::GLint bindingIndex);
29
30 const VertexArray * vao() const;
32
33 void setDivisor(gl::GLint divisor);
34
35 void setAttribute(gl::GLint attributeIndex);
36
37 gl::GLint attributeIndex() const;
38 gl::GLint bindingIndex() const;
39
43 const Buffer * buffer() const;
45 const Buffer * vbo
46 , gl::GLint baseoffset
47 , gl::GLint stride);
48
50 gl::GLint size
51 , gl::GLenum type
52 , gl::GLboolean normalized = gl::GL_FALSE
53 , gl::GLuint relativeoffset = 0);
55 gl::GLint size
56 , gl::GLenum type
57 , gl::GLuint relativeoffset = 0);
59 gl::GLint size
60 , gl::GLenum type
61 , gl::GLuint relativeoffset = 0);
62
66 void setValue(gl::GLboolean value);
67 void setValue(gl::GLbyte value);
68 void setValue(gl::GLshort value);
69 void setValue(gl::GLint value);
70 void setValue(gl::GLint64 value);
71 void setValue(gl::GLfloat value);
72 void setValue(gl::GLdouble value);
73
74 void setValue(const glm::bvec2 & value);
75 void setValue(const glm::ivec2 & value);
76 void setValue(const glm::vec2 & value);
77 void setValue(const glm::dvec2 & value);
78
79 void setValue(const glm::bvec3 & value);
80 void setValue(const glm::ivec3 & value);
81 void setValue(const glm::vec3 & value);
82 void setValue(const glm::dvec3 & value);
83
84 void setValue(const glm::bvec4 & value);
85 void setValue(const glm::ivec4 & value);
86 void setValue(const glm::vec4 & value);
87 void setValue(const glm::dvec4 & value);
88
89 void setValue(const glm::mat2 & value);
90 void setValue(const glm::mat3 & value);
91 void setValue(const glm::mat4 & value);
92 void setValue(const glm::dmat2 & value);
93 void setValue(const glm::dmat3 & value);
94 void setValue(const glm::dmat4 & value);
95
96protected:
98
99protected:
100 VertexArray * m_vao; // TODO: weak_ptr?
101
102 gl::GLint m_bindingIndex;
104
105 const Buffer * m_vbo;
106
107 mutable void * m_bindingData;
108};
109
110
111} // namespace globjects
Wrapper for OpenGL buffer objects.
Definition: Buffer.h:36
Superclass for all classes that use reference counting in globjects.
Definition: Referenced.h:23
Definition: VertexArray.h:23
Definition: VertexAttributeBinding.h:22
void * m_bindingData
Definition: VertexAttributeBinding.h:107
void setValue(const glm::dmat3 &value)
void setValue(const glm::bvec2 &value)
void setValue(gl::GLint64 value)
void setValue(const glm::dmat2 &value)
const Buffer * buffer() const
void setAttribute(gl::GLint attributeIndex)
void setValue(const glm::mat3 &value)
void setValue(const glm::mat2 &value)
void setValue(gl::GLbyte value)
void setValue(const glm::vec4 &value)
void setValue(const glm::bvec4 &value)
void setValue(const glm::ivec4 &value)
void setValue(gl::GLfloat value)
void setValue(gl::GLboolean value)
void setValue(const glm::vec3 &value)
void setValue(const glm::mat4 &value)
void setValue(gl::GLdouble value)
void setValue(const glm::dvec4 &value)
void setValue(const glm::ivec3 &value)
const Buffer * m_vbo
Definition: VertexAttributeBinding.h:105
VertexArray * m_vao
Definition: VertexAttributeBinding.h:100
const VertexArray * vao() const
void setLFormat(gl::GLint size, gl::GLenum type, gl::GLuint relativeoffset=0)
void setValue(const glm::dvec2 &value)
VertexAttributeBinding(VertexArray *vao, const gl::GLint bindingIndex)
void setDivisor(gl::GLint divisor)
void setValue(const glm::vec2 &value)
void setIFormat(gl::GLint size, gl::GLenum type, gl::GLuint relativeoffset=0)
void setValue(gl::GLshort value)
void setValue(const glm::ivec2 &value)
gl::GLint m_bindingIndex
Definition: VertexAttributeBinding.h:102
gl::GLint m_attributeIndex
Definition: VertexAttributeBinding.h:103
void setFormat(gl::GLint size, gl::GLenum type, gl::GLboolean normalized=gl::GL_FALSE, gl::GLuint relativeoffset=0)
void setValue(const glm::dvec3 &value)
void setBuffer(const Buffer *vbo, gl::GLint baseoffset, gl::GLint stride)
void setValue(gl::GLint value)
void setValue(const glm::dmat4 &value)
void setValue(const glm::bvec3 &value)
Contains all the classes that wrap OpenGL functionality.