Skip to content

Commit

Permalink
refactor(world): renamed variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ms0g committed Apr 8, 2024
1 parent 4a46817 commit 68b0f47
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/world/mesh/IMesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class IMesh {
virtual void render() = 0;

protected:
unsigned int m_VAO{};
unsigned int m_VBO{};
unsigned int mVAO{};
unsigned int mVBO{};
// mesh Data
std::vector<float> mVertices;
};
10 changes: 5 additions & 5 deletions src/world/mesh/cellMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ CellMesh::CellMesh(std::vector<float>& vertices) :

void CellMesh::setup() {
// create vao
glGenVertexArrays(1, &m_VAO);
glBindVertexArray(m_VAO);
glGenVertexArrays(1, &mVAO);
glBindVertexArray(mVAO);

// create buffers
glGenBuffers(1, &m_VBO);
glGenBuffers(1, &mVBO);

// bind the buffer to be used
glBindBuffer(GL_ARRAY_BUFFER, m_VBO);
glBindBuffer(GL_ARRAY_BUFFER, mVBO);
glBufferData(GL_ARRAY_BUFFER, mVertices.size() * sizeof(float), &mVertices[0], GL_STATIC_DRAW);

// Set the vertex attribute pointers
Expand All @@ -28,7 +28,7 @@ void CellMesh::setup() {

void CellMesh::render() {
// draw mesh
glBindVertexArray(m_VAO);
glBindVertexArray(mVAO);
glDrawArrays(GL_TRIANGLES, 0, 36);
glBindVertexArray(0);

Expand Down
10 changes: 5 additions & 5 deletions src/world/mesh/skyboxMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ SkyboxMesh::SkyboxMesh(std::vector<float>& vertices, std::vector<Texture>& textu

void SkyboxMesh::setup() {
// create vao
glGenVertexArrays(1, &m_VAO);
glBindVertexArray(m_VAO);
glGenVertexArrays(1, &mVAO);
glBindVertexArray(mVAO);

// create buffers
glGenBuffers(1, &m_VBO);
glGenBuffers(1, &mVBO);

// bind the buffer to be used
glBindBuffer(GL_ARRAY_BUFFER, m_VBO);
glBindBuffer(GL_ARRAY_BUFFER, mVBO);
glBufferData(GL_ARRAY_BUFFER, mVertices.size() * sizeof(float), &mVertices[0], GL_STATIC_DRAW);

// Set the vertex attribute pointers
Expand All @@ -35,7 +35,7 @@ void SkyboxMesh::render() {

// draw mesh
glDepthFunc(GL_LEQUAL);
glBindVertexArray(m_VAO);
glBindVertexArray(mVAO);
glDrawArrays(GL_TRIANGLES, 0, 36);
glBindVertexArray(0);
glDepthFunc(GL_LESS);
Expand Down

0 comments on commit 68b0f47

Please sign in to comment.