]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
sys: Initialize the memory subsystem in main()
[xonotic/darkplaces.git] / vid_shared.c
index 7de32d120ed1fcca35ab884de54ec77b2e11b0bc..0e523ed55229ad137553b5fe90e4e3a231caf7cf 100644 (file)
@@ -655,6 +655,7 @@ qboolean GL_CheckExtension(const char *name, const char *disableparm, int silent
                return false;
        }
 
+#ifndef USE_GLES2
        for (func = openglfuncs; func && func->name != NULL; func++)
        {
                if (!*func->funcvariable && !strcmp(name, func->extension))
@@ -664,6 +665,7 @@ qboolean GL_CheckExtension(const char *name, const char *disableparm, int silent
                        failed = true;
                }
        }
+#endif //USE_GLES2
        // delay the return so it prints all missing functions
        if (failed)
                return false;
@@ -687,6 +689,8 @@ void VID_ClearExtensions(void)
 void GL_Setup(void)
 {
        char *s;
+       int j;
+       GLint numextensions = 0;
        const glfunction_t *func;
        qboolean missingrequiredfuncs = false;
        static char missingfuncs[16384];
@@ -705,19 +709,18 @@ void GL_Setup(void)
        Con_Printf("GL_RENDERER: %s\n", gl_renderer);
        Con_Printf("GL_VERSION: %s\n", gl_version);
 
-       if (developer.integer)
+#ifndef USE_GLES2
+       qglGetIntegerv(GL_NUM_EXTENSIONS, &numextensions);
+       Con_DPrint("GL_EXTENSIONS:\n");
+       for (j = 0; j < numextensions; j++)
        {
-               int j;
-               GLint numextensions = 0;
-               qglGetIntegerv(GL_NUM_EXTENSIONS, &numextensions);
-               Con_DPrint("GL_EXTENSIONS:");
-               for (j = 0; j < numextensions; j++)
-               {
-                       const char *ext = (const char *)qglGetStringi(GL_EXTENSIONS, j);
-                       Con_DPrintf(" %s", ext);
-               }
-               Con_DPrint("\n");
+               const char *ext = (const char *)qglGetStringi(GL_EXTENSIONS, j);
+               Con_DPrintf(" %s", ext);
+               if(j && !(j % 3))
+                       Con_DPrintf("\n");
        }
+       Con_DPrint("\n");
+#endif //USE_GLES2
 
 #ifndef USE_GLES2
        missingfuncs[0] = 0;
@@ -745,7 +748,7 @@ void GL_Setup(void)
                vid.support.glshaderversion = (int)(atof(s) * 100.0f + 0.5f);
        if (vid.support.glshaderversion < 100)
                vid.support.glshaderversion = 100;
-       Con_DPrintf("Detected GLSL #version %i\n", vid.support.glshaderversion);
+       Con_Printf("Detected GLSL version %i\n", vid.support.glshaderversion);
 
 #ifdef USE_GLES2
        // GLES devices in general do not like GL_BGRA, so use GL_RGBA
@@ -800,12 +803,12 @@ void GL_Setup(void)
        CHECKGLERROR
 
 #ifdef USE_GLES2
-       Con_DPrint("Using GLES2 rendering path\n");
+       Con_Print("Using GLES2 rendering path\n");
        vid.renderpath = RENDERPATH_GLES2;
        vid.sRGBcapable2D = false;
        vid.sRGBcapable3D = false;
 #else
-       Con_DPrint("Using GL32 rendering path\n");
+       Con_Print("Using GL32 rendering path\n");
        vid.renderpath = RENDERPATH_GL32;
        vid.sRGBcapable2D = false;
        vid.sRGBcapable3D = true;
@@ -1508,24 +1511,24 @@ void VID_Start(void)
                // interpret command-line parameters
                vid_commandlinecheck = false;
 // COMMANDLINEOPTION: Video: -window performs +vid_fullscreen 0
-               if (COM_CheckParm("-window") || COM_CheckParm("-safe") || (i = COM_CheckParm("+vid_fullscreen") != 0 && atoi(sys.argv[i+1]) == 0))
+               if (COM_CheckParm("-window") || COM_CheckParm("-safe") || ((i = COM_CheckParm("+vid_fullscreen")) != 0 && atoi(sys.argv[i+1]) == 0))
                        Cvar_SetValueQuick(&vid_fullscreen, false);
 // COMMANDLINEOPTION: Video: -borderless performs +vid_borderless 1
-               if (COM_CheckParm("-borderless") || (i = COM_CheckParm("+vid_borderless") != 0 && atoi(sys.argv[i+1]) == 1))
+               if (COM_CheckParm("-borderless") || ((i = COM_CheckParm("+vid_borderless")) != 0 && atoi(sys.argv[i+1]) == 1))
                {
                        Cvar_SetValueQuick(&vid_borderless, true);
                        Cvar_SetValueQuick(&vid_fullscreen, false);
                }
 // COMMANDLINEOPTION: Video: -fullscreen performs +vid_fullscreen 1
-               if (COM_CheckParm("-fullscreen") || (i = COM_CheckParm("+vid_fullscreen") != 0 && atoi(sys.argv[i+1]) == 1))
+               if (COM_CheckParm("-fullscreen") || ((i = COM_CheckParm("+vid_fullscreen")) != 0 && atoi(sys.argv[i+1]) == 1))
                        Cvar_SetValueQuick(&vid_fullscreen, true);
                width = 0;
                height = 0;
 // COMMANDLINEOPTION: Video: -width <pixels> performs +vid_width <pixels> and also +vid_height <pixels*3/4> if only -width is specified (example: -width 1024 sets 1024x768 mode)
-               if ((i = COM_CheckParm("-width")) != 0 || (i = COM_CheckParm("+vid_width") != 0))
+               if ((i = COM_CheckParm("-width")) != 0 || ((i = COM_CheckParm("+vid_width")) != 0))
                        width = atoi(sys.argv[i+1]);
 // COMMANDLINEOPTION: Video: -height <pixels> performs +vid_height <pixels> and also +vid_width <pixels*4/3> if only -height is specified (example: -height 768 sets 1024x768 mode)
-               if ((i = COM_CheckParm("-height")) != 0 || (i = COM_CheckParm("+vid_height") != 0))
+               if ((i = COM_CheckParm("-height")) != 0 || ((i = COM_CheckParm("+vid_height")) != 0))
                        height = atoi(sys.argv[i+1]);
                if (width == 0)
                        width = height * 4 / 3;