]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/glx11.cpp
wxRTC: save and load the 'shown' status in case there's a situation where layout...
[wxWidgets.git] / src / unix / glx11.cpp
index c90b1fc3c467403064ff0579636bc0fd7094e640..ec2bd5b0989a65c9ed01e020329890eda5d56d0b 100644 (file)
@@ -1,9 +1,8 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        src/univ/glx11.cpp
+// Name:        src/unix/glx11.cpp
 // Purpose:     code common to all X11-based wxGLCanvas implementations
 // Author:      Vadim Zeitlin
 // Created:     2007-04-15
-// RCS-ID:      $Id$
 // Copyright:   (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "wx/glcanvas.h"
 
+// IRIX headers call this differently
+#ifdef __SGI__
+    #ifndef GLX_SAMPLE_BUFFERS_ARB
+        #define GLX_SAMPLE_BUFFERS_ARB GLX_SAMPLE_BUFFERS_SGIS
+    #endif
+    #ifndef GLX_SAMPLES_ARB
+        #define GLX_SAMPLES_ARB GLX_SAMPLES_SGIS
+    #endif
+#endif // __SGI__
+
 // ============================================================================
 // wxGLContext implementation
 // ============================================================================
@@ -278,30 +287,33 @@ wxGLCanvasX11::ConvertWXAttrsToGL(const int *wxattrs, int *glattrs, size_t n)
                     break;
 
                 case WX_GL_SAMPLE_BUFFERS:
-                    if ( !IsGLXMultiSampleAvailable() )
+#ifdef GLX_SAMPLE_BUFFERS_ARB
+                    if ( IsGLXMultiSampleAvailable() )
                     {
-                        // if it was specified just to disable it, no problem
-                        if ( !wxattrs[arg++] )
-                            continue;
-
-                        // otherwise indicate that it's not supported
-                        return false;
+                        glattrs[p++] = GLX_SAMPLE_BUFFERS_ARB;
+                        break;
                     }
+#endif // GLX_SAMPLE_BUFFERS_ARB
+                    // if it was specified just to disable it, no problem
+                    if ( !wxattrs[arg++] )
+                        continue;
 
-                    glattrs[p++] = GLX_SAMPLE_BUFFERS_ARB;
-                    break;
+                    // otherwise indicate that it's not supported
+                    return false;
 
                 case WX_GL_SAMPLES:
-                    if ( !IsGLXMultiSampleAvailable() )
+#ifdef GLX_SAMPLES_ARB
+                    if ( IsGLXMultiSampleAvailable() )
                     {
-                        if ( !wxattrs[arg++] )
-                            continue;
-
-                        return false;
+                        glattrs[p++] = GLX_SAMPLES_ARB;
+                        break;
                     }
+#endif // GLX_SAMPLES_ARB
 
-                    glattrs[p++] = GLX_SAMPLES_ARB;
-                    break;
+                    if ( !wxattrs[arg++] )
+                        continue;
+
+                    return false;
 
                 default:
                     wxLogDebug(wxT("Unsupported OpenGL attribute %d"),