make sure that gl_extensions and gl_platformextensions are not NULL
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 1 Mar 2008 06:34:17 +0000 (06:34 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 1 Mar 2008 06:34:17 +0000 (06:34 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8167 d7cf8633-e32d-0410-b094-e92efae38249

vid_agl.c
vid_glx.c
vid_sdl.c
vid_wgl.c

index a3a65f2..984219b 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -707,9 +707,15 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
        gl_vendor = (const char *)qglGetString(GL_VENDOR);
        gl_version = (const char *)qglGetString(GL_VERSION);
        gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
+       gl_platformextensions = "";
        gl_platform = "AGL";
        gl_videosyncavailable = true;
 
+       if (!gl_extensions)
+               gl_extensions = "";
+       if (!gl_platformextensions)
+               gl_platformextensions = "";
+
        Con_DPrintf("GL_VENDOR: %s\n", gl_vendor);
        Con_DPrintf("GL_RENDERER: %s\n", gl_renderer);
        Con_DPrintf("GL_VERSION: %s\n", gl_version);
index 426e4cf..fb011d1 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -862,6 +862,11 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
        gl_platform = "GLX";
        gl_platformextensions = qglXQueryExtensionsString(vidx11_display, vidx11_screen);
 
+       if (!gl_extensions)
+               gl_extensions = "";
+       if (!gl_platformextensions)
+               gl_platformextensions = "";
+
        Con_DPrintf("GL_VENDOR: %s\n", gl_vendor);
        Con_DPrintf("GL_RENDERER: %s\n", gl_renderer);
        Con_DPrintf("GL_VERSION: %s\n", gl_version);
index 872f8cf..3654b44 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -742,6 +742,11 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
        gl_platformextensions = "";
        gl_videosyncavailable = false;
 
+       if (!gl_extensions)
+               gl_extensions = "";
+       if (!gl_platformextensions)
+               gl_platformextensions = "";
+
        Con_DPrintf("GL_VENDOR: %s\n", gl_vendor);
        Con_DPrintf("GL_RENDERER: %s\n", gl_renderer);
        Con_DPrintf("GL_VERSION: %s\n", gl_version);
index 7430804..42557a9 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -1164,6 +1164,11 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrat
                if (qwglGetExtensionsStringARB)
                        gl_platformextensions = (const char *)qwglGetExtensionsStringARB(baseDC);
 
+               if (!gl_extensions)
+                       gl_extensions = "";
+               if (!gl_platformextensions)
+                       gl_platformextensions = "";
+
                // now some nice Windows pain:
                // we have created a window, we needed one to find out if there are
                // any multisample pixel formats available, the problem is that to