From 0058d868a44bb19c85e3cb0b8eef4a536a67c6be Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 23 Nov 2003 20:54:59 +0000 Subject: [PATCH] Made the lines on the menu boxes look a little better in the SDL OpenGL port. Added a FrameBufferSDL::refresh() method that's triggered when the window needs to be redrawn (SDL_VIDEOEXPOSE event). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@217 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/ui/sdl/FrameBufferGL.cxx | 3 ++- stella/src/ui/sdl/FrameBufferSDL.hxx | 10 ++++++++-- stella/src/ui/sdl/mainSDL.cxx | 6 +++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/stella/src/ui/sdl/FrameBufferGL.cxx b/stella/src/ui/sdl/FrameBufferGL.cxx index 62a0472da..84e68e717 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.6 2003-11-22 20:13:11 stephena Exp $ +// $Id: FrameBufferGL.cxx,v 1.7 2003-11-23 20:54:59 stephena Exp $ //============================================================================ #include @@ -313,6 +313,7 @@ void FrameBufferGL::drawBoundedBox(uInt32 x, uInt32 y, uInt32 w, uInt32 h) glRecti(x, y, x+w, y+h); // Now draw the outer edges + glLineWidth(theZoomLevel/2); glColor4f(0.8, 0.8, 0.8, 1.0); glBegin(GL_LINE_LOOP); glVertex2i(x, y ); // Top Left diff --git a/stella/src/ui/sdl/FrameBufferSDL.hxx b/stella/src/ui/sdl/FrameBufferSDL.hxx index d375294ad..afd28d965 100644 --- a/stella/src/ui/sdl/FrameBufferSDL.hxx +++ b/stella/src/ui/sdl/FrameBufferSDL.hxx @@ -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: FrameBufferSDL.hxx,v 1.5 2003-11-17 17:43:39 stephena Exp $ +// $Id: FrameBufferSDL.hxx,v 1.6 2003-11-23 20:54:59 stephena Exp $ //============================================================================ #ifndef FRAMEBUFFER_SDL_HXX @@ -34,7 +34,7 @@ the core FrameBuffer. @author Stephen Anthony - @version $Id: FrameBufferSDL.hxx,v 1.5 2003-11-17 17:43:39 stephena Exp $ + @version $Id: FrameBufferSDL.hxx,v 1.6 2003-11-23 20:54:59 stephena Exp $ */ class FrameBufferSDL : public FrameBuffer { @@ -92,6 +92,12 @@ class FrameBufferSDL : public FrameBuffer */ uInt32 maxWindowSizeForScreen(); + /** + Indicates that a redraw should be done, since the window contents + are dirty. + */ + void refresh() { theRedrawEntireFrameIndicator = true; } + ////////////////////////////////////////////////////////////////////// // The following methods are derived from FrameBuffer.hxx ////////////////////////////////////////////////////////////////////// diff --git a/stella/src/ui/sdl/mainSDL.cxx b/stella/src/ui/sdl/mainSDL.cxx index f67963ad7..c99e5432b 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.60 2003-11-19 15:57:10 stephena Exp $ +// $Id: mainSDL.cxx,v 1.61 2003-11-23 20:54:59 stephena Exp $ //============================================================================ #include @@ -517,6 +517,10 @@ void handleEvents() { theConsole->eventHandler().sendEvent(Event::Quit, 1); } + else if(event.type == SDL_VIDEOEXPOSE) + { + theDisplay->refresh(); + } #ifdef HAVE_JOYSTICK // Read joystick events and modify event states