feat: rework ebo, vao and vbo

This commit is contained in:
2025-12-08 15:53:48 +01:00
parent 0d5caf1d19
commit b8a0cdfa3e
5 changed files with 20 additions and 16 deletions

View File

@@ -11,7 +11,6 @@ void VAO::unbind() { glBindVertexArray(0); }
void VAO::setAttributePointer(GLuint index, GLuint size, GLenum type,
GLsizei stride, const void* offset)
{
bind();
glEnableVertexAttribArray(index);
glVertexAttribPointer(index, size, type, GL_FALSE, stride, offset);
}
@@ -19,12 +18,10 @@ void VAO::setAttributePointer(GLuint index, GLuint size, GLenum type,
void VAO::drawElement(GLenum mode, GLsizei count, GLenum type,
const void* indices)
{
bind();
glDrawElements(mode, count, type, indices);
}
void VAO::drawArray(GLenum mode, GLint first, GLsizei count)
{
bind();
glDrawArrays(mode, first, count);
}