OpenGL TV filters require OpenGL 2.0+ and cannot currently be used when

'gl_texrect' is enabled.  The VideoDialog now reflects this, by stating
a message, and disabling the UI items when not satisfied.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1745 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2009-05-29 10:20:31 +00:00
parent 136a7062ac
commit 402b13afd7
3 changed files with 28 additions and 5 deletions

View File

@ -579,6 +579,9 @@ FBSurfaceGL::FBSurfaceGL(FrameBufferGL& buffer,
myTexTarget = GL_TEXTURE_RECTANGLE_ARB; myTexTarget = GL_TEXTURE_RECTANGLE_ARB;
myTexCoord[2] = (GLfloat) myTexWidth; myTexCoord[2] = (GLfloat) myTexWidth;
myTexCoord[3] = (GLfloat) myTexHeight; myTexCoord[3] = (GLfloat) myTexHeight;
// This is a quick fix, a better one will come later
myTvFiltersEnabled = false;
} }
else else
{ {

View File

@ -61,6 +61,12 @@ class FrameBufferGL : public FrameBuffer
*/ */
static bool loadLibrary(const string& library); static bool loadLibrary(const string& library);
/**
Return version of the OpenGL library found by the OSystem
(0 indicates that the libary was not loaded successfully).
*/
static float glVersion() { return myGLVersion; }
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// The following are derived from public methods in FrameBuffer.hxx // The following are derived from public methods in FrameBuffer.hxx
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -34,6 +34,7 @@
#include "StringList.hxx" #include "StringList.hxx"
#include "Widget.hxx" #include "Widget.hxx"
#include "TabWidget.hxx" #include "TabWidget.hxx"
#include "FrameBufferGL.hxx"
#include "VideoDialog.hxx" #include "VideoDialog.hxx"
@ -273,6 +274,10 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
new StaticTextWidget(myTab, font, 10, ypos, lwidth, fontHeight, new StaticTextWidget(myTab, font, 10, ypos, lwidth, fontHeight,
"(*) TV effects require OpenGL 2.0+ & GLSL", "(*) TV effects require OpenGL 2.0+ & GLSL",
kTextAlignLeft); kTextAlignLeft);
ypos += lineHeight + 4;
new StaticTextWidget(myTab, font, 10+font.getStringWidth("(*) "), ypos,
lwidth, fontHeight, "\'gl_texrect\' must be disabled",
kTextAlignLeft);
// Add items for tab 2 // Add items for tab 2
addToFocusList(wid, tabID); addToFocusList(wid, tabID);
@ -290,7 +295,7 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
addBGroupToFocusList(wid); addBGroupToFocusList(wid);
// Disable certain functions when we know they aren't present // Disable certain functions when we know they aren't present
#ifndef DISPLAY_GL #ifndef DISPLAY_OPENGL
myGLFilterPopup->clearFlags(WIDGET_ENABLED); myGLFilterPopup->clearFlags(WIDGET_ENABLED);
myNAspectRatioSlider->clearFlags(WIDGET_ENABLED); myNAspectRatioSlider->clearFlags(WIDGET_ENABLED);
myNAspectRatioLabel->clearFlags(WIDGET_ENABLED); myNAspectRatioLabel->clearFlags(WIDGET_ENABLED);
@ -389,21 +394,30 @@ void VideoDialog::loadConfig()
// Center window // Center window
myCenterCheckbox->setState(instance().settings().getBool("center")); myCenterCheckbox->setState(instance().settings().getBool("center"));
#ifdef DISPLAY_OPENGL
//////////////////////////////////////////////////////////////////////
// TV effects are only enabled in OpenGL mode, and only if OpenGL 2.0+
// is available; for now, 'gl_texrect' must also be disabled
bool tv = gl && FrameBufferGL::glVersion() >= 2.0 &&
!instance().settings().getBool("gl_texrect");
//////////////////////////////////////////////////////////////////////
// TV color texture effect // TV color texture effect
myTexturePopup->setSelected(instance().settings().getString("tv_tex"), "off"); myTexturePopup->setSelected(instance().settings().getString("tv_tex"), "off");
myTexturePopup->setEnabled(gl); myTexturePopup->setEnabled(tv);
// TV color bleed effect // TV color bleed effect
myBleedPopup->setSelected(instance().settings().getString("tv_bleed"), "off"); myBleedPopup->setSelected(instance().settings().getString("tv_bleed"), "off");
myBleedPopup->setEnabled(gl); myBleedPopup->setEnabled(tv);
// TV random noise effect // TV random noise effect
myNoisePopup->setSelected(instance().settings().getString("tv_noise"), "off"); myNoisePopup->setSelected(instance().settings().getString("tv_noise"), "off");
myNoisePopup->setEnabled(gl); myNoisePopup->setEnabled(tv);
// TV phosphor burn-off effect // TV phosphor burn-off effect
myPhosphorCheckbox->setState(instance().settings().getBool("tv_phos")); myPhosphorCheckbox->setState(instance().settings().getBool("tv_phos"));
myPhosphorCheckbox->setEnabled(gl); myPhosphorCheckbox->setEnabled(tv);
#endif
myTab->loadConfig(); myTab->loadConfig();
} }