]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_glx.c
this should fix some Solaris/NetBSD/OpenBSD compile problems, model_t still remaining
[xonotic/darkplaces.git] / vid_glx.c
index d51318a6377f2621331cf9ecab38888424c167b8..e10cccfeb7929498c6e8d2529883b83128ee1cd1 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -89,7 +89,6 @@ Atom wm_delete_window_atom;
 
 static qboolean mouse_avail = true;
 static qboolean vid_usingmouse = false;
-static qboolean vid_usingdgamouse = false;
 static qboolean vid_usingvsync = false;
 static qboolean vid_usevsync = false;
 static qboolean vid_x11_hardwaregammasupported = false;
@@ -100,6 +99,7 @@ static int p_mouse_x, p_mouse_y;
 
 #if !defined(__APPLE__) && !defined(SUNOS)
 cvar_t vid_dgamouse = {CVAR_SAVE, "vid_dgamouse", "1", "make use of DGA mouse input"};
+static qboolean vid_usingdgamouse = false;
 #endif
 
 qboolean vidmode_ext = false;
@@ -289,7 +289,9 @@ static void IN_Activate (qboolean grab)
                        mouse_x = mouse_y = 0;
                        cl_ignoremousemoves = 2;
                        vid_usingmouse = true;
+#if !defined(__APPLE__) && !defined(SUNOS)
                        vid_usingdgamouse = !!vid_dgamouse.integer;
+#endif
                }
        }
        else
@@ -616,20 +618,20 @@ void VID_Init(void)
 void VID_BuildGLXAttrib(int *attrib, qboolean stencil, qboolean stereobuffer, int samples)
 {
        *attrib++ = GLX_RGBA;
-       *attrib++ = GLX_RED_SIZE;*attrib++ = 1;
-       *attrib++ = GLX_GREEN_SIZE;*attrib++ = 1;
-       *attrib++ = GLX_BLUE_SIZE;*attrib++ = 1;
+       *attrib++ = GLX_RED_SIZE;*attrib++ = stencil ? 8 : 5;
+       *attrib++ = GLX_GREEN_SIZE;*attrib++ = stencil ? 8 : 5;
+       *attrib++ = GLX_BLUE_SIZE;*attrib++ = stencil ? 8 : 5;
        *attrib++ = GLX_DOUBLEBUFFER;
-       *attrib++ = GLX_DEPTH_SIZE;*attrib++ = 1;
+       *attrib++ = GLX_DEPTH_SIZE;*attrib++ = stencil ? 24 : 16;
        // if stencil is enabled, ask for alpha too
        if (stencil)
        {
                *attrib++ = GLX_STENCIL_SIZE;*attrib++ = 8;
-               *attrib++ = GLX_ALPHA_SIZE;*attrib++ = 1;
+               *attrib++ = GLX_ALPHA_SIZE;*attrib++ = 8;
        }
        if (stereobuffer)
                *attrib++ = GLX_STEREO;
-       if (samples)
+       if (samples > 1)
        {
                *attrib++ = GLX_SAMPLE_BUFFERS_ARB;
                *attrib++ = 1;
@@ -862,6 +864,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);