From f599e1611d819dbaff075299e54365bee9bea1b8 Mon Sep 17 00:00:00 2001 From: stephena Date: Wed, 10 Dec 2008 18:11:21 +0000 Subject: [PATCH] A little renaming in the GL class. I now know why we're getting white textures in OSX. It seems the textures have to be completely reloaded after the window changes size, even if it's still large enough to hold the previous textures. I assume the GL context is being reset each time SDL_SetVideoMode is called (although this doesn't happen in Linux or Win32). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1559 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/common/FrameBufferGL.cxx | 20 ++++++++++---------- stella/src/common/FrameBufferGL.hxx | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/stella/src/common/FrameBufferGL.cxx b/stella/src/common/FrameBufferGL.cxx index 674050c21..1ac0af4e3 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.111 2008-12-10 17:11:34 stephena Exp $ +// $Id: FrameBufferGL.cxx,v 1.112 2008-12-10 18:11:21 stephena Exp $ //============================================================================ #ifdef DISPLAY_OPENGL @@ -72,7 +72,7 @@ static void (APIENTRY* p_glTexParameteri)( GLenum, GLenum, GLint ); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FrameBufferGL::FrameBufferGL(OSystem* osystem) : FrameBuffer(osystem), - myTiaSurface(NULL), + myBaseSurface(NULL), myFilterParamName("GL_NEAREST"), myWidthScaleFactor(1.0), myHeightScaleFactor(1.0), @@ -352,9 +352,9 @@ cerr << "dimensions: " << endl << " imageh = " << mode.image_h << endl << endl; - delete myTiaSurface; - myTiaSurface = new FBSurfaceGL(*this, baseWidth, baseHeight, - mode.image_w, mode.image_h); + delete myBaseSurface; + myBaseSurface = new FBSurfaceGL(*this, baseWidth, baseHeight, + mode.image_w, mode.image_h); // Make sure any old parts of the screen are erased p_glClear(GL_COLOR_BUFFER_BIT); @@ -374,8 +374,8 @@ void FrameBufferGL::drawMediaSource() uInt8* previousFrame = mediasrc.previousFrameBuffer(); uInt32 width = mediasrc.width(); uInt32 height = mediasrc.height(); - uInt32 pitch = myTiaSurface->pitch(); - uInt16* buffer = (uInt16*) myTiaSurface->pixels(); + uInt32 pitch = myBaseSurface->pitch(); + uInt16* buffer = (uInt16*) myBaseSurface->pixels(); // TODO - is this fast enough? if(!myUsePhosphor) @@ -434,8 +434,8 @@ void FrameBufferGL::drawMediaSource() // And blit the surface if(myDirtyFlag) { - myTiaSurface->addDirtyRect(0, 0, 0, 0); - myTiaSurface->update(); + myBaseSurface->addDirtyRect(0, 0, 0, 0); + myBaseSurface->update(); } } @@ -465,7 +465,7 @@ void FrameBufferGL::enablePhosphor(bool enable, int blend) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Uint32 FrameBufferGL::mapRGB(Uint8 r, Uint8 g, Uint8 b) const { - return myTiaSurface->mapRGB(r, g, b); + return myBaseSurface->mapRGB(r, g, b); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/common/FrameBufferGL.hxx b/stella/src/common/FrameBufferGL.hxx index 2337ec126..1394829e1 100644 --- a/stella/src/common/FrameBufferGL.hxx +++ b/stella/src/common/FrameBufferGL.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: FrameBufferGL.hxx,v 1.59 2008-12-08 18:56:53 stephena Exp $ +// $Id: FrameBufferGL.hxx,v 1.60 2008-12-10 18:11:21 stephena Exp $ //============================================================================ #ifndef FRAMEBUFFER_GL_HXX @@ -35,7 +35,7 @@ class FBSurfaceGL; This class implements an SDL OpenGL framebuffer. @author Stephen Anthony - @version $Id: FrameBufferGL.hxx,v 1.59 2008-12-08 18:56:53 stephena Exp $ + @version $Id: FrameBufferGL.hxx,v 1.60 2008-12-10 18:11:21 stephena Exp $ */ class FrameBufferGL : public FrameBuffer { @@ -151,8 +151,8 @@ class FrameBufferGL : public FrameBuffer bool loadFuncs(); private: - // The TIA surface (wraps an SDL surface) - FBSurfaceGL* myTiaSurface; + // The lower-most base surface (could be TIA or dialog-based) + FBSurfaceGL* myBaseSurface; /* // Holds all items specifically needed by GL commands @@ -201,7 +201,7 @@ class FrameBufferGL : public FrameBuffer A surface suitable for OpenGL rendering mode. @author Stephen Anthony - @version $Id: FrameBufferGL.hxx,v 1.59 2008-12-08 18:56:53 stephena Exp $ + @version $Id: FrameBufferGL.hxx,v 1.60 2008-12-10 18:11:21 stephena Exp $ */ class FBSurfaceGL : public FBSurface {