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;
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_;
Class to define the vertex input layout.
int strideUserDefined_
Flag that indicates, whether the stride was set by user or derived automatically.
unsigned int vertexStride_
Offset in bytes between each vertex.
std::map< unsigned int, unsigned int > vertexStridesVBO_
Map vbo to offset in bytes between each vertex in that vbo.
Namespace providing different geometric functions concerning angles.
VERTEX_USAGE
-— input name in vertex shader ----—
@ VERTEX_USAGE_NORMAL
"inNormal"
@ VERTEX_USAGE_COLOR
"inColor"
@ VERTEX_USAGE_POSITION
"inPosition"
@ VERTEX_USAGE_BLENDWEIGHTS
"inBlendWeights"
@ VERTEX_USAGE_BLENDINDICES
"inBlendIndices"
@ VERTEX_USAGE_TEXCOORD
"inTexCoord"
@ VERTEX_USAGE_SHADER_INPUT
defined by user via VertexElement::shaderInputName_
This namespace contains all the classes and functions for handling GLSL shader and program objects.
Description of one vertex element.
unsigned int divisor_
For instanced rendering: Step rate describing how many instances are drawn before advancing to the ne...
unsigned int numElements_
how many elements of type_
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...
VERTEX_USAGE usage_
position, normal, shader input ..
unsigned int type_
GL_FLOAT, GL_UNSIGNED_BYTE, GL_INT, ...
const char * shaderInputName_
set shader input name, if usage_ = VERTEX_USAGE_USER_DEFINED otherwise this is set automatically,...