On Donnerstag 08 Dezember 2005 02:08, Ampere K. Hardraade wrote:
> https://bugs.freedesktop.org/show_bug.cgi?id=5142
>
> So, the problem seems to be that pbuffer is not supported?
Can you test the attached patch?

  Greetings

           Mathias

-- 
Mathias Fröhlich, email: [EMAIL PROTECTED]
Index: simgear/screen/RenderTexture.cpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/screen/RenderTexture.cpp,v
retrieving revision 1.15
diff -u -r1.15 RenderTexture.cpp
--- simgear/screen/RenderTexture.cpp	27 Nov 2005 09:48:51 -0000	1.15
+++ simgear/screen/RenderTexture.cpp	12 Dec 2005 18:01:44 -0000
@@ -1820,6 +1820,9 @@
     }
 #elif defined( __APPLE__ )
 #else
+    Display* dpy = glXGetCurrentDisplay();
+    int minor = 0, major = 0;
+    glXQueryVersion(dpy, &minor, &major);
 
     // First try the glX version 1.3 functions.
     glXChooseFBConfigPtr = (glXChooseFBConfigProc)SGLookupFunction("glXChooseFBConfig");
@@ -1829,7 +1832,8 @@
     glXDestroyPbufferPtr = (glXDestroyPbufferProc)SGLookupFunction("glXDestroyPbuffer");
     glXQueryDrawablePtr = (glXQueryDrawableProc)SGLookupFunction("glXQueryDrawable");
 
-    if (glXChooseFBConfigPtr &&
+    if (((1 <= major && 3 <= minor) || 2 <= major) &&
+        glXChooseFBConfigPtr &&
         glXCreatePbufferPtr &&
         glXGetVisualFromFBConfigPtr &&
         glXCreateContextPtr &&
@@ -1838,6 +1842,12 @@
         glXVersion1_3Present = true;
     else
     {
+        int screen = DefaultScreen(dpy);
+        const char* extString = glXQueryExtensionsString(dpy, screen);
+        if (!SGSearchExtensionsString(extString, "GLX_SGIX_fbconfig") ||
+            !SGSearchExtensionsString(extString, "GLX_SGIX_pbuffer"))
+            return false;
+
         glXChooseFBConfigPtr = (glXChooseFBConfigProc)SGLookupFunction("glXChooseFBConfigSGIX");
         glXCreateGLXPbufferPtr = (glXCreateGLXPbufferProc)SGLookupFunction("glXCreateGLXPbufferSGIX");
         glXGetVisualFromFBConfigPtr =  (glXGetVisualFromFBConfigProc)SGLookupFunction("glXGetVisualFromFBConfigSGIX");
_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to