]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
Multisampling initialisation moved from vid_sdl to gl_backend. Make cubemaps array...
[xonotic/darkplaces.git] / vid_shared.c
index aad8446ee4d76714ff714ff6bc0db196dbb66cdf..6f79d4d19f0dd41043e147a3e413b57acc894a13 100644 (file)
@@ -1304,6 +1304,15 @@ void VID_Shared_Init(void)
 int VID_Mode(int fullscreen, int width, int height, int bpp, float refreshrate, int stereobuffer, int samples)
 {
        viddef_mode_t mode;
+
+       // multisampling should set at least 2 samples
+       if (vid.support.arb_multisample)
+       {
+               GL_MultiSampling(false);
+               if (vid_multisampling.integer)
+                       samples = max(2, samples);
+       }
+
        memset(&mode, 0, sizeof(mode));
        mode.fullscreen = fullscreen != 0;
        mode.width = width;
@@ -1342,6 +1351,10 @@ int VID_Mode(int fullscreen, int width, int height, int bpp, float refreshrate,
                        Cvar_SetValueQuick(&vid_refreshrate, vid.mode.refreshrate);
                Cvar_SetValueQuick(&vid_stereobuffer, vid.mode.stereobuffer);
 
+               // activate multisampling
+               if (vid_multisampling.integer)
+                       GL_MultiSampling(true);
+
                return true;
        }
        else