From 623d5ac6ede0b855f6e9df37a41216d6f52a79f0 Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 31 May 2009 12:45:33 +0000 Subject: [PATCH] make DP run in wine again git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9001 d7cf8633-e32d-0410-b094-e92efae38249 --- vid_shared.c | 12 +++++++++--- vid_wgl.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/vid_shared.c b/vid_shared.c index f66cc9a6..0f215ad4 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -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); diff --git a/vid_wgl.c b/vid_wgl.c index 2e02ec7b..c714e0eb 100644 --- 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"); -- 2.39.2