On Dienstag 13 Dezember 2005 03:31, Ampere K. Hardraade wrote:
> After some investigation, I found that the new if...else statement never
> got run because RenderTexture was able to successfully try the glx version
> 1.3 functions.
Well I swapped the minor and major aguments ...
That one, appart from the color issue?

   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	13 Dec 2005 06:24:54 -0000
@@ -1820,6 +1820,10 @@
     }
 #elif defined( __APPLE__ )
 #else
+    Display* dpy = glXGetCurrentDisplay();
+    int minor = 0, major = 0;
+    if (!glXQueryVersion(dpy, &major, &minor))
+        return false;
 
     // First try the glX version 1.3 functions.
     glXChooseFBConfigPtr = (glXChooseFBConfigProc)SGLookupFunction("glXChooseFBConfig");
@@ -1829,7 +1833,8 @@
     glXDestroyPbufferPtr = (glXDestroyPbufferProc)SGLookupFunction("glXDestroyPbuffer");
     glXQueryDrawablePtr = (glXQueryDrawableProc)SGLookupFunction("glXQueryDrawable");
 
-    if (glXChooseFBConfigPtr &&
+    if (((1 <= major && 3 <= minor) || 2 <= major) &&
+        glXChooseFBConfigPtr &&
         glXCreatePbufferPtr &&
         glXGetVisualFromFBConfigPtr &&
         glXCreateContextPtr &&
@@ -1838,6 +1843,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