Browse Source

ref_gl: add missing non-arb shader functions

pull/2/head
mittorn 1 year ago committed by Alibek Omarov
parent
commit
e23b632ce5
  1. 10
      ref/gl/gl2_shim/gl2_shim.c
  2. 4
      ref/gl/gl_export.h
  3. 2
      ref/gl/gl_opengl.c

10
ref/gl/gl2_shim/gl2_shim.c

@ -355,16 +355,22 @@ static gl2wrap_prog_t *GL2_GetProg( const GLuint flags )
pglDeleteObjectARB( fp ); pglDeleteObjectARB( fp );
/// TODO: detect arb/core shaders in engine /// TODO: detect arb/core shaders in engine
#if 0 //ndef XASH_GLES
if( pglProgramiv )
pglProgramiv( glprog, GL_OBJECT_LINK_STATUS_ARB, &status );
else
pglGetObjectParameterivARB( glprog, GL_OBJECT_LINK_STATUS_ARB, &status ); pglGetObjectParameterivARB( glprog, GL_OBJECT_LINK_STATUS_ARB, &status );
if ( status == GL_FALSE ) 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) ); gEngfuncs.Con_Reportf( S_ERROR "GL2_GetProg(): Failed linking progs for 0x%04x!\n%s\n", prog->flags, GL_PrintInfoLog(glprog) );
prog->flags = 0; prog->flags = 0;
if( pglDeleteProgram )
pglDeleteProgram( glprog );
else
pglDeleteObjectARB( glprog ); pglDeleteObjectARB( glprog );
return NULL; return NULL;
} }
#endif
prog->ucolor = pglGetUniformLocationARB( glprog, "uColor" ); prog->ucolor = pglGetUniformLocationARB( glprog, "uColor" );
prog->ualpha = pglGetUniformLocationARB( glprog, "uAlphaTest" ); prog->ualpha = pglGetUniformLocationARB( glprog, "uAlphaTest" );

4
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 GLboolean GL_FUNCTION( glIsVertexArray )( GLuint array );
APIENTRY_LINKAGE void GL_FUNCTION( glSwapInterval ) ( int interval ); 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 )) #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); APIENTRY_LINKAGE void GL_FUNCTION( glTexImage2DMultisample )(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
#endif /* !XASH_GLES && !XASH_GL4ES */ #endif /* !XASH_GLES && !XASH_GL4ES */

2
ref/gl/gl_opengl.c

@ -354,6 +354,8 @@ static dllfunc_t shaderobjectsfuncs_gles[] =
{ "glVertexAttrib2f" , (void **)&pglVertexAttrib2fARB }, { "glVertexAttrib2f" , (void **)&pglVertexAttrib2fARB },
{ "glVertexAttrib2fv" , (void **)&pglVertexAttrib2fvARB }, { "glVertexAttrib2fv" , (void **)&pglVertexAttrib2fvARB },
{ "glVertexAttrib3fv" , (void **)&pglVertexAttrib3fvARB }, { "glVertexAttrib3fv" , (void **)&pglVertexAttrib3fvARB },
{ "glProgramiv" , (void**)&pglProgramiv },
{ "glDeleteProgram" , (void**)&pglDeleteProgram },
//{ "glVertexAttrib4f" , (void **)&pglVertexAttrib4fARB }, //{ "glVertexAttrib4f" , (void **)&pglVertexAttrib4fARB },
//{ "glVertexAttrib4fv" , (void **)&pglVertexAttrib4fvARB }, //{ "glVertexAttrib4fv" , (void **)&pglVertexAttrib4fvARB },
//{ "glVertexAttrib4ubv" , (void **)&pglVertexAttrib4ubvARB }, //{ "glVertexAttrib4ubv" , (void **)&pglVertexAttrib4ubvARB },

Loading…
Cancel
Save