refresh gl settings to ensure drawing doesn't go funkyfied
authorIvan Hernanez <iturtleman128@gmail.com>
Mon, 28 May 2012 05:07:21 +0000 (00:07 -0500)
committerIvan Hernanez <iturtleman128@gmail.com>
Mon, 28 May 2012 05:07:21 +0000 (00:07 -0500)
Game.cpp

index 2d30670..01fb4be 100644 (file)
--- a/Game.cpp
+++ b/Game.cpp
@@ -28,20 +28,6 @@ void init_GL(int w = 640, int h = 480)
        glLoadIdentity();
 }
 
-void Reshape( int w, int h )
-{
-       if( h <= 0 ) h = 1 ;
-
-       glViewport( 0, 0, w, h ) ;
-
-       glMatrixMode( GL_PROJECTION ) ;
-       glLoadIdentity() ;
-       gluPerspective( 45.0, (GLfloat)w / (GLfloat)h, 0.1, 1000.0 ) ;
-
-       glMatrixMode( GL_MODELVIEW ) ;
-       glLoadIdentity() ;
-}
-
 /** Global static pointer used to ensure a single instance of the class. */
 Game* Game::m_instance = NULL;
 
@@ -170,7 +156,7 @@ void Game::run()
                        break;
 
                case SDL_VIDEORESIZE :
-                       Reshape( event.resize.w, event.resize.h ) ;
+                       init_GL( event.resize.w, event.resize.h ) ;
                        break ;
 
                case SDL_USEREVENT: