mirror of https://github.com/stella-emu/stella.git
Added Vertex Buffer Object (VBO) functionality to the OpenGL renderer.
Updated OSX project files for recent OpenGL changes. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2270 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
9dfcd9a468
commit
b25eccdf48
|
@ -65,6 +65,10 @@ OGL_DECLARE(void,glTexImage2D,(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GL
|
|||
OGL_DECLARE(void,glTexSubImage2D,(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*));
|
||||
OGL_DECLARE(void,glTexParameteri,(GLenum, GLenum, GLint));
|
||||
OGL_DECLARE(GLenum,glGetError,(void));
|
||||
OGL_DECLARE(void,glGenBuffers,(GLsizei,GLuint*));
|
||||
OGL_DECLARE(void,glBindBuffer,(GLenum,GLuint));
|
||||
OGL_DECLARE(void,glBufferData,(GLenum,GLsizei,const void*,GLenum));
|
||||
OGL_DECLARE(void,glDeleteBuffers,(GLsizei, const GLuint*));
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
FrameBufferGL::FrameBufferGL(OSystem* osystem)
|
||||
|
@ -118,7 +122,7 @@ bool FrameBufferGL::loadFuncs(GLFunctionality functionality)
|
|||
// If anything fails, we'll know it immediately, and return false
|
||||
switch(functionality)
|
||||
{
|
||||
case kGL_FULL:
|
||||
case kGL_BASIC:
|
||||
OGL_INIT(void,glClear,(GLbitfield));
|
||||
OGL_INIT(void,glEnable,(GLenum));
|
||||
OGL_INIT(void,glDisable,(GLenum));
|
||||
|
@ -150,11 +154,18 @@ bool FrameBufferGL::loadFuncs(GLFunctionality functionality)
|
|||
OGL_INIT(void,glTexImage2D,(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*));
|
||||
OGL_INIT(void,glTexSubImage2D,(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*));
|
||||
OGL_INIT(void,glTexParameteri,(GLenum, GLenum, GLint));
|
||||
break; // kGLFull
|
||||
break; // kGL_Full
|
||||
|
||||
case kGL_ES:
|
||||
// TODO - merge with full so there's only one implementation
|
||||
break; // kGLES
|
||||
case kGL_VBO:
|
||||
OGL_INIT(void,glGenBuffers,(GLsizei,GLuint*));
|
||||
OGL_INIT(void,glBindBuffer,(GLenum,GLuint));
|
||||
OGL_INIT(void,glBufferData,(GLenum,GLsizei,const void*,GLenum));
|
||||
OGL_INIT(void,glDeleteBuffers,(GLsizei, const GLuint*));
|
||||
break; // kGL_VBO
|
||||
|
||||
case kGL_FBO:
|
||||
return false; // TODO - implement this
|
||||
break; // kGL_FBO
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -208,7 +219,11 @@ string FrameBufferGL::about() const
|
|||
<< " Version: " << p_glGetString(GL_VERSION) << endl
|
||||
<< " Color: " << myDepth << " bit, " << myRGB[0] << "-"
|
||||
<< myRGB[1] << "-" << myRGB[2] << "-" << myRGB[3] << endl
|
||||
<< " Filter: " << myFilterParamName << endl;
|
||||
<< " Filter: " << myFilterParamName << endl
|
||||
<< " Extensions: ";
|
||||
if(myVBOAvailable) out << "VBO ";
|
||||
if(myFBOAvailable) out << "FBO ";
|
||||
out << endl;
|
||||
return out.str();
|
||||
}
|
||||
|
||||
|
@ -284,12 +299,14 @@ bool FrameBufferGL::setVidMode(VideoMode& mode)
|
|||
mySDLFlags = myScreen->flags;
|
||||
|
||||
// Load OpenGL function pointers
|
||||
myFBOAvailable = myPBOAvailable = false;
|
||||
if(loadFuncs(kGL_FULL))
|
||||
if(loadFuncs(kGL_BASIC))
|
||||
{
|
||||
// Grab OpenGL version number
|
||||
string version((const char *)p_glGetString(GL_VERSION));
|
||||
myGLVersion = atof(version.substr(0, 3).c_str());
|
||||
|
||||
myVBOAvailable = myOSystem->settings().getBool("gl_vbo") && loadFuncs(kGL_VBO);
|
||||
myFBOAvailable = false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
@ -334,15 +351,21 @@ cerr << "dimensions: " << (fullScreen() ? "(full)" : "") << endl
|
|||
// In this way, all free()'s come before all reload()'s
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
// The framebuffer only takes responsibility for TIA surfaces
|
||||
// Other surfaces (such as the ones used for dialogs) are allocated
|
||||
// in the Dialog class
|
||||
delete myTiaSurface; myTiaSurface = NULL;
|
||||
// We try to re-use the TIA surface whenever possible
|
||||
if(!inUIMode && !(myTiaSurface &&
|
||||
myTiaSurface->getWidth() == mode.image_w &&
|
||||
myTiaSurface->getHeight() == mode.image_h))
|
||||
{
|
||||
delete myTiaSurface; myTiaSurface = NULL;
|
||||
}
|
||||
|
||||
// Any previously allocated textures currently in use by various UI items
|
||||
// need to be refreshed as well (only seems to be required for OSX)
|
||||
resetSurfaces();
|
||||
resetSurfaces(myTiaSurface);
|
||||
|
||||
// The framebuffer only takes responsibility for TIA surfaces
|
||||
// Other surfaces (such as the ones used for dialogs) are allocated
|
||||
// in the Dialog class
|
||||
if(!inUIMode)
|
||||
{
|
||||
// The actual TIA image is only half of that specified by baseWidth
|
||||
|
@ -353,8 +376,10 @@ cerr << "dimensions: " << (fullScreen() ? "(full)" : "") << endl
|
|||
//
|
||||
// Also note that TV filtering is always available since we'll always
|
||||
// have access to Blargg filtering
|
||||
myTiaSurface = new FBSurfaceGL(*this, baseWidth>>1, baseHeight,
|
||||
if(!myTiaSurface)
|
||||
myTiaSurface = new FBSurfaceGL(*this, baseWidth>>1, baseHeight,
|
||||
mode.image_w, mode.image_h, true);
|
||||
|
||||
myTiaSurface->setPos(mode.image_x, mode.image_y);
|
||||
myTiaSurface->setFilter(myOSystem->settings().getString("gl_filter"));
|
||||
}
|
||||
|
@ -444,7 +469,7 @@ void FrameBufferGL::postFrameUpdate()
|
|||
{
|
||||
if(myDirtyFlag)
|
||||
{
|
||||
// Now show all changes made to the texture
|
||||
// Now show all changes made to the texture(s)
|
||||
SDL_GL_SwapBuffers();
|
||||
myDirtyFlag = false;
|
||||
}
|
||||
|
@ -494,6 +519,7 @@ FBSurfaceGL::FBSurfaceGL(FrameBufferGL& buffer,
|
|||
: myFB(buffer),
|
||||
myTexture(NULL),
|
||||
myTexID(0),
|
||||
myVBOID(0),
|
||||
myXOrig(0),
|
||||
myYOrig(0),
|
||||
myWidth(scaleWidth),
|
||||
|
@ -512,9 +538,8 @@ FBSurfaceGL::FBSurfaceGL(FrameBufferGL& buffer,
|
|||
0x0000f800, 0x000007c0, 0x0000003e, 0x00000000);
|
||||
myPitch = myTexture->pitch >> 1;
|
||||
|
||||
updateCoords();
|
||||
|
||||
// Associate the SDL surface with a GL texture object
|
||||
updateCoords();
|
||||
reload();
|
||||
}
|
||||
|
||||
|
@ -668,10 +693,12 @@ void FBSurfaceGL::getPos(uInt32& x, uInt32& y) const
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurfaceGL::setPos(uInt32 x, uInt32 y)
|
||||
{
|
||||
myXOrig = x;
|
||||
myYOrig = y;
|
||||
|
||||
updateCoords();
|
||||
if(myXOrig != x || myYOrig != y)
|
||||
{
|
||||
myXOrig = x;
|
||||
myYOrig = y;
|
||||
updateCoords();
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -680,10 +707,12 @@ void FBSurfaceGL::setWidth(uInt32 w)
|
|||
// This method can't be used with 'scaled' surface (aka TIA surfaces)
|
||||
// That shouldn't really matter, though, as all the UI stuff isn't scaled,
|
||||
// and it's the only thing that uses it
|
||||
myWidth = w;
|
||||
myTexCoordW = (GLfloat) myWidth / myTexWidth;
|
||||
|
||||
updateCoords();
|
||||
if(myWidth != w)
|
||||
{
|
||||
myWidth = w;
|
||||
myTexCoordW = (GLfloat) myWidth / myTexWidth;
|
||||
updateCoords();
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -692,10 +721,12 @@ void FBSurfaceGL::setHeight(uInt32 h)
|
|||
// This method can't be used with 'scaled' surface (aka TIA surfaces)
|
||||
// That shouldn't really matter, though, as all the UI stuff isn't scaled,
|
||||
// and it's the only thing that uses it
|
||||
myHeight = h;
|
||||
myTexCoordH = (GLfloat) myHeight / myTexHeight;
|
||||
|
||||
updateCoords();
|
||||
if(myHeight != h)
|
||||
{
|
||||
myHeight = h;
|
||||
myTexCoordH = (GLfloat) myHeight / myTexHeight;
|
||||
updateCoords();
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -719,8 +750,17 @@ void FBSurfaceGL::update()
|
|||
|
||||
p_glEnableClientState(GL_VERTEX_ARRAY);
|
||||
p_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
p_glVertexPointer(2, GL_SHORT, 0, myVertCoord);
|
||||
p_glTexCoordPointer(2, GL_FLOAT, 0, myTexCoord);
|
||||
if(myFB.myVBOAvailable)
|
||||
{
|
||||
p_glBindBuffer(GL_ARRAY_BUFFER, myVBOID);
|
||||
p_glVertexPointer(2, GL_FLOAT, 0, (const GLvoid*)0);
|
||||
p_glTexCoordPointer(2, GL_FLOAT, 0, (const GLvoid*)(8*sizeof(GLfloat)));
|
||||
}
|
||||
else
|
||||
{
|
||||
p_glVertexPointer(2, GL_FLOAT, 0, myCoord);
|
||||
p_glTexCoordPointer(2, GL_FLOAT, 0, myCoord+8);
|
||||
}
|
||||
p_glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
p_glDisableClientState(GL_VERTEX_ARRAY);
|
||||
p_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
@ -736,6 +776,8 @@ void FBSurfaceGL::update()
|
|||
void FBSurfaceGL::free()
|
||||
{
|
||||
p_glDeleteTextures(1, &myTexID);
|
||||
if(myFB.myVBOAvailable)
|
||||
p_glDeleteBuffers(1, &myVBOID);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -764,6 +806,14 @@ void FBSurfaceGL::reload()
|
|||
p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
|
||||
myTexWidth, myTexHeight, 0,
|
||||
GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, myTexture->pixels);
|
||||
|
||||
// Cache vertex and texture coordinates using vertex buffer object
|
||||
if(myFB.myVBOAvailable)
|
||||
{
|
||||
p_glGenBuffers(1, &myVBOID);
|
||||
p_glBindBuffer(GL_ARRAY_BUFFER, myVBOID);
|
||||
p_glBufferData(GL_ARRAY_BUFFER, 16*sizeof(GLfloat), myCoord, GL_STATIC_DRAW);
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -789,34 +839,38 @@ void FBSurfaceGL::updateCoords()
|
|||
{
|
||||
// Vertex coordinates
|
||||
// Upper left (x,y)
|
||||
myVertCoord[0] = myXOrig;
|
||||
myVertCoord[1] = myYOrig;
|
||||
myCoord[0] = myXOrig;
|
||||
myCoord[1] = myYOrig;
|
||||
// Upper right (x+w,y)
|
||||
myVertCoord[2] = myXOrig + myWidth;
|
||||
myVertCoord[3] = myYOrig;
|
||||
myCoord[2] = myXOrig + myWidth;
|
||||
myCoord[3] = myYOrig;
|
||||
// Lower left (x,y+h)
|
||||
myVertCoord[4] = myXOrig;
|
||||
myVertCoord[5] = myYOrig + myHeight;
|
||||
myCoord[4] = myXOrig;
|
||||
myCoord[5] = myYOrig + myHeight;
|
||||
// Lower right (x+w,y+h)
|
||||
myVertCoord[6] = myXOrig + myWidth;
|
||||
myVertCoord[7] = myYOrig + myHeight;
|
||||
myCoord[6] = myXOrig + myWidth;
|
||||
myCoord[7] = myYOrig + myHeight;
|
||||
|
||||
// Texture coordinates
|
||||
// Upper left (x,y)
|
||||
myTexCoord[0] = 0.0f;
|
||||
myTexCoord[1] = 0.0f;
|
||||
myCoord[8] = 0.0f;
|
||||
myCoord[9] = 0.0f;
|
||||
// Upper right (x+w,y)
|
||||
myTexCoord[2] = myTexCoordW;
|
||||
myTexCoord[3] = 0.0f;
|
||||
myCoord[10] = myTexCoordW;
|
||||
myCoord[11] = 0.0f;
|
||||
// Lower left (x,y+h)
|
||||
myTexCoord[4] = 0.0f;
|
||||
myTexCoord[5] = myTexCoordH;
|
||||
myCoord[12] = 0.0f;
|
||||
myCoord[13] = myTexCoordH;
|
||||
// Lower right (x+w,y+h)
|
||||
myTexCoord[6] = myTexCoordW;
|
||||
myTexCoord[7] = myTexCoordH;
|
||||
myCoord[14] = myTexCoordW;
|
||||
myCoord[15] = myTexCoordH;
|
||||
|
||||
// TODO - perhaps use VBO to store these, since they're static most
|
||||
// of the time
|
||||
// Cache vertex and texture coordinates using vertex buffer object
|
||||
if(myFB.myVBOAvailable)
|
||||
{
|
||||
p_glBindBuffer(GL_ARRAY_BUFFER, myVBOID);
|
||||
p_glBufferData(GL_ARRAY_BUFFER, 16*sizeof(GLfloat), myCoord, GL_STATIC_DRAW);
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -826,9 +880,9 @@ bool FrameBufferGL::myLibraryLoaded = false;
|
|||
float FrameBufferGL::myGLVersion = 0.0;
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool FrameBufferGL::myFBOAvailable = false;
|
||||
bool FrameBufferGL::myVBOAvailable = false;
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool FrameBufferGL::myPBOAvailable = false;
|
||||
bool FrameBufferGL::myFBOAvailable = false;
|
||||
|
||||
#endif // DISPLAY_OPENGL
|
||||
|
|
|
@ -176,7 +176,7 @@ class FrameBufferGL : public FrameBuffer
|
|||
|
||||
private:
|
||||
enum GLFunctionality {
|
||||
kGL_FULL, kGL_ES
|
||||
kGL_BASIC, kGL_VBO, kGL_FBO
|
||||
};
|
||||
bool loadFuncs(GLFunctionality functionality);
|
||||
|
||||
|
@ -214,8 +214,8 @@ class FrameBufferGL : public FrameBuffer
|
|||
// Indicates the OpenGL version found (0 indicates none)
|
||||
static float myGLVersion;
|
||||
|
||||
// Indicates whether Frame/Pixel Buffer Object functions were properly loaded
|
||||
static bool myFBOAvailable, myPBOAvailable;
|
||||
// Indicates whether Vertex/Frame Buffer Object functions were properly loaded
|
||||
static bool myVBOAvailable, myFBOAvailable;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -273,13 +273,12 @@ class FBSurfaceGL : public FBSurface
|
|||
FrameBufferGL& myFB;
|
||||
SDL_Surface* myTexture;
|
||||
|
||||
GLuint myTexID;
|
||||
GLuint myTexID, myVBOID;
|
||||
GLsizei myTexWidth;
|
||||
GLsizei myTexHeight;
|
||||
GLshort myVertCoord[8];
|
||||
GLshort myXOrig, myYOrig, myWidth, myHeight;
|
||||
GLfloat myTexCoord[8];
|
||||
GLuint myXOrig, myYOrig, myWidth, myHeight;
|
||||
GLfloat myTexCoordW, myTexCoordH;
|
||||
GLfloat myCoord[16];
|
||||
|
||||
bool mySurfaceIsDirty;
|
||||
uInt32 myPitch;
|
||||
|
|
|
@ -1,152 +0,0 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2011 by Bradford W. Mott, Stephen Anthony
|
||||
// and the Stella Team
|
||||
//
|
||||
// See the file "License.txt" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id$
|
||||
//============================================================================
|
||||
|
||||
#ifndef GL_SHADER_PROGS_HXX
|
||||
#define GL_SHADER_PROGS_HXX
|
||||
|
||||
/**
|
||||
This code is generated using the 'create_shaders.pl' script,
|
||||
located in the src/tools directory.
|
||||
*/
|
||||
|
||||
namespace GLShader {
|
||||
|
||||
static const char* bleed_frag[] = {
|
||||
"uniform sampler2D tex;\n"
|
||||
"uniform float pH;\n"
|
||||
"uniform float pW;\n"
|
||||
"uniform float pWx2;\n"
|
||||
"\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" // Save current color\n"
|
||||
" vec4 current = texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t));\n"
|
||||
"\n"
|
||||
" // Box filter\n"
|
||||
" // Comments for position are given in (x,y) coordinates with the current pixel as the origin\n"
|
||||
" vec4 color = ( \n"
|
||||
" // (-1,1)\n"
|
||||
" texture2D(tex, vec2(gl_TexCoord[0].s-pW, gl_TexCoord[0].t+pH))\n"
|
||||
" // (0,1)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t+pH))\n"
|
||||
" // (1,1)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s+pW, gl_TexCoord[0].t+pH))\n"
|
||||
" // (-1,0)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s-pW, gl_TexCoord[0].t))\n"
|
||||
" // (0,0)\n"
|
||||
" + current\n"
|
||||
" // (1,0)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s+pW, gl_TexCoord[0].t))\n"
|
||||
" // (-1,-1)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s-pW, gl_TexCoord[0].t-pH))\n"
|
||||
" // (0,-1)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t-pH))\n"
|
||||
" // (1,-1)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s+pW, gl_TexCoord[0].t-pH))\n"
|
||||
"\n"
|
||||
" // Make it wider\n"
|
||||
" // (-2,1)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s-pWx2, gl_TexCoord[0].t+pH))\n"
|
||||
" // (-2,0)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s-pWx2, gl_TexCoord[0].t))\n"
|
||||
" // (-2,-1)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s-pWx2, gl_TexCoord[0].t-pH))\n"
|
||||
" // (2,1)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s+pWx2, gl_TexCoord[0].t+pH))\n"
|
||||
" // (2,0)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s+pWx2, gl_TexCoord[0].t))\n"
|
||||
" // (2,-1)\n"
|
||||
" + texture2D(tex, vec2(gl_TexCoord[0].s+pWx2, gl_TexCoord[0].t-pH))\n"
|
||||
" ) / 15.0;\n"
|
||||
"\n"
|
||||
" // Make darker colors not bleed over lighter colors (act like light)\n"
|
||||
" color = vec4(max(current.x, color.x), max(current.y, color.y), max(current.z, color.z), 1.0);\n"
|
||||
"\n"
|
||||
" gl_FragColor = color;\n"
|
||||
"}\n"
|
||||
"\0"
|
||||
};
|
||||
|
||||
static const char* noise_frag[] = {
|
||||
"uniform sampler2D tex;\n"
|
||||
"uniform sampler2D mask;\n"
|
||||
"\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_FragColor =\n"
|
||||
" texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t))\n"
|
||||
" + texture2D(mask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
|
||||
" ;\n"
|
||||
"}\n"
|
||||
"\0"
|
||||
};
|
||||
|
||||
static const char* phosphor_frag[] = {
|
||||
"uniform sampler2D tex;\n"
|
||||
"uniform sampler2D mask;\n"
|
||||
"\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_FragColor =\n"
|
||||
" 0.65 * texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t))\n"
|
||||
" + 0.35 * texture2D(mask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
|
||||
" ;\n"
|
||||
"}\n"
|
||||
"\0"
|
||||
};
|
||||
|
||||
static const char* texture_frag[] = {
|
||||
"uniform sampler2D tex;\n"
|
||||
"uniform sampler2D mask;\n"
|
||||
"\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_FragColor =\n"
|
||||
" texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t))\n"
|
||||
" * texture2D(mask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
|
||||
" * 1.05\n"
|
||||
" + 0.07\n"
|
||||
" ;\n"
|
||||
"}\n"
|
||||
"\0"
|
||||
};
|
||||
|
||||
static const char* texture_noise_frag[] = {
|
||||
"uniform sampler2D tex;\n"
|
||||
"uniform sampler2D texMask;\n"
|
||||
"uniform sampler2D noiseMask;\n"
|
||||
"\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_FragColor =\n"
|
||||
" // Texture part\n"
|
||||
" texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t))\n"
|
||||
" * texture2D(texMask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
|
||||
" * 1.05\n"
|
||||
" + 0.07\n"
|
||||
" // Noise part\n"
|
||||
" + texture2D(noiseMask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
|
||||
" ;\n"
|
||||
"}\n"
|
||||
"\0"
|
||||
};
|
||||
|
||||
} // namespace GLShader
|
||||
|
||||
#endif
|
|
@ -539,7 +539,7 @@ FBSurface* FrameBuffer::surface(int id) const
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FrameBuffer::resetSurfaces()
|
||||
void FrameBuffer::resetSurfaces(FBSurface* tiasurface)
|
||||
{
|
||||
// Free all resources for each surface, then reload them
|
||||
// Due to possible timing and/or synchronization issues, all free()'s
|
||||
|
@ -550,8 +550,12 @@ void FrameBuffer::resetSurfaces()
|
|||
map<int,FBSurface*>::iterator iter;
|
||||
for(iter = mySurfaceList.begin(); iter != mySurfaceList.end(); ++iter)
|
||||
iter->second->free();
|
||||
if(tiasurface)
|
||||
tiasurface->free();
|
||||
for(iter = mySurfaceList.begin(); iter != mySurfaceList.end(); ++iter)
|
||||
iter->second->reload();
|
||||
if(tiasurface)
|
||||
tiasurface->reload();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -430,7 +430,7 @@ class FrameBuffer
|
|||
Issues a 'free' and 'reload' instruction to all surfaces that the
|
||||
framebuffer knows about.
|
||||
*/
|
||||
void resetSurfaces();
|
||||
void resetSurfaces(FBSurface* tiasurface = (FBSurface*)0);
|
||||
|
||||
protected:
|
||||
// The parent system for the framebuffer
|
||||
|
|
|
@ -203,9 +203,12 @@ bool OSystem::create()
|
|||
// Get updated paths for all configuration files
|
||||
setConfigPaths();
|
||||
ostringstream buf;
|
||||
buf << "Base directory: '" << myBaseDir << "'" << endl
|
||||
<< "Configuration file: '" << myConfigFile << "'" << endl
|
||||
<< "User game properties: '" << myPropertiesFile << "'" << endl
|
||||
buf << "Base directory: '"
|
||||
<< FilesystemNode(myBaseDir).getPath(false) << "'" << endl
|
||||
<< "Configuration file: '"
|
||||
<< FilesystemNode(myConfigFile).getPath(false) << "'" << endl
|
||||
<< "User game properties: '"
|
||||
<< FilesystemNode(myPropertiesFile).getPath(false) << "'" << endl
|
||||
<< endl;
|
||||
logMessage(buf.str(), 1);
|
||||
|
||||
|
@ -538,7 +541,7 @@ bool OSystem::createConsole(const string& romfile, const string& md5sum)
|
|||
myFrameBuffer->showMessage("Multicart " + type + ", loading ROM" + id);
|
||||
}
|
||||
buf << "Game console created:" << endl
|
||||
<< " ROM file: " << myRomFile << endl << endl
|
||||
<< " ROM file: " << FilesystemNode(myRomFile).getPath(false) << endl << endl
|
||||
<< getROMInfo(myConsole) << endl;
|
||||
logMessage(buf.str(), 1);
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ Settings::Settings(OSystem* osystem)
|
|||
setInternal("gl_fsmax", "false");
|
||||
setInternal("gl_lib", "libGL.so");
|
||||
setInternal("gl_vsync", "false");
|
||||
setInternal("gl_vbo", "true");
|
||||
|
||||
// Framebuffer-related options
|
||||
setInternal("tia_filter", "zoom2x");
|
||||
|
@ -351,7 +352,8 @@ void Settings::usage()
|
|||
<< " -gl_aspectn <number> Scale the TIA width by the given percentage in NTSC mode\n"
|
||||
<< " -gl_aspectp <number> Scale the TIA width by the given percentage in PAL mode\n"
|
||||
<< " -gl_fsmax <1|0> Stretch GL image in fullscreen emulation mode\n"
|
||||
<< " -gl_vsync <1|0> Enable synchronize to vertical blank interrupt\n"
|
||||
<< " -gl_vsync <1|0> Enable 'synchronize to vertical blank interrupt'\n"
|
||||
<< " -gl_vbo <1|0> Enable 'vertex buffer objects'\n"
|
||||
#if 0
|
||||
<< " -gl_accel <1|0> Enable SDL_GL_ACCELERATED_VISUAL\n"
|
||||
<< " -tv_tex <off|type> OpenGL TV texturing, type is one of the following:\n"
|
||||
|
|
|
@ -302,6 +302,8 @@
|
|||
DC5D2C610F129B1E004D1660 /* LauncherFilterDialog.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC5D2C5F0F129B1E004D1660 /* LauncherFilterDialog.hxx */; };
|
||||
DC64EB201152F9C000DC9140 /* CartDPCPlus.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC64EB1E1152F9C000DC9140 /* CartDPCPlus.cxx */; };
|
||||
DC64EB211152F9C000DC9140 /* CartDPCPlus.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC64EB1F1152F9C000DC9140 /* CartDPCPlus.hxx */; };
|
||||
DC7A769A13FEA40300ED8633 /* LoggerDialog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC7A769813FEA40300ED8633 /* LoggerDialog.cxx */; };
|
||||
DC7A769B13FEA40300ED8633 /* LoggerDialog.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC7A769913FEA40300ED8633 /* LoggerDialog.hxx */; };
|
||||
DC8078DB0B4BD5F3005E9305 /* DebuggerExpressions.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC8078DA0B4BD5F3005E9305 /* DebuggerExpressions.hxx */; };
|
||||
DC8078E80B4BD697005E9305 /* FileSnapDialog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC8078E40B4BD697005E9305 /* FileSnapDialog.cxx */; };
|
||||
DC8078E90B4BD697005E9305 /* FileSnapDialog.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC8078E50B4BD697005E9305 /* FileSnapDialog.hxx */; };
|
||||
|
@ -322,7 +324,6 @@
|
|||
DCA23AEA0D75B22500F77B33 /* CartX07.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCA23AE80D75B22500F77B33 /* CartX07.hxx */; };
|
||||
DCB5CEE711F5B78C00C68D09 /* MessageBox.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCB5CEE511F5B78C00C68D09 /* MessageBox.cxx */; };
|
||||
DCB5CEE811F5B78C00C68D09 /* MessageBox.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCB5CEE611F5B78C00C68D09 /* MessageBox.hxx */; };
|
||||
DCB9DA5F0FCD527000B192F6 /* GLShaderProgs.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCB9DA5E0FCD527000B192F6 /* GLShaderProgs.hxx */; };
|
||||
DCBD96891210314C0087CEFD /* ComboDialog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCBD96871210314C0087CEFD /* ComboDialog.cxx */; };
|
||||
DCBD968A1210314C0087CEFD /* ComboDialog.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCBD96881210314C0087CEFD /* ComboDialog.hxx */; };
|
||||
DCD56D380B247D920092F9F8 /* Cart4A50.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCD56D360B247D920092F9F8 /* Cart4A50.cxx */; };
|
||||
|
@ -710,6 +711,8 @@
|
|||
DC5D2C5F0F129B1E004D1660 /* LauncherFilterDialog.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = LauncherFilterDialog.hxx; path = ../gui/LauncherFilterDialog.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DC64EB1E1152F9C000DC9140 /* CartDPCPlus.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CartDPCPlus.cxx; path = ../emucore/CartDPCPlus.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DC64EB1F1152F9C000DC9140 /* CartDPCPlus.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CartDPCPlus.hxx; path = ../emucore/CartDPCPlus.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DC7A769813FEA40300ED8633 /* LoggerDialog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoggerDialog.cxx; path = ../gui/LoggerDialog.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DC7A769913FEA40300ED8633 /* LoggerDialog.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = LoggerDialog.hxx; path = ../gui/LoggerDialog.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DC8078DA0B4BD5F3005E9305 /* DebuggerExpressions.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = DebuggerExpressions.hxx; path = ../debugger/DebuggerExpressions.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DC8078E40B4BD697005E9305 /* FileSnapDialog.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FileSnapDialog.cxx; path = ../gui/FileSnapDialog.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DC8078E50B4BD697005E9305 /* FileSnapDialog.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = FileSnapDialog.hxx; path = ../gui/FileSnapDialog.hxx; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -730,7 +733,6 @@
|
|||
DCA23AE80D75B22500F77B33 /* CartX07.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = CartX07.hxx; path = ../emucore/CartX07.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCB5CEE511F5B78C00C68D09 /* MessageBox.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MessageBox.cxx; path = ../gui/MessageBox.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCB5CEE611F5B78C00C68D09 /* MessageBox.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = MessageBox.hxx; path = ../gui/MessageBox.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCB9DA5E0FCD527000B192F6 /* GLShaderProgs.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GLShaderProgs.hxx; path = ../common/GLShaderProgs.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCBD96871210314C0087CEFD /* ComboDialog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ComboDialog.cxx; path = ../gui/ComboDialog.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCBD96881210314C0087CEFD /* ComboDialog.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ComboDialog.hxx; path = ../gui/ComboDialog.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCD56D360B247D920092F9F8 /* Cart4A50.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Cart4A50.cxx; path = ../emucore/Cart4A50.cxx; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -932,7 +934,6 @@
|
|||
2D733D5E062893E7006265D9 /* FrameBufferGL.hxx */,
|
||||
2D733D61062893E7006265D9 /* FrameBufferSoft.cxx */,
|
||||
2D733D62062893E7006265D9 /* FrameBufferSoft.hxx */,
|
||||
DCB9DA5E0FCD527000B192F6 /* GLShaderProgs.hxx */,
|
||||
2DDBEA0A0845700300812C11 /* mainSDL.cxx */,
|
||||
DC3FE49D11C7D3FE00C91C72 /* PNGLibrary.cxx */,
|
||||
DC3FE49E11C7D3FE00C91C72 /* PNGLibrary.hxx */,
|
||||
|
@ -1170,6 +1171,8 @@
|
|||
DC5D2C5F0F129B1E004D1660 /* LauncherFilterDialog.hxx */,
|
||||
2DDBEAC0084578BF00812C11 /* ListWidget.cxx */,
|
||||
2DDBEAC1084578BF00812C11 /* ListWidget.hxx */,
|
||||
DC7A769813FEA40300ED8633 /* LoggerDialog.cxx */,
|
||||
DC7A769913FEA40300ED8633 /* LoggerDialog.hxx */,
|
||||
2DDBEAC2084578BF00812C11 /* Menu.cxx */,
|
||||
2DDBEAC3084578BF00812C11 /* Menu.hxx */,
|
||||
DCB5CEE511F5B78C00C68D09 /* MessageBox.cxx */,
|
||||
|
@ -1449,7 +1452,6 @@
|
|||
DCF467BD0F9399F500B25D7A /* Version.hxx in Headers */,
|
||||
DCF467C30F939A1400B25D7A /* CartEF.hxx in Headers */,
|
||||
DCF467C50F939A1400B25D7A /* CartEFSC.hxx in Headers */,
|
||||
DCB9DA5F0FCD527000B192F6 /* GLShaderProgs.hxx in Headers */,
|
||||
DC5D1AA7102C6FC900E59AC1 /* Stack.hxx in Headers */,
|
||||
DCF7B0DE10A762FC007A2870 /* CartF0.hxx in Headers */,
|
||||
DCF7B0E010A762FC007A2870 /* CartFA.hxx in Headers */,
|
||||
|
@ -1476,6 +1478,7 @@
|
|||
DC17E80C1361FDB500397A9E /* pngstruct.h in Headers */,
|
||||
DC20D6F3138EB130002A7428 /* StringList.hxx in Headers */,
|
||||
DC20D6F4138EB130002A7428 /* StringParser.hxx in Headers */,
|
||||
DC7A769B13FEA40300ED8633 /* LoggerDialog.hxx in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -1733,6 +1736,7 @@
|
|||
DCB5CEE711F5B78C00C68D09 /* MessageBox.cxx in Sources */,
|
||||
DCBD96891210314C0087CEFD /* ComboDialog.cxx in Sources */,
|
||||
DC4AF1F312E39F700090B82E /* Thumbulator.cxx in Sources */,
|
||||
DC7A769A13FEA40300ED8633 /* LoggerDialog.cxx in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -1808,6 +1812,10 @@
|
|||
2D91751809BA90380026E9FF /* Deployment */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
i386,
|
||||
ppc,
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
.,
|
||||
"$(HOME)/Library/Frameworks",
|
||||
|
|
|
@ -303,7 +303,6 @@
|
|||
DCA23AEA0D75B22500F77B33 /* CartX07.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCA23AE80D75B22500F77B33 /* CartX07.hxx */; };
|
||||
DCAD60A81152F8BD00BC4184 /* CartDPCPlus.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCAD60A61152F8BD00BC4184 /* CartDPCPlus.cxx */; };
|
||||
DCAD60A91152F8BD00BC4184 /* CartDPCPlus.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCAD60A71152F8BD00BC4184 /* CartDPCPlus.hxx */; };
|
||||
DCB9DA5F0FCD527000B192F6 /* GLShaderProgs.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCB9DA5E0FCD527000B192F6 /* GLShaderProgs.hxx */; };
|
||||
DCC527D110B9DA19005E1287 /* Device.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCC527C910B9DA19005E1287 /* Device.hxx */; };
|
||||
DCC527D210B9DA19005E1287 /* M6502.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCC527CA10B9DA19005E1287 /* M6502.cxx */; };
|
||||
DCC527D310B9DA19005E1287 /* M6502.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCC527CB10B9DA19005E1287 /* M6502.hxx */; };
|
||||
|
@ -711,7 +710,6 @@
|
|||
DCA43BFF10DED5890070CEFD /* Info-Stella.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Stella.plist"; sourceTree = "<group>"; };
|
||||
DCAD60A61152F8BD00BC4184 /* CartDPCPlus.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CartDPCPlus.cxx; path = ../emucore/CartDPCPlus.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCAD60A71152F8BD00BC4184 /* CartDPCPlus.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CartDPCPlus.hxx; path = ../emucore/CartDPCPlus.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCB9DA5E0FCD527000B192F6 /* GLShaderProgs.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GLShaderProgs.hxx; path = ../common/GLShaderProgs.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCBA710010DED62E0077193B /* Stella.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Stella.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DCC527C910B9DA19005E1287 /* Device.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Device.hxx; path = ../emucore/Device.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCC527CA10B9DA19005E1287 /* M6502.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = M6502.cxx; path = ../emucore/M6502.cxx; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -933,7 +931,6 @@
|
|||
2D733D5E062893E7006265D9 /* FrameBufferGL.hxx */,
|
||||
2D733D61062893E7006265D9 /* FrameBufferSoft.cxx */,
|
||||
2D733D62062893E7006265D9 /* FrameBufferSoft.hxx */,
|
||||
DCB9DA5E0FCD527000B192F6 /* GLShaderProgs.hxx */,
|
||||
2DDBEA0A0845700300812C11 /* mainSDL.cxx */,
|
||||
DCD6FC9111C28C6F005DA767 /* PNGLibrary.cxx */,
|
||||
DCD6FC9211C28C6F005DA767 /* PNGLibrary.hxx */,
|
||||
|
@ -1452,7 +1449,6 @@
|
|||
DCF467BD0F9399F500B25D7A /* Version.hxx in Headers */,
|
||||
DCF467C30F939A1400B25D7A /* CartEF.hxx in Headers */,
|
||||
DCF467C50F939A1400B25D7A /* CartEFSC.hxx in Headers */,
|
||||
DCB9DA5F0FCD527000B192F6 /* GLShaderProgs.hxx in Headers */,
|
||||
DC5D1AA7102C6FC900E59AC1 /* Stack.hxx in Headers */,
|
||||
DCF7B0DE10A762FC007A2870 /* CartF0.hxx in Headers */,
|
||||
DCF7B0E010A762FC007A2870 /* CartFA.hxx in Headers */,
|
||||
|
|
Loading…
Reference in New Issue