diff options
| author | realtradam <[email protected]> | 2022-11-25 02:55:55 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-11-25 02:55:55 -0500 |
| commit | 4e7226ad1b081982e5cbed349edca1c5b0e1b779 (patch) | |
| tree | 6d497896f979e6bbcb0841d33d3a2815333cfef9 /src/batch.cpp | |
| parent | 6e1d0c6a3f3699e44000f411cd93261c460f75a9 (diff) | |
| download | Ogle-4e7226ad1b081982e5cbed349edca1c5b0e1b779.tar.gz Ogle-4e7226ad1b081982e5cbed349edca1c5b0e1b779.zip | |
fixed Makefile, implemented bunnymark
Diffstat (limited to 'src/batch.cpp')
| -rw-r--r-- | src/batch.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/batch.cpp b/src/batch.cpp index d380e53..b36e6d6 100644 --- a/src/batch.cpp +++ b/src/batch.cpp @@ -74,10 +74,10 @@ int Batch::drawTexture( float h_width = width / 2.0; return this->primativeDrawQuad( texture.id, - glm::vec3(x+h_height,y+h_width,0.0f), // top right - glm::vec3(x+h_height, y-h_width, 0.0f), // bottom right - glm::vec3(x-h_height, y-h_width, 0.0f), // bottom left - glm::vec3(x-h_height, y+h_height, 0.0f), // top left + glm::vec3(x+h_height,y+h_width, -1.0f), // top right + glm::vec3(x+h_height, y-h_width, -1.0f), // bottom right + glm::vec3(x-h_height, y-h_width, -1.0f), // bottom left + glm::vec3(x-h_height, y+h_height, -1.0f), // top left color ); } @@ -95,10 +95,10 @@ int Batch::drawRectangle( float h_width = width / 2.0; return this->primativeDrawQuad( 0, - glm::vec3(x+h_height,y+h_width,0.0f), // top right - glm::vec3(x+h_height, y-h_width, 0.0f), // bottom right - glm::vec3(x-h_height, y-h_width, 0.0f), // bottom left - glm::vec3(x-h_height, y+h_height, 0.0f), // top left + glm::vec3(x+h_height,y+h_width, -1.0f), // top right + glm::vec3(x+h_height, y-h_width, -1.0f), // bottom right + glm::vec3(x-h_height, y-h_width, -1.0f), // bottom left + glm::vec3(x-h_height, y+h_height, -1.0f), // top left color ); } @@ -170,7 +170,7 @@ void Batch::flush_batch() GL_ARRAY_BUFFER, vertices.size() * sizeof(float), vertices.data(), - GL_STATIC_DRAW + GL_DYNAMIC_DRAW ); // we already binded this in the VAO during initialization @@ -180,7 +180,7 @@ void Batch::flush_batch() GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(unsigned int), indices.data(), - GL_STATIC_DRAW + GL_DYNAMIC_DRAW ); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, last_texture); @@ -188,7 +188,7 @@ void Batch::flush_batch() glBindVertexArray(0); // unbind the VAO - last_texture = -1; + last_texture = 0; size = 0; vertices.clear(); indices.clear(); |
