Skip to content
Permalink
Browse files

[MP] Fix glStencilOpSeparate usage for macOS

  • Loading branch information...
xycaleth committed Nov 23, 2019
1 parent 146189a commit 2b8b3e640b3e29855494e02044f4b1c470f2cfd1
Showing with 11 additions and 0 deletions.
  1. +5 −0 codemp/rd-vanilla/qgl.h
  2. +6 −0 codemp/rd-vanilla/tr_init.cpp
@@ -306,6 +306,9 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define qglStencilFunc glStencilFunc
#define qglStencilMask glStencilMask
#define qglStencilOp glStencilOp
#if defined(__APPLE__)
#define qglStencilOpSeparate glStencilOpSeparate
#endif
#define qglTexCoord1d glTexCoord1d
#define qglTexCoord1dv glTexCoord1dv
#define qglTexCoord1f glTexCoord1f
@@ -392,7 +395,9 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define qglVertexPointer glVertexPointer
#define qglViewport glViewport

#if !defined(__APPLE__)
extern PFNGLSTENCILOPSEPARATEPROC qglStencilOpSeparate;
#endif

extern PFNGLACTIVETEXTUREARBPROC qglActiveTextureARB;
extern PFNGLCLIENTACTIVETEXTUREARBPROC qglClientActiveTextureARB;
@@ -216,7 +216,9 @@ cvar_t *se_language;
cvar_t *r_aviMotionJpegQuality;
cvar_t *r_screenshotJpegQuality;

#if !defined(__APPLE__)
PFNGLSTENCILOPSEPARATEPROC qglStencilOpSeparate;
#endif

PFNGLACTIVETEXTUREARBPROC qglActiveTextureARB;
PFNGLCLIENTACTIVETEXTUREARBPROC qglClientActiveTextureARB;
@@ -728,11 +730,15 @@ static void GLimp_InitExtensions( void )
ri.Cvar_Set( "r_DynamicGlow","0" );
}

#if !defined(__APPLE__)
qglStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)ri.GL_GetProcAddress("glStencilOpSeparate");
if ( qglStencilOpSeparate )
{
glConfigExt.doStencilShadowsInOneDrawcall = qtrue;
}
#else
glConfigExt.doStencilShadowsInOneDrawcall = qtrue;
#endif
}

// Truncates the GL extensions string by only allowing up to 'maxExtensions' extensions in the string.

0 comments on commit 2b8b3e6

Please sign in to comment.
You can’t perform that action at this time.