Make FlushVertexBuffer bail when buffer is empty
This commit is contained in:
parent
88c30442c5
commit
3baba6a727
1 changed files with 3 additions and 0 deletions
|
@ -366,6 +366,9 @@ static void FlushVertexBuffer(void)
|
|||
static unsigned long vertex_buffer_size[TOTAL_VBOS];
|
||||
static unsigned int current_vertex_buffer = 0;
|
||||
|
||||
if (current_vertex_buffer_slot == 0)
|
||||
return;
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_ids[current_vertex_buffer]);
|
||||
glVertexAttribPointer(ATTRIBUTE_INPUT_VERTEX_COORDINATES, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)offsetof(Vertex, vertex_coordinate));
|
||||
glVertexAttribPointer(ATTRIBUTE_INPUT_TEXTURE_COORDINATES, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)offsetof(Vertex, texture_coordinate));
|
||||
|
|
Loading…
Add table
Reference in a new issue