From e31fd5e84420b96a84ef8be0e29f8cc60606f458 Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Fri, 21 Oct 2011 14:29:01 +0800 Subject: [PATCH] --- helper.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/helper.c b/helper.c index 0f711c2..79cc5d8 100644 --- a/helper.c +++ b/helper.c @@ -210,8 +210,11 @@ int makeSubmenuFromArray( const char *menuEntries[], unsigned int menuEntriesSiz * 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++ ) { @@ -231,7 +234,10 @@ void drawFloor() { } } glEnd(); - glBindTexture(GL_TEXTURE_2D, 0); + + if ( currentGroundTexture != 0 ) { + glBindTexture(GL_TEXTURE_2D, 0); + } } /** -- 2.20.1