mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
update ModelBatch semantics
This commit is contained in:
parent
ea0add3017
commit
94fe5eeb5b
7 changed files with 97 additions and 35 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include <GL/glew.h>
|
||||
|
||||
int Mesh::meshesCount = 0;
|
||||
int Mesh::drawCalls = 0;
|
||||
|
||||
Mesh::Mesh(const float* vertexBuffer, size_t vertices, const int* indexBuffer, size_t indices, const vattr* attrs) :
|
||||
ibo(0),
|
||||
|
|
@ -60,6 +61,7 @@ void Mesh::reload(const float* vertexBuffer, size_t vertices, const int* indexBu
|
|||
}
|
||||
|
||||
void Mesh::draw(unsigned int primitive){
|
||||
drawCalls++;
|
||||
glBindVertexArray(vao);
|
||||
if (ibo != 0) {
|
||||
glDrawElements(primitive, indices, GL_UNSIGNED_INT, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue