diff --git a/src/hardware/r_opengl/ogl_win.c b/src/hardware/r_opengl/ogl_win.c index bfdc96d6a5322e4e41ca91e6d2f3d785238decf3..5cc075ceae75bb13b50fba1e0bed4e541aa6c922 100644 --- a/src/hardware/r_opengl/ogl_win.c +++ b/src/hardware/r_opengl/ogl_win.c @@ -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) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index c136d06344ace5c0fe0d80826119c4bafd169d63..0f0f7e0148c166404bc80375d7b58cbea695602a 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -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 diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index 62055e10401e3b32cf0a4a34ba9c7f5a4bf9da2b..6cbecaf3c87937b9b3911ba6759f8fc2a4f7d5a0 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -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); diff --git a/src/sdl12/ogl_sdl.c b/src/sdl12/ogl_sdl.c index e726bf07dd06370efd4aad22a0f45105f24c9f33..eb7e9996dba228f1f626670705e52220c18df670 100644 --- a/src/sdl12/ogl_sdl.c +++ b/src/sdl12/ogl_sdl.c @@ -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);