diff --git a/stella/src/ui/common/Snapshot.cxx b/stella/src/ui/common/Snapshot.cxx index 60ba09028..93f5e89c2 100644 --- a/stella/src/ui/common/Snapshot.cxx +++ b/stella/src/ui/common/Snapshot.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Snapshot.cxx,v 1.8 2003-11-19 15:57:10 stephena Exp $ +// $Id: Snapshot.cxx,v 1.9 2003-12-06 00:17:28 stephena Exp $ //============================================================================ #include @@ -88,7 +88,7 @@ uInt32 Snapshot::savePNG(string filename, uInt32 multiplier) uInt32 width = myMediaSource->width(); uInt32 height = myMediaSource->height(); - ofstream* out = new ofstream(filename.c_str()); + ofstream* out = new ofstream(filename.c_str(), ios_base::binary); if(!out) return 0; diff --git a/stella/src/ui/sdl/FrameBufferGL.cxx b/stella/src/ui/sdl/FrameBufferGL.cxx index 2dd18f5ea..fbcff6851 100644 --- a/stella/src/ui/sdl/FrameBufferGL.cxx +++ b/stella/src/ui/sdl/FrameBufferGL.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBufferGL.cxx,v 1.11 2003-12-03 18:11:25 stephena Exp $ +// $Id: FrameBufferGL.cxx,v 1.12 2003-12-06 00:17:29 stephena Exp $ //============================================================================ #include @@ -71,6 +71,17 @@ bool FrameBufferGL::createScreen() glPushMatrix(); glLoadIdentity(); +#ifdef TEXTURES_ARE_LOST + createTextures(); + + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_TEXTURE_2D); +#endif + theRedrawEntireFrameIndicator = true; return true; } @@ -194,8 +205,10 @@ bool FrameBufferGL::init() SDL_GL_GetAttribute( SDL_GL_BLUE_SIZE, (int*)&myRGB[2] ); SDL_GL_GetAttribute( SDL_GL_ALPHA_SIZE, (int*)&myRGB[3] ); +#ifndef TEXTURES_ARE_LOST // Create the texture surface and texture fonts createTextures(); +#endif // Set up the palette *after* we know the color components // and the textures @@ -349,6 +362,12 @@ void FrameBufferGL::drawChar(uInt32 x, uInt32 y, uInt32 c) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool FrameBufferGL::createTextures() { + if(myTexture) + SDL_FreeSurface(myTexture); + + glDeleteTextures(1, &myTextureID); + glDeleteTextures(256, myFontTextureID); + uInt32 w = power_of_two(myWidth); uInt32 h = power_of_two(myHeight); diff --git a/stella/src/ui/sdl/mainSDL.cxx b/stella/src/ui/sdl/mainSDL.cxx index 26e1bd0b5..96b020dce 100644 --- a/stella/src/ui/sdl/mainSDL.cxx +++ b/stella/src/ui/sdl/mainSDL.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: mainSDL.cxx,v 1.65 2003-12-05 19:51:09 stephena Exp $ +// $Id: mainSDL.cxx,v 1.66 2003-12-06 00:17:29 stephena Exp $ //============================================================================ #include @@ -342,7 +342,12 @@ void handleEvents() else if(key == SDLK_MINUS) theDisplay->resize(-1); else if(key == SDLK_RETURN) + { theDisplay->toggleFullscreen(); + // Pause when switching modes + if(!theConsole->eventHandler().doPause()) + theConsole->eventHandler().sendEvent(Event::Pause, 1); + } #ifdef DISPLAY_OPENGL else if(key == SDLK_f && theUseOpenGLFlag) ((FrameBufferGL*)theDisplay)->toggleFilter();