rename to vertex array

main
Brett 2023-12-28 13:05:36 -05:00
parent 002f5c2ae8
commit cec16931f2
2 changed files with 10 additions and 10 deletions

View File

@ -100,7 +100,7 @@ namespace blt::gfx
/** /**
* basic VAO class. * basic VAO class.
*/ */
class basic_vertex_array class vertex_array
{ {
private: private:
GLuint vaoID; GLuint vaoID;
@ -108,15 +108,15 @@ namespace blt::gfx
HASHSET<GLuint> used_attributes; HASHSET<GLuint> used_attributes;
vbo_t element; vbo_t element;
public: public:
basic_vertex_array(); vertex_array();
basic_vertex_array(const basic_vertex_array&) = delete; vertex_array(const vertex_array&) = delete;
basic_vertex_array(basic_vertex_array&&) = delete; vertex_array(vertex_array&&) = delete;
basic_vertex_array& operator=(const basic_vertex_array&) = delete; vertex_array& operator=(const vertex_array&) = delete;
basic_vertex_array& operator=(basic_vertex_array&&) = delete; vertex_array& operator=(vertex_array&&) = delete;
/** /**
* This function takes ownership of the underlying VBO (GPU side). It will be freed when the basic vertex array is deleted * This function takes ownership of the underlying VBO (GPU side). It will be freed when the basic vertex array is deleted
@ -143,7 +143,7 @@ namespace blt::gfx
glBindVertexArray(vaoID); glBindVertexArray(vaoID);
} }
~basic_vertex_array(); ~vertex_array();
}; };
} }

View File

@ -104,12 +104,12 @@ namespace blt::gfx
* ---------------------------- * ----------------------------
*/ */
basic_vertex_array::basic_vertex_array(): vaoID(0) vertex_array::vertex_array(): vaoID(0)
{ {
glGenVertexArrays(1, &vaoID); glGenVertexArrays(1, &vaoID);
} }
basic_vertex_array::~basic_vertex_array() vertex_array::~vertex_array()
{ {
// free all VBOs // free all VBOs
for (size_t i = 0; i < VBOs.used(); i++) for (size_t i = 0; i < VBOs.used(); i++)
@ -119,7 +119,7 @@ namespace blt::gfx
glDeleteVertexArrays(1, &vaoID); glDeleteVertexArrays(1, &vaoID);
} }
void basic_vertex_array::bindVBO(const vbo_t& vbo, int attribute_number, int coordinate_size, GLenum type, int stride, long offset) void vertex_array::bindVBO(const vbo_t& vbo, int attribute_number, int coordinate_size, GLenum type, int stride, long offset)
{ {
used_attributes.insert(attribute_number); used_attributes.insert(attribute_number);
bind(); bind();