* Draw a floor by looping over the floorSize and squareSize variables
*/
void drawFloor() {
- getTexture(currentGroundTexture);
- glBindTexture(GL_TEXTURE_2D, currentGroundTexture);
+ if ( currentGroundTexture != 0 ) {
+ getTexture(currentGroundTexture);
+ glBindTexture(GL_TEXTURE_2D, currentGroundTexture);
+ }
+
glBegin(GL_QUADS);
for ( int x = -floorSize; x < floorSize; x++ ) {
for ( int z = -floorSize; z < floorSize; z++ ) {
}
}
glEnd();
- glBindTexture(GL_TEXTURE_2D, 0);
+
+ if ( currentGroundTexture != 0 ) {
+ glBindTexture(GL_TEXTURE_2D, 0);
+ }
}
/**