Use OpenGL 1.3 in static builds and on SDL interfaces

This commit is contained in:
Alam Ed Arias 2014-11-02 01:11:37 -05:00
parent 9d1da548aa
commit 6d773c54a5
4 changed files with 15 additions and 16 deletions

View file

@ -366,10 +366,7 @@ static INT32 WINAPI SetRes(viddef_t *lvid, vmode_t *pcurrentmode)
else
maximumAnisotropy = 0;
#ifndef MINI_GL_COMPATIBILITY
SetupGLFunc13();
#endif
screen_depth = (GLbyte)(lvid->bpp*8);
if (screen_depth > 16)

View file

@ -517,18 +517,15 @@ boolean SetupGLfunc(void)
return true;
}
#ifndef MINI_GL_COMPATIBILITY
// This has to be done after the context is created so the version number can be obtained
boolean SetupGLFunc13(void)
{
#ifndef STATIC_OPENGL
#define GETOPENGLFUNC(func, proc) \
func = GetGLFunc(#proc); \
if (!func) \
{ \
DBG_Printf("failed to get OpenGL function: %s", #proc); \
} \
#ifdef MINI_GL_COMPATIBILITY
return false;
#else
#ifdef STATIC_OPENGL
gl13 = true;
#else
const char *glversion = (const char *)pglGetString(GL_VERSION);
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
{
// Get the functions
GETOPENGLFUNC(pglActiveTexture , glActiveTexture)
GETOPENGLFUNC(pglMultiTexCoord2f , glMultiTexCoord2f)
pglActiveTexture = GetGLFunc("glActiveTexture");
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
#endif
return true;
}
#endif
}
// -----------------+
// SetNoTexture : Disable texture

View file

@ -176,6 +176,8 @@ boolean OglSdlSurface(INT32 w, INT32 h)
else
maximumAnisotropy = 1;
SetupGLFunc13();
granisotropicmode_cons_t[1].value = maximumAnisotropy;
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);

View file

@ -237,6 +237,8 @@ boolean OglSdlSurface(INT32 w, INT32 h, boolean isFullscreen)
#endif
maximumAnisotropy = 0;
SetupGLFunc13();
granisotropicmode_cons_t[1].value = maximumAnisotropy;
SetModelView(w, h);