push and pop the matrix for voxel system draw

This commit is contained in:
Stephen Birarda 2013-03-21 17:12:50 -07:00
parent 5f052d7c9e
commit 6712d23cd1

View file

@ -146,6 +146,8 @@ void VoxelSystem::init() {
void VoxelSystem::render() {
glPushMatrix();
if (voxelsToRender) {
glBindBuffer(GL_ARRAY_BUFFER, vboVerticesID);
glBufferData(GL_ARRAY_BUFFER, VERTEX_POINTS_PER_VOXEL * sizeof(GLfloat) * MAX_VOXELS_PER_SYSTEM, NULL, GL_DYNAMIC_DRAW);
@ -182,7 +184,7 @@ void VoxelSystem::render() {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
// scale back down to 1 so heads aren't massive
glScalef(1, 1, 1);
glPopMatrix();
}
void VoxelSystem::simulate(float deltaTime) {