Use PFNGLSTENCILOPSEPARATEATIPROC on Mac OS X <= 10.5

The system OpenGL headers only include the ATI implementation prior to 10.6
This commit is contained in:
SiliconExarch 2021-08-27 09:55:49 +01:00
parent 67ce97f346
commit 3bad1aa696
2 changed files with 20 additions and 0 deletions

View file

@ -278,7 +278,12 @@ PFNGLPROGRAMLOCALPARAMETER4FVARBPROC qglProgramLocalParameter4fvARB;
PFNGLDEPTHBOUNDSEXTPROC qglDepthBoundsEXT;
// DG: couldn't find any extension for this, it's supported in GL2.0 and newer, incl OpenGL ES2.0
// SE: only the ATI implementation is provided on Mac OS X 10.4 and 10.5
#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 1050)
PFNGLSTENCILOPSEPARATEATIPROC qglStencilOpSeparate;
#else
PFNGLSTENCILOPSEPARATEPROC qglStencilOpSeparate;
#endif
/*
=================
@ -398,6 +403,15 @@ static void R_CheckPortableExtensions( void ) {
if ( glConfig.twoSidedStencilAvailable )
qglActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)GLimp_ExtensionPointer( "glActiveStencilFaceEXT" );
#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 1050)
if( glConfig.glVersion >= 2.0) {
common->Printf( "... got GL2.0+ glStencilOpSeparate()\n" );
qglStencilOpSeparate = (PFNGLSTENCILOPSEPARATEATIPROC)GLimp_ExtensionPointer( "glStencilOpSeparateATI" );
} else {
common->Printf( "... don't have GL2.0+ glStencilOpSeparate()\n" );
qglStencilOpSeparate = NULL;
}
#else
if( glConfig.glVersion >= 2.0) {
common->Printf( "... got GL2.0+ glStencilOpSeparate()\n" );
qglStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)GLimp_ExtensionPointer( "glStencilOpSeparate" );
@ -406,6 +420,7 @@ static void R_CheckPortableExtensions( void ) {
common->Printf( "... don't have GL2.0+ glStencilOpSeparate()\n" );
qglStencilOpSeparate = NULL;
}
#endif
// ARB_vertex_buffer_object
glConfig.ARBVertexBufferObjectAvailable = R_CheckExtension( "GL_ARB_vertex_buffer_object" );

View file

@ -96,7 +96,12 @@ extern void ( APIENTRY *qglColorTableEXT)( int, int, int, int, int, const void *
extern PFNGLACTIVESTENCILFACEEXTPROC qglActiveStencilFaceEXT;
// DG: couldn't find any extension for this, it's supported in GL2.0 and newer, incl OpenGL ES2.0
// SE: only the ATI implementation is provided on Mac OS X 10.4 and 10.5
#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 1050)
extern PFNGLSTENCILOPSEPARATEATIPROC qglStencilOpSeparate;
#else
extern PFNGLSTENCILOPSEPARATEPROC qglStencilOpSeparate;
#endif
// ARB_texture_compression
extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC qglCompressedTexImage2DARB;