]> git.jsancho.org Git - lugaru.git/blobdiff - Source/OpenGL_Windows.cpp
renaming some maps to be coherent.
[lugaru.git] / Source / OpenGL_Windows.cpp
index c74939ec77a30f3472b2e3c6e9aece7263eb7561..b25b0cba26dbf01ef8f5fc8d1c546105ee4bbe61 100644 (file)
@@ -236,8 +236,6 @@ void initGL(){
                fprintf(stderr, "Failed to initialize stereo, disabling.\n");
                stereomode = stereoNone;
        }
-
-    //TODO: load textures here
 }
 
 static void toggleFullscreen(){
@@ -248,7 +246,13 @@ static void toggleFullscreen(){
         screen=SDL_SetVideoMode(0,0,0,flags);
     if(!screen)
         exit(1);
+    //reload opengl state
     initGL();
+    for(std::vector<TextureInfo>::iterator it=Game::textures.begin(); it!=Game::textures.end(); it++) {
+        it->load();
+    }
+    pgame->text.BuildFont();
+    pgame->LoadScreenTexture();
 }
 
 static void sdlEventProc(const SDL_Event &e, Game &game){
@@ -358,6 +362,7 @@ Boolean SetUp (Game & game)
        }
 
     Uint32 sdlflags = SDL_OPENGL;
+    
     if (!cmdline("windowed"))
         sdlflags |= SDL_FULLSCREEN;