Support IRIX version of OpenGL multi sampling constants.
Although OpenGL multi sampling extensions originated under IRIX, it doesn't seem to use the standard names for the constants used and uses "SGI" suffix for them instead of "ARB". Add support for IRIX versions of GLX_SAMPLE_BUFFERS_ARB and GLX_SAMPLES_ARB and also check if these constants are defined at all to avoid compilation errors if they are not. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
713a0408bb
commit
049c4f6caa
@ -27,6 +27,16 @@
|
||||
|
||||
#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 +288,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"),
|
||||
|
Loading…
Reference in New Issue
Block a user