mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-12 08:08:02 +00:00
ref_gl: do not trust REFAPI context version, get it from OpenGL anyway
This commit is contained in:
parent
c0b068d81b
commit
150cbfa4de
@ -823,6 +823,8 @@ typedef float GLmatrix[16];
|
|||||||
#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
|
#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
|
||||||
#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
|
#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
|
||||||
|
|
||||||
|
#define GL_MAJOR_VERSION 0x821B
|
||||||
|
#define GL_MINOR_VERSION 0x821C
|
||||||
|
|
||||||
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||||
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||||
|
@ -989,6 +989,7 @@ void GL_InitExtensionsBigGL( void )
|
|||||||
void GL_InitExtensions( void )
|
void GL_InitExtensions( void )
|
||||||
{
|
{
|
||||||
char value[MAX_VA_STRING];
|
char value[MAX_VA_STRING];
|
||||||
|
GLint major = 0, minor = 0;
|
||||||
|
|
||||||
GL_OnContextCreated();
|
GL_OnContextCreated();
|
||||||
|
|
||||||
@ -1000,11 +1001,26 @@ void GL_InitExtensions( void )
|
|||||||
glConfig.renderer_string = (const char *)pglGetString( GL_RENDERER );
|
glConfig.renderer_string = (const char *)pglGetString( GL_RENDERER );
|
||||||
glConfig.version_string = (const char *)pglGetString( GL_VERSION );
|
glConfig.version_string = (const char *)pglGetString( GL_VERSION );
|
||||||
glConfig.extensions_string = (const char *)pglGetString( GL_EXTENSIONS );
|
glConfig.extensions_string = (const char *)pglGetString( GL_EXTENSIONS );
|
||||||
if( !glConfig.version_major && glConfig.version_string )
|
|
||||||
|
pglGetIntegerv(GL_MAJOR_VERSION, &major);
|
||||||
|
pglGetIntegerv(GL_MINOR_VERSION, &minor);
|
||||||
|
if( !major && glConfig.version_string )
|
||||||
{
|
{
|
||||||
float ver = Q_atof( glConfig.version_string );
|
const char *str = glConfig.version_string;
|
||||||
glConfig.version_major = ver;
|
float ver;
|
||||||
glConfig.version_major = (int)(ver * 10) % 10;
|
|
||||||
|
while(*str && (*str < '0' || *str > '9')) str++;
|
||||||
|
ver = Q_atof(str);
|
||||||
|
if( ver )
|
||||||
|
{
|
||||||
|
glConfig.version_major = ver;
|
||||||
|
glConfig.version_minor = (int)(ver * 10) % 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glConfig.version_major = major;
|
||||||
|
glConfig.version_minor = minor;
|
||||||
}
|
}
|
||||||
#ifndef XASH_GL_STATIC
|
#ifndef XASH_GL_STATIC
|
||||||
if( !glConfig.extensions_string )
|
if( !glConfig.extensions_string )
|
||||||
|
Loading…
Reference in New Issue
Block a user