45 #ifndef ACG_VERTEXDECLARATION_HH 46 #define ACG_VERTEXDECLARATION_HH 52 #include <ACG/Config/ACGDefines.hh> 72 VERTEX_USAGE_FORCE_DWORD = 0xFFFFFFFF
92 void setByteOffset(
unsigned int _offset);
96 unsigned int getByteOffset()
const;
100 bool operator == (
const VertexElement& _other)
const;
104 bool operator != (
const VertexElement& _other)
const {
return !(*
this == _other);}
281 void addElement(
unsigned int _type,
unsigned int _numElements,
VERTEX_USAGE _usage,
const void* _pointer,
const char* _shaderInputName = 0,
unsigned int _divisor = 0,
unsigned int _vbo = 0);
285 void addElement(
unsigned int _type,
unsigned int _numElements,
VERTEX_USAGE _usage,
size_t _byteOffset = 0,
const char* _shaderInputName = 0,
unsigned int _divisor = 0,
unsigned int _vbo = 0);
289 void addElements(
unsigned int _numElements,
const VertexElement* _pElements);
298 void activateFixedFunction()
const;
302 void deactivateFixedFunction()
const;
320 void setVertexStride(
unsigned int _stride);
324 unsigned int getVertexStride(
unsigned int i = 0)
const;
328 unsigned int getNumElements()
const;
344 static size_t getGLTypeSize(
unsigned int _type);
348 static size_t getElementSize(
const VertexElement* _pElement);
352 static bool supportsInstancedArrays();
356 QString toString()
const;
373 void updateOffsets();
381 std::vector<VertexElement> elements_;
400 #endif // ACG_VERTEXDECLARATION_HH defined This namespace contains all the classes and functions for handling GLSL shader and program objects...
Namespace providing different geometric functions concerning angles.
Class to define the vertex input layout.
unsigned int vertexStride_
Offset in bytes between each vertex.
defined by user via VertexElement::shaderInputName_
unsigned int divisor_
For instanced rendering: Step rate describing how many instances are drawn before advancing to the ne...
VERTEX_USAGE usage_
position, normal, shader input ..
const char * shaderInputName_
set shader input name, if usage_ = VERTEX_USAGE_USER_DEFINED otherwise this is set automatically...
VERTEX_USAGE
-— input name in vertex shader ----—
Description of one vertex element.
const void * pointer_
Offset in bytes to the first occurrence of this element in vertex buffer; Or address to vertex data i...
unsigned int vbo_
Explicit vbo source of this element, set to 0 if the buffer bound at the time of activating the decla...
unsigned int numElements_
how many elements of type_
std::map< unsigned int, unsigned int > vertexStridesVBO_
Map vbo to offset in bytes between each vertex in that vbo.
int strideUserDefined_
Flag that indicates, whether the stride was set by user or derived automatically. ...
unsigned int type_
GL_FLOAT, GL_UNSIGNED_BYTE, GL_INT, ...