]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Change GLX visual acquisition to also try without sample buffers if samples == 1...
authorres <res@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 26 Feb 2008 11:27:24 +0000 (11:27 +0000)
committerres <res@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 26 Feb 2008 11:27:24 +0000 (11:27 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8136 d7cf8633-e32d-0410-b094-e92efae38249

vid_glx.c
vid_shared.c

index ff98510818116e663898d39b73ba7d81776ae714..d51318a6377f2621331cf9ecab38888424c167b8 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -702,6 +702,13 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
 
        VID_BuildGLXAttrib(attrib, bpp == 32, stereobuffer, samples);
        visinfo = qglXChooseVisual(vidx11_display, vidx11_screen, attrib);
+       if (!visinfo && (samples == 1))
+       {
+                /* Some Mesa drivers reject sample buffers with 1 sample, so try
+                 * entirely without one */
+               VID_BuildGLXAttrib(attrib, bpp == 32, stereobuffer, 0);
+               visinfo = qglXChooseVisual(vidx11_display, vidx11_screen, attrib);
+       }
        if (!visinfo)
        {
                Con_Print("Couldn't get an RGB, Double-buffered, Depth visual\n");
index 14498edfc0e1fc32e91825e3965ee6fe135f5143..aaea23c0a45c746fb9bf15e1b9e3a3e8edcbb7b5 100644 (file)
@@ -1068,7 +1068,7 @@ void VID_Shared_Init(void)
 int VID_Mode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer, int samples)
 {
        cl_ignoremousemoves = 2;
-       Con_Printf("Initialized Video Mode: %s %dx%dx%dx%dhz%s%s\n", fullscreen ? "fullscreen" : "window", width, height, bpp, refreshrate, stereobuffer ? " stereo" : "", samples > 1 ? va(" (%ix AA)", samples) : "");
+       Con_Printf("Initializing Video Mode: %s %dx%dx%dx%dhz%s%s\n", fullscreen ? "fullscreen" : "window", width, height, bpp, refreshrate, stereobuffer ? " stereo" : "", samples > 1 ? va(" (%ix AA)", samples) : "");
        if (VID_InitMode(fullscreen, width, height, bpp, vid_userefreshrate.integer ? max(1, refreshrate) : 0, stereobuffer, samples))
        {
                vid.fullscreen = fullscreen;