mirror of https://github.com/stella-emu/stella.git
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
This commit is contained in:
parent
f0212fe4de
commit
f599e1611d
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// 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
|
#ifdef DISPLAY_OPENGL
|
||||||
|
@ -72,7 +72,7 @@ static void (APIENTRY* p_glTexParameteri)( GLenum, GLenum, GLint );
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
FrameBufferGL::FrameBufferGL(OSystem* osystem)
|
FrameBufferGL::FrameBufferGL(OSystem* osystem)
|
||||||
: FrameBuffer(osystem),
|
: FrameBuffer(osystem),
|
||||||
myTiaSurface(NULL),
|
myBaseSurface(NULL),
|
||||||
myFilterParamName("GL_NEAREST"),
|
myFilterParamName("GL_NEAREST"),
|
||||||
myWidthScaleFactor(1.0),
|
myWidthScaleFactor(1.0),
|
||||||
myHeightScaleFactor(1.0),
|
myHeightScaleFactor(1.0),
|
||||||
|
@ -352,9 +352,9 @@ cerr << "dimensions: " << endl
|
||||||
<< " imageh = " << mode.image_h << endl
|
<< " imageh = " << mode.image_h << endl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
delete myTiaSurface;
|
delete myBaseSurface;
|
||||||
myTiaSurface = new FBSurfaceGL(*this, baseWidth, baseHeight,
|
myBaseSurface = new FBSurfaceGL(*this, baseWidth, baseHeight,
|
||||||
mode.image_w, mode.image_h);
|
mode.image_w, mode.image_h);
|
||||||
|
|
||||||
// Make sure any old parts of the screen are erased
|
// Make sure any old parts of the screen are erased
|
||||||
p_glClear(GL_COLOR_BUFFER_BIT);
|
p_glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
@ -374,8 +374,8 @@ void FrameBufferGL::drawMediaSource()
|
||||||
uInt8* previousFrame = mediasrc.previousFrameBuffer();
|
uInt8* previousFrame = mediasrc.previousFrameBuffer();
|
||||||
uInt32 width = mediasrc.width();
|
uInt32 width = mediasrc.width();
|
||||||
uInt32 height = mediasrc.height();
|
uInt32 height = mediasrc.height();
|
||||||
uInt32 pitch = myTiaSurface->pitch();
|
uInt32 pitch = myBaseSurface->pitch();
|
||||||
uInt16* buffer = (uInt16*) myTiaSurface->pixels();
|
uInt16* buffer = (uInt16*) myBaseSurface->pixels();
|
||||||
|
|
||||||
// TODO - is this fast enough?
|
// TODO - is this fast enough?
|
||||||
if(!myUsePhosphor)
|
if(!myUsePhosphor)
|
||||||
|
@ -434,8 +434,8 @@ void FrameBufferGL::drawMediaSource()
|
||||||
// And blit the surface
|
// And blit the surface
|
||||||
if(myDirtyFlag)
|
if(myDirtyFlag)
|
||||||
{
|
{
|
||||||
myTiaSurface->addDirtyRect(0, 0, 0, 0);
|
myBaseSurface->addDirtyRect(0, 0, 0, 0);
|
||||||
myTiaSurface->update();
|
myBaseSurface->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ void FrameBufferGL::enablePhosphor(bool enable, int blend)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Uint32 FrameBufferGL::mapRGB(Uint8 r, Uint8 g, Uint8 b) const
|
Uint32 FrameBufferGL::mapRGB(Uint8 r, Uint8 g, Uint8 b) const
|
||||||
{
|
{
|
||||||
return myTiaSurface->mapRGB(r, g, b);
|
return myBaseSurface->mapRGB(r, g, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// 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
|
#ifndef FRAMEBUFFER_GL_HXX
|
||||||
|
@ -35,7 +35,7 @@ class FBSurfaceGL;
|
||||||
This class implements an SDL OpenGL framebuffer.
|
This class implements an SDL OpenGL framebuffer.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@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
|
class FrameBufferGL : public FrameBuffer
|
||||||
{
|
{
|
||||||
|
@ -151,8 +151,8 @@ class FrameBufferGL : public FrameBuffer
|
||||||
bool loadFuncs();
|
bool loadFuncs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The TIA surface (wraps an SDL surface)
|
// The lower-most base surface (could be TIA or dialog-based)
|
||||||
FBSurfaceGL* myTiaSurface;
|
FBSurfaceGL* myBaseSurface;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Holds all items specifically needed by GL commands
|
// Holds all items specifically needed by GL commands
|
||||||
|
@ -201,7 +201,7 @@ class FrameBufferGL : public FrameBuffer
|
||||||
A surface suitable for OpenGL rendering mode.
|
A surface suitable for OpenGL rendering mode.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@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
|
class FBSurfaceGL : public FBSurface
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue