3#include "common/types/OpenGLTypes.h"
4#include "utils/Error.h"
12 unsigned char normalised;
14 static unsigned int GetSizeOfType(
unsigned int type)
22 case GL_UNSIGNED_BYTE:
34 unsigned int m_Stride;
35 Vector<VertexBufferElement> m_Elements;
37 void Push(
unsigned int type,
unsigned int count,
unsigned char normalized)
39 m_Elements.push_back({ type, count, normalized });
40 m_Stride += count * VertexBufferElement::GetSizeOfType(type);
49 void AddFloat(
unsigned int count) { Push(GL_FLOAT, count, GL_FALSE); }
51 void AddUnsignedInt(
unsigned int count) { Push(GL_UNSIGNED_INT, count, GL_FALSE); }
53 void AddUnsignedByte(
unsigned int count) { Push(GL_UNSIGNED_BYTE, count, GL_TRUE); }
55 inline const Vector<VertexBufferElement> GetElements()
const {
return m_Elements; };
57 inline unsigned int GetStride()
const {
return m_Stride; };