20 #ifndef _STELQGLARRAYVERTEXBUFFERBACKEND_HPP_
21 #define _STELQGLARRAYVERTEXBUFFERBACKEND_HPP_
23 #include "VecMath.hpp"
25 #include "StelVertexBuffer.hpp"
26 #include "StelVertexBufferBackend.hpp"
27 #include "StelVertexAttribute.hpp"
38 virtual void addVertex(
const void*
const vertexInPtr);
40 virtual void getVertex(
const int index,
void*
const vertexOutPtr)
const;
42 virtual void setVertex(
const int index,
const void*
const vertexInPtr)
44 setVertexNonVirtual(index, vertexInPtr);
130 const QVector<StelVertexAttribute>&
attributes);
137 void setVertexNonVirtual(
const int index,
const void*
const vertexInPtr)
140 const unsigned char* attribPtr =
static_cast<const unsigned char*
>(vertexInPtr);
141 for(
int attrib = 0; attrib <
attributes.count; ++attrib)
143 const AttributeInterpretation interpretation =
148 case AttributeType_Vec2f:
149 getAttribute<Vec2f>(interpretation, index)
150 = *reinterpret_cast<const Vec2f*>(attribPtr);
152 case AttributeType_Vec3f:
153 getAttribute<Vec3f>(interpretation, index)
154 = *reinterpret_cast<const Vec3f*>(attribPtr);
156 case AttributeType_Vec4f:
157 getAttribute<Vec4f>(interpretation, index)
158 = *reinterpret_cast<const Vec4f*>(attribPtr);
181 A& getAttribute(
const AttributeInterpretation interpretation,
const int vertexIndex)
190 const A& getAttributeConst(
const AttributeInterpretation interpretation,
const int vertexIndex)
const
200 int getAttributeIndex(
const AttributeInterpretation interpretation)
const;
203 #endif // _STELQGLARRAYVERTEXBUFFERBACKEND_HPP_