12 unsigned int m_id = 0;
19 GLCall( glGenBuffers(1, &m_id) );
21 GLCall( glBindBuffer(GL_ARRAY_BUFFER, m_id) );
23 GLCall( glBufferData(GL_ARRAY_BUFFER, size,
nullptr, GL_DYNAMIC_DRAW) );
27 GLCall( glDeleteBuffers(1, &m_id) );
31 GLCall( glBindBuffer(GL_ARRAY_BUFFER, m_id) );
35 GLCall( glBindBuffer(GL_ARRAY_BUFFER, 0) );
38 void Load(
float verts[], std::size_t size)
override {
44 GLCall( glBufferSubData(GL_ARRAY_BUFFER, m_offset, size, verts) );
48 size_t GetSize()
override {
return m_size; };
53 unsigned int m_id = 0;
58 GLCall( glGenBuffers(1, &m_id) );
60 GLCall( glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_id) );
64 GLCall( glDeleteBuffers(1, &m_id) );
68 GLCall( glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_id) );
72 GLCall( glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0) );
75 void Load(
unsigned int inds[], std::size_t size)
override {
77 GLCall( glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_id) );
78 GLCall( glBufferData(GL_ELEMENT_ARRAY_BUFFER,
80 inds, GL_DYNAMIC_DRAW) );
83 size_t GetSize()
override {
return m_size; };