mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 20:31:30 +00:00
Use OpenGL 1.3 in static builds and on SDL interfaces
This commit is contained in:
parent
9d1da548aa
commit
6d773c54a5
4 changed files with 15 additions and 16 deletions
|
@ -366,10 +366,7 @@ static INT32 WINAPI SetRes(viddef_t *lvid, vmode_t *pcurrentmode)
|
||||||
else
|
else
|
||||||
maximumAnisotropy = 0;
|
maximumAnisotropy = 0;
|
||||||
|
|
||||||
#ifndef MINI_GL_COMPATIBILITY
|
|
||||||
SetupGLFunc13();
|
SetupGLFunc13();
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
screen_depth = (GLbyte)(lvid->bpp*8);
|
screen_depth = (GLbyte)(lvid->bpp*8);
|
||||||
if (screen_depth > 16)
|
if (screen_depth > 16)
|
||||||
|
|
|
@ -517,18 +517,15 @@ boolean SetupGLfunc(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MINI_GL_COMPATIBILITY
|
|
||||||
// This has to be done after the context is created so the version number can be obtained
|
// This has to be done after the context is created so the version number can be obtained
|
||||||
boolean SetupGLFunc13(void)
|
boolean SetupGLFunc13(void)
|
||||||
{
|
{
|
||||||
#ifndef STATIC_OPENGL
|
#ifdef MINI_GL_COMPATIBILITY
|
||||||
#define GETOPENGLFUNC(func, proc) \
|
return false;
|
||||||
func = GetGLFunc(#proc); \
|
#else
|
||||||
if (!func) \
|
#ifdef STATIC_OPENGL
|
||||||
{ \
|
gl13 = true;
|
||||||
DBG_Printf("failed to get OpenGL function: %s", #proc); \
|
#else
|
||||||
} \
|
|
||||||
|
|
||||||
const char *glversion = (const char *)pglGetString(GL_VERSION);
|
const char *glversion = (const char *)pglGetString(GL_VERSION);
|
||||||
UINT32 majorversion = 0, minorversion = 0;
|
UINT32 majorversion = 0, minorversion = 0;
|
||||||
|
|
||||||
|
@ -537,18 +534,19 @@ boolean SetupGLFunc13(void)
|
||||||
if (majorversion > 1 || (majorversion == 1 && minorversion >= 3)) // Version of OpenGL is equal to or greater than 1.3
|
if (majorversion > 1 || (majorversion == 1 && minorversion >= 3)) // Version of OpenGL is equal to or greater than 1.3
|
||||||
{
|
{
|
||||||
// Get the functions
|
// Get the functions
|
||||||
GETOPENGLFUNC(pglActiveTexture , glActiveTexture)
|
pglActiveTexture = GetGLFunc("glActiveTexture");
|
||||||
GETOPENGLFUNC(pglMultiTexCoord2f , glMultiTexCoord2f)
|
pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2f");
|
||||||
|
|
||||||
gl13 = true; // This is now true, so the new fade mask stuff can be done, if OpenGL version is less than 1.3, it still uses the old fade stuff.
|
if (pglMultiTexCoord2f)
|
||||||
|
gl13 = true; // This is now true, so the new fade mask stuff can be done, if OpenGL version is less than 1.3, it still uses the old fade stuff.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#undef GETOPENGLFUNC
|
#undef GETOPENGLFUNC
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------+
|
// -----------------+
|
||||||
// SetNoTexture : Disable texture
|
// SetNoTexture : Disable texture
|
||||||
|
|
|
@ -176,6 +176,8 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
||||||
else
|
else
|
||||||
maximumAnisotropy = 1;
|
maximumAnisotropy = 1;
|
||||||
|
|
||||||
|
SetupGLFunc13();
|
||||||
|
|
||||||
granisotropicmode_cons_t[1].value = maximumAnisotropy;
|
granisotropicmode_cons_t[1].value = maximumAnisotropy;
|
||||||
|
|
||||||
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
|
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
|
||||||
|
|
|
@ -237,6 +237,8 @@ boolean OglSdlSurface(INT32 w, INT32 h, boolean isFullscreen)
|
||||||
#endif
|
#endif
|
||||||
maximumAnisotropy = 0;
|
maximumAnisotropy = 0;
|
||||||
|
|
||||||
|
SetupGLFunc13();
|
||||||
|
|
||||||
granisotropicmode_cons_t[1].value = maximumAnisotropy;
|
granisotropicmode_cons_t[1].value = maximumAnisotropy;
|
||||||
|
|
||||||
SetModelView(w, h);
|
SetModelView(w, h);
|
||||||
|
|
Loading…
Reference in a new issue