]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
make DP run in wine again
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 31 May 2009 12:45:33 +0000 (12:45 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 31 May 2009 12:45:33 +0000 (12:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9001 d7cf8633-e32d-0410-b094-e92efae38249

vid_shared.c
vid_wgl.c

index f66cc9a6f41711010f615b5dd9531d8eacf795e1..0f215ad4abde02e706bb5e9ee2b3aa363e224a9d 100644 (file)
@@ -404,7 +404,12 @@ int GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, c
        struct { int major, minor; } min_version, curr_version;
        int ext;
 
-       ext = !(sscanf(minglver_or_ext, "%d.%d", &min_version.major, &min_version.minor) == 2);
+       if(sscanf(minglver_or_ext, "%d.%d", &min_version.major, &min_version.minor) == 2)
+               ext = 0; // opengl version
+       else if(minglver_or_ext[0] != toupper(minglver_or_ext[0]))
+               ext = -1; // pseudo name
+       else
+               ext = 1; // extension name
 
        if (ext)
                Con_DPrintf("checking for %s...  ", minglver_or_ext);
@@ -420,7 +425,7 @@ int GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, c
                return false;
        }
 
-       if (ext)
+       if (ext == 1) // opengl extension
        {
                if (!strstr(gl_extensions ? gl_extensions : "", minglver_or_ext) && !strstr(gl_platformextensions ? gl_platformextensions : "", minglver_or_ext))
                {
@@ -428,7 +433,8 @@ int GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, c
                        return false;
                }
        }
-       else
+
+       if(ext == 0) // opengl version
        {
                sscanf(gl_version, "%d.%d", &curr_version.major, &curr_version.minor);
 
index 2e02ec7b975e49dd28e3d32db3bbbae75ad76332..c714e0eb636134351f4fc7d4e58679a4bcdab432 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -1113,7 +1113,7 @@ int VID_InitMode (int fullscreen, int *width, int *height, int bpp, int refreshr
                        return false;
                }
 
-               if (!GL_CheckExtension("1.0", wglfuncs, NULL, false))
+               if (!GL_CheckExtension("wgl", wglfuncs, NULL, false))
                {
                        VID_Shutdown();
                        Con_Print("wgl functions not found\n");