From b958c82bc1f5d728d3ad32d7d8096db20d7d1446 Mon Sep 17 00:00:00 2001 From: stephena Date: Fri, 17 Mar 2006 23:06:28 +0000 Subject: [PATCH] A few fixes for the recent framebuffer shuffle; this is what I get for messing with it. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1051 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/common/FrameBufferGL.cxx | 5 +++-- stella/src/common/FrameBufferSoft.cxx | 4 ++-- stella/src/unix/OSystemUNIX.cxx | 11 ++++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/stella/src/common/FrameBufferGL.cxx b/stella/src/common/FrameBufferGL.cxx index 91bab3a89..3c28dc28f 100644 --- a/stella/src/common/FrameBufferGL.cxx +++ b/stella/src/common/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.56 2006-03-16 16:10:47 stephena Exp $ +// $Id: FrameBufferGL.cxx,v 1.57 2006-03-17 23:06:28 stephena Exp $ //============================================================================ #ifdef DISPLAY_OPENGL @@ -305,7 +305,8 @@ bool FrameBufferGL::createScreen() SDL_GL_SwapBuffers(); p_glClear(GL_COLOR_BUFFER_BIT); - cls(); + // FIXME - figure out why this is causing a segfault + //myOSystem->eventHandler().refreshDisplay(); return true; } diff --git a/stella/src/common/FrameBufferSoft.cxx b/stella/src/common/FrameBufferSoft.cxx index 56dcb844d..adcd9551b 100644 --- a/stella/src/common/FrameBufferSoft.cxx +++ b/stella/src/common/FrameBufferSoft.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: FrameBufferSoft.cxx,v 1.48 2006-03-16 16:10:47 stephena Exp $ +// $Id: FrameBufferSoft.cxx,v 1.49 2006-03-17 23:06:28 stephena Exp $ //============================================================================ #include @@ -108,7 +108,7 @@ bool FrameBufferSoft::createScreen() break; } - cls(); + myOSystem->eventHandler().refreshDisplay(); return true; } diff --git a/stella/src/unix/OSystemUNIX.cxx b/stella/src/unix/OSystemUNIX.cxx index 3706c7339..83b580c03 100644 --- a/stella/src/unix/OSystemUNIX.cxx +++ b/stella/src/unix/OSystemUNIX.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: OSystemUNIX.cxx,v 1.17 2006-03-17 19:44:19 stephena Exp $ +// $Id: OSystemUNIX.cxx,v 1.18 2006-03-17 23:06:28 stephena Exp $ //============================================================================ #include @@ -174,6 +174,12 @@ uInt32 OSystemUNIX::getTicks() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void OSystemUNIX::getScreenDimensions(int& width, int& height) { + // We might need to temporarily enable VIDEO support to check + // screen dimensions + bool isAlreadyInitialized = (SDL_WasInit(SDL_INIT_VIDEO) & SDL_INIT_VIDEO) > 0; + if(!isAlreadyInitialized) + SDL_Init(SDL_INIT_VIDEO); + SDL_SysWMinfo myWMInfo; SDL_VERSION(&myWMInfo.version); if(SDL_GetWMInfo(&myWMInfo) > 0 && myWMInfo.subsystem == SDL_SYSWM_X11) @@ -185,4 +191,7 @@ void OSystemUNIX::getScreenDimensions(int& width, int& height) DefaultScreen(myWMInfo.info.x11.display)); myWMInfo.info.x11.unlock_func(); } + + if(!isAlreadyInitialized) + SDL_QuitSubSystem(SDL_INIT_VIDEO); }