20 #ifndef _STELVERTEXBUFFERBACKEND_HPP_
21 #define _STELVERTEXBUFFERBACKEND_HPP_
25 #include "StelVertexAttribute.hpp"
31 static const int MAX_VERTEX_ATTRIBUTES = 8;
66 int sizes[MAX_VERTEX_ATTRIBUTES];
71 Attributes(
const QVector<StelVertexAttribute>& attributeVector)
72 : count(attributeVector.size())
74 for(
int a = 0; a < count; ++a)
76 Q_ASSERT_X(count < MAX_VERTEX_ATTRIBUTES, Q_FUNC_INFO,
77 "Too many vertex attributes (increase MAX_VERTEX_ATTRIBUTES"
78 "in StelVertexBufferBackend.hpp)");
88 : attributes(attributes)
102 virtual void addVertex(
const void*
const vertexInPtr) = 0;
112 virtual void getVertex(
const int index,
void*
const vertexOutPtr)
const = 0;
123 virtual void setVertex(
const int index,
const void*
const vertexInPtr) = 0;
126 virtual void lock() = 0;
129 virtual void unlock() = 0;
136 virtual void clear() = 0;
142 Q_UNUSED(vertexSize);
148 for(
int attrib = 0; attrib <
attributes.count; ++attrib)
153 Q_ASSERT_X(bytes == vertexSize, Q_FUNC_INFO,
154 "Size of the vertex type in bytes doesn't match the sum of sizes of "
155 "all vertex attributes as reported by \"attributes\" data member.");
164 #endif // _STELVERTEXBUFFERBACKEND_HPP_