X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FOpenGL_Windows.cpp;h=b25b0cba26dbf01ef8f5fc8d1c546105ee4bbe61;hb=40573ae221c63f41612f1b68ea4399825235866f;hp=c74939ec77a30f3472b2e3c6e9aece7263eb7561;hpb=386dc30166871cd37cc4619c9c9b8bbd4ae3bcf8;p=lugaru.git diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index c74939e..b25b0cb 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -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::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;