This attached patch should close this bug. It replaces patch
15_glxfix.dpatch. It works on nVidia geforce and quadro cards and is
untested on all other cards, however it "should" work.
Todd
--- /tmp/snes9x-1.43/snes9x-1.43-src/snes9x/unix/opengl.cpp 2004-12-30 16:15:47.000000000 -0600
+++ opengl.cpp 2006-10-28 01:04:00.000000000 -0500
@@ -87,13 +87,14 @@
Nintendo Co., Limited and its subsidiary companies.
*******************************************************************************/
#include <math.h>
+#include <strings.h>
#include "snes9x.h"
#include "gfx.h"
#include "3d.h"
#include "x11.h"
#ifdef USE_OPENGL
-static int dbdepat [] = {GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, None};
+//static int dbdepat [] = {GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, None};
//static int sbdepat [] = {GLX_RGBA,GLX_DEPTH_SIZE, 16, None};
//static int dbnodepat [] = {GLX_RGBA, GLX_DOUBLEBUFFER, None};
//static int sbnodepat [] = {GLX_RGBA, None};
@@ -108,16 +109,35 @@
bool8 S9xOpenGLInit ()
{
XVisualInfo *vi;
- vi = glXChooseVisual (GUI.display,
- XScreenNumberOfScreen (GUI.screen), dbdepat);
+ GLXFBConfig *config;
+ int nelements;
+ /* Ask for a nice GL color buffer config */
+ const int attrib_list[] = {
+ GLX_LEVEL, 0,
+ GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
+ GLX_DOUBLEBUFFER, True,
+ GLX_BUFFER_SIZE, 24,
+ None
+ };
+
+ config = glXChooseFBConfig(GUI.display, XScreenNumberOfScreen (GUI.screen), attrib_list, &nelements);
+
+ if (nelements < 1) {
+ fprintf(stderr, "S9xOpenGLInit: Couldn't get a TrueColor, 24-bit,"
+ " double-buffered, image buffer for OpenGL rendering.\n");
+ abort();
+ }
+
+ vi = glXGetVisualFromFBConfig(GUI.display, config[0]);
if (!vi)
return (FALSE);
GUI.visual = vi->visual;
GUI.depth = vi->depth;
- GUI.glcontext = glXCreateContext (GUI.display, vi, 0, GL_TRUE);
+ GUI.glcontext = glXCreateNewContext(GUI.display, config[0], GLX_RGBA_TYPE, NULL, True);
+
if (!GUI.glcontext)
return (FALSE);