diff options
Diffstat (limited to 'src/GFX/Binder.cpp')
| -rw-r--r-- | src/GFX/Binder.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/GFX/Binder.cpp b/src/GFX/Binder.cpp index e8fc559..905ba24 100644 --- a/src/GFX/Binder.cpp +++ b/src/GFX/Binder.cpp @@ -10,7 +10,7 @@ BindableMesh Binder::load(const Mesh& mesh) { store_indices(mesh.indices().data(), mesh.indices().size()); } - int attribute_index = 0; + Int attribute_index = 0; for (const auto& attribute : mesh.attributes()) { store_in_attribute_list( attribute_index++, @@ -25,7 +25,7 @@ BindableMesh Binder::load(const Mesh& mesh) { return {vao, mesh.indices().size(), mesh.attributes().size()}; } -uint32_t Binder::create_vao() { +U32 Binder::create_vao() { GLuint vao; glGenVertexArrays(1, &vao); glBindVertexArray(vao); @@ -37,17 +37,17 @@ void Binder::unbind_vao() { glBindVertexArray(0); } -void Binder::store_indices(const uint32_t* indices, size_t indices_size) { +void Binder::store_indices(const U32* indices, USize indices_size) { GLuint ebo; glGenBuffers(1, &ebo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices_size * sizeof(float), indices, GL_STATIC_DRAW); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices_size * sizeof(U32), indices, GL_STATIC_DRAW); } -void Binder::store_in_attribute_list(uint32_t attribute, int attribute_size, int type_size, const void* data, long data_size) { - assert(type_size == sizeof(float)); +void Binder::store_in_attribute_list(U32 attribute, Int attribute_size, Int type_size, const void* data, long data_size) { + assert(type_size == sizeof(F32)); GLuint vbo; glGenBuffers(1, &vbo); @@ -60,23 +60,23 @@ void Binder::store_in_attribute_list(uint32_t attribute, int attribute_size, int void BindableMesh::bind() const { glBindVertexArray(m_vao); - for (int i = 0; i < m_attribute_count; i++) { + for (Int i = 0; i < m_attribute_count; i++) { glEnableVertexAttribArray(i); } } void BindableMesh::unbind() const { glBindVertexArray(0); - for (int i = 0; i < m_attribute_count; i++) { + for (Int i = 0; i < m_attribute_count; i++) { glDisableVertexAttribArray(i); } } -bool BindableMesh::has_indices() const { +Bool BindableMesh::has_indices() const { return m_has_indices; } -size_t BindableMesh::size() const { +USize BindableMesh::size() const { return m_vertex_count; } |
