centralized GL_VENDOR/GL_RENDERER/etc printing code
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 7 May 2008 23:45:21 +0000 (23:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 7 May 2008 23:45:21 +0000 (23:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8282 d7cf8633-e32d-0410-b094-e92efae38249

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

index 6d2c23b..049c6bd 100644 (file)
@@ -2348,6 +2348,22 @@ GL_Init
 extern char *ENGINE_EXTENSIONS;
 void GL_Init (void)
 {
+       gl_renderer = (const char *)qglGetString(GL_RENDERER);
+       gl_vendor = (const char *)qglGetString(GL_VENDOR);
+       gl_version = (const char *)qglGetString(GL_VERSION);
+       gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
+
+       if (!gl_extensions)
+               gl_extensions = "";
+       if (!gl_platformextensions)
+               gl_platformextensions = "";
+
+       Con_Printf("GL_VENDOR: %s\n", gl_vendor);
+       Con_Printf("GL_RENDERER: %s\n", gl_renderer);
+       Con_Printf("GL_VERSION: %s\n", gl_version);
+       Con_Printf("GL_EXTENSIONS: %s\n", gl_extensions);
+       Con_Printf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
+
        VID_CheckExtensions();
 
        // LordHavoc: report supported extensions
@@ -4054,7 +4070,7 @@ static void R_DrawEntityBBoxes(void)
        // this function draws bounding boxes of server entities
        if (!sv.active)
                return;
-       
+
        prog = 0;
        SV_VM_Begin();
        for (i = 0;i < prog->num_edicts;i++)
index 984219b..5de1a3e 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -703,25 +703,10 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
        if ((qglGetString = (const GLubyte* (GLAPIENTRY *)(GLenum name))GL_GetProcAddress("glGetString")) == NULL)
                Sys_Error("glGetString not found in %s", gl_driver);
 
-       gl_renderer = (const char *)qglGetString(GL_RENDERER);
-       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);
-       Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions);
-       Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
-
        multithreadedgl = false;
        vid_isfullscreen = fullscreen;
        vid_usingmouse = false;
index e10cccf..199d8ea 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -857,24 +857,10 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
                return false;
        }
 
-       gl_renderer = (const char *)qglGetString(GL_RENDERER);
-       gl_vendor = (const char *)qglGetString(GL_VENDOR);
-       gl_version = (const char *)qglGetString(GL_VERSION);
        gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
        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);
-       Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions);
-       Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
-
        gl_videosyncavailable = false;
 
 // COMMANDLINEOPTION: Linux GLX: -nogetprocaddress disables GLX_ARB_get_proc_address (not required, more formal method of getting extension functions)
index ebea686..01381a3 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -732,26 +732,9 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
        // enable key repeat since everyone expects it
        SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
 
-       gl_renderer = (const char *)qglGetString(GL_RENDERER);
-       gl_vendor = (const char *)qglGetString(GL_VENDOR);
-       gl_version = (const char *)qglGetString(GL_VERSION);
-       gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
        gl_platform = "SDL";
-       // Knghtbrd: should assign platform-specific extensions here
-       //TODO: maybe ;)
        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);
-       Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions);
-       Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
+       gl_videosyncavailable = true;
 
        GL_Init();
 
index 3884cb0..df392e9 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -1158,9 +1158,6 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrat
                if ((qwglGetExtensionsStringARB = (const char *(WINAPI *)(HDC hdc))GL_GetProcAddress("wglGetExtensionsStringARB")) == NULL)
                        Con_Print("wglGetExtensionsStringARB not found\n");
 
-               gl_renderer = (const char *)qglGetString(GL_RENDERER);
-               gl_vendor = (const char *)qglGetString(GL_VENDOR);
-               gl_version = (const char *)qglGetString(GL_VERSION);
                gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
                gl_platform = "WGL";
                gl_platformextensions = "";
@@ -1196,12 +1193,6 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrat
                }
        }
 
-       Con_DPrintf("GL_VENDOR: %s\n", gl_vendor);
-       Con_DPrintf("GL_RENDERER: %s\n", gl_renderer);
-       Con_DPrintf("GL_VERSION: %s\n", gl_version);
-       Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions);
-       Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
-
        /*
        if (!fullscreen)
                SetWindowPos (mainwindow, NULL, CenterX, CenterY, 0, 0,SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW | SWP_DRAWFRAME);