|
From: <ste...@us...> - 2009-05-29 10:20:32
|
Revision: 1745
http://stella.svn.sourceforge.net/stella/?rev=1745&view=rev
Author: stephena
Date: 2009-05-29 10:20:31 +0000 (Fri, 29 May 2009)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/src/common/FrameBufferGL.cxx
trunk/src/common/FrameBufferGL.hxx
trunk/src/gui/VideoDialog.cxx
Modified: trunk/src/common/FrameBufferGL.cxx
===================================================================
--- trunk/src/common/FrameBufferGL.cxx 2009-05-28 10:42:16 UTC (rev 1744)
+++ trunk/src/common/FrameBufferGL.cxx 2009-05-29 10:20:31 UTC (rev 1745)
@@ -579,6 +579,9 @@
myTexTarget = GL_TEXTURE_RECTANGLE_ARB;
myTexCoord[2] = (GLfloat) myTexWidth;
myTexCoord[3] = (GLfloat) myTexHeight;
+
+ // This is a quick fix, a better one will come later
+ myTvFiltersEnabled = false;
}
else
{
Modified: trunk/src/common/FrameBufferGL.hxx
===================================================================
--- trunk/src/common/FrameBufferGL.hxx 2009-05-28 10:42:16 UTC (rev 1744)
+++ trunk/src/common/FrameBufferGL.hxx 2009-05-29 10:20:31 UTC (rev 1745)
@@ -61,6 +61,12 @@
*/
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
//////////////////////////////////////////////////////////////////////
Modified: trunk/src/gui/VideoDialog.cxx
===================================================================
--- trunk/src/gui/VideoDialog.cxx 2009-05-28 10:42:16 UTC (rev 1744)
+++ trunk/src/gui/VideoDialog.cxx 2009-05-29 10:20:31 UTC (rev 1745)
@@ -34,6 +34,7 @@
#include "StringList.hxx"
#include "Widget.hxx"
#include "TabWidget.hxx"
+#include "FrameBufferGL.hxx"
#include "VideoDialog.hxx"
@@ -273,6 +274,10 @@
new StaticTextWidget(myTab, font, 10, ypos, lwidth, fontHeight,
"(*) TV effects require OpenGL 2.0+ & GLSL",
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
addToFocusList(wid, tabID);
@@ -290,7 +295,7 @@
addBGroupToFocusList(wid);
// Disable certain functions when we know they aren't present
-#ifndef DISPLAY_GL
+#ifndef DISPLAY_OPENGL
myGLFilterPopup->clearFlags(WIDGET_ENABLED);
myNAspectRatioSlider->clearFlags(WIDGET_ENABLED);
myNAspectRatioLabel->clearFlags(WIDGET_ENABLED);
@@ -389,21 +394,30 @@
// Center window
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
myTexturePopup->setSelected(instance().settings().getString("tv_tex"), "off");
- myTexturePopup->setEnabled(gl);
+ myTexturePopup->setEnabled(tv);
// TV color bleed effect
myBleedPopup->setSelected(instance().settings().getString("tv_bleed"), "off");
- myBleedPopup->setEnabled(gl);
+ myBleedPopup->setEnabled(tv);
// TV random noise effect
myNoisePopup->setSelected(instance().settings().getString("tv_noise"), "off");
- myNoisePopup->setEnabled(gl);
+ myNoisePopup->setEnabled(tv);
// TV phosphor burn-off effect
myPhosphorCheckbox->setState(instance().settings().getBool("tv_phos"));
- myPhosphorCheckbox->setEnabled(gl);
+ myPhosphorCheckbox->setEnabled(tv);
+#endif
myTab->loadConfig();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|