diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index 35ec81825..8fadbc8d2 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -555,8 +555,6 @@ void CL_AddCustomBeam( cl_entity_t *pEnvBeam ); #define GL_CheckForErrors() GL_CheckForErrors_( __FILE__, __LINE__ ) void GL_CheckForErrors_( const char *filename, const int fileline ); const char *GL_ErrorString( int err ); -qboolean GL_Support( int r_ext ); -int GL_MaxTextureUnits( void ); // // gl_triapi.c @@ -756,6 +754,22 @@ static inline uint LinearGammaTable( uint b ) return !FBitSet( gp_host->features, ENGINE_LINEAR_GAMMA_SPACE ) ? tr.lineargammatable[b] : b; } +static inline qboolean GL_Support( int r_ext ) +{ + if( r_ext >= 0 && r_ext < GL_EXTCOUNT ) + return glConfig.extension[r_ext] ? true : false; + gEngfuncs.Con_Printf( S_ERROR "%s: invalid extension %d\n", __func__, r_ext ); + + return false; +} + +static inline int GL_MaxTextureUnits( void ) +{ + if( GL_Support( GL_SHADER_GLSL100_EXT )) + return Q_min( Q_max( glConfig.max_texture_coords, glConfig.max_teximage_units ), MAX_TEXTURE_UNITS ); + return glConfig.max_texture_units; +} + #define WORLDMODEL (gp_cl->models[1]) // diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index e785221b4..826fe539f 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -464,32 +464,6 @@ static void GL_SetExtension( int r_ext, int enable ) else gEngfuncs.Con_Printf( S_ERROR "%s: invalid extension %d\n", __func__, r_ext ); } -/* -================= -GL_Support -================= -*/ -qboolean GL_Support( int r_ext ) -{ - if( r_ext >= 0 && r_ext < GL_EXTCOUNT ) - return glConfig.extension[r_ext] ? true : false; - gEngfuncs.Con_Printf( S_ERROR "%s: invalid extension %d\n", __func__, r_ext ); - - return false; -} - -/* -================= -GL_MaxTextureUnits -================= -*/ -int GL_MaxTextureUnits( void ) -{ - if( GL_Support( GL_SHADER_GLSL100_EXT )) - return Q_min( Q_max( glConfig.max_texture_coords, glConfig.max_teximage_units ), MAX_TEXTURE_UNITS ); - return glConfig.max_texture_units; -} - /* ================= GL_CheckExtension