diff --git a/ref/gl/gl2_shim/gl2_shim.c b/ref/gl/gl2_shim/gl2_shim.c index c825cb20..e576c7c3 100644 --- a/ref/gl/gl2_shim/gl2_shim.c +++ b/ref/gl/gl2_shim/gl2_shim.c @@ -355,16 +355,22 @@ static gl2wrap_prog_t *GL2_GetProg( const GLuint flags ) pglDeleteObjectARB( fp ); /// TODO: detect arb/core shaders in engine -#if 0 //ndef XASH_GLES - pglGetObjectParameterivARB( glprog, GL_OBJECT_LINK_STATUS_ARB, &status ); + + if( pglProgramiv ) + pglProgramiv( glprog, GL_OBJECT_LINK_STATUS_ARB, &status ); + else + pglGetObjectParameterivARB( glprog, GL_OBJECT_LINK_STATUS_ARB, &status ); if ( status == GL_FALSE ) { gEngfuncs.Con_Reportf( S_ERROR "GL2_GetProg(): Failed linking progs for 0x%04x!\n%s\n", prog->flags, GL_PrintInfoLog(glprog) ); prog->flags = 0; - pglDeleteObjectARB( glprog ); + if( pglDeleteProgram ) + pglDeleteProgram( glprog ); + else + pglDeleteObjectARB( glprog ); return NULL; } -#endif + prog->ucolor = pglGetUniformLocationARB( glprog, "uColor" ); prog->ualpha = pglGetUniformLocationARB( glprog, "uAlphaTest" ); diff --git a/ref/gl/gl_export.h b/ref/gl/gl_export.h index c27c61fc..8887a189 100644 --- a/ref/gl/gl_export.h +++ b/ref/gl/gl_export.h @@ -1366,6 +1366,10 @@ APIENTRY_LINKAGE void GL_FUNCTION( glGenVertexArrays )( GLsizei n, const GLuint APIENTRY_LINKAGE GLboolean GL_FUNCTION( glIsVertexArray )( GLuint array ); APIENTRY_LINKAGE void GL_FUNCTION( glSwapInterval ) ( int interval ); +APIENTRY_LINKAGE void GL_FUNCTION( glDeleteProgram )(GLuint program); +APIENTRY_LINKAGE void GL_FUNCTION( glProgramiv )(GLuint program, GLenum e, GLuint *v); + + #if !defined( XASH_GL_STATIC ) || (!defined( XASH_GLES ) && !defined( XASH_GL4ES )) APIENTRY_LINKAGE void GL_FUNCTION( glTexImage2DMultisample )(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); #endif /* !XASH_GLES && !XASH_GL4ES */ diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index 4976a8b0..9871210b 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -354,6 +354,8 @@ static dllfunc_t shaderobjectsfuncs_gles[] = { "glVertexAttrib2f" , (void **)&pglVertexAttrib2fARB }, { "glVertexAttrib2fv" , (void **)&pglVertexAttrib2fvARB }, { "glVertexAttrib3fv" , (void **)&pglVertexAttrib3fvARB }, + { "glProgramiv" , (void**)&pglProgramiv }, + { "glDeleteProgram" , (void**)&pglDeleteProgram }, //{ "glVertexAttrib4f" , (void **)&pglVertexAttrib4fARB }, //{ "glVertexAttrib4fv" , (void **)&pglVertexAttrib4fvARB }, //{ "glVertexAttrib4ubv" , (void **)&pglVertexAttrib4ubvARB },