Skip to content
Permalink
Browse files

[SP] Fix glStencilOpSeparate usage for macOS

  • Loading branch information...
xycaleth committed Nov 23, 2019
1 parent 2b8b3e6 commit 8f1827a198ff3f1fe15eddb39d360d479be30111
Showing with 11 additions and 0 deletions.
  1. +5 −0 code/rd-vanilla/qgl.h
  2. +6 −0 code/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
@@ -386,7 +389,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;
@@ -185,7 +185,9 @@ cvar_t *com_buildScript;
cvar_t *r_environmentMapping;
cvar_t *r_screenshotJpegQuality;

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

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

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

/*

0 comments on commit 8f1827a

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