From 3bb9f49f19be012edc46f64d060775b1d0310173 Mon Sep 17 00:00:00 2001 From: svdijk Date: Thu, 1 May 2014 20:52:25 +0200 Subject: [PATCH] videomenu: readd 16x MSAA option, check what we got after setting mode. --- src/backends/sdl/refresh.c | 11 +++++++++-- src/client/menu/videomenu.c | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backends/sdl/refresh.c b/src/backends/sdl/refresh.c index 9b548d6c..b435dd68 100644 --- a/src/backends/sdl/refresh.c +++ b/src/backends/sdl/refresh.c @@ -545,14 +545,14 @@ GLimp_InitGraphics(qboolean fullscreen) { msaa_samples = gl_msaa_samples->value; - if (SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1) == -1) + if (SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1) < 0) { Com_Printf("MSAA is unsupported: %s\n", SDL_GetError()); Cvar_SetValue ("gl_msaa_samples", 0); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0); } - else if (SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, msaa_samples) == -1) + else if (SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, msaa_samples) < 0) { Com_Printf("MSAA %ix is unsupported: %s\n", msaa_samples, SDL_GetError()); Cvar_SetValue("gl_msaa_samples", 0); @@ -620,6 +620,13 @@ GLimp_InitGraphics(qboolean fullscreen) break; } } + if (gl_msaa_samples->value) + { + if (SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &msaa_samples) == 0) + { + Cvar_SetValue("gl_msaa_samples", msaa_samples); + } + } #if SDL_VERSION_ATLEAST(2, 0, 0) /* For SDL2, these things must be done after creating the window */ diff --git a/src/client/menu/videomenu.c b/src/client/menu/videomenu.c index c966576e..2ace1d35 100644 --- a/src/client/menu/videomenu.c +++ b/src/client/menu/videomenu.c @@ -250,6 +250,7 @@ VID_MenuInit(void) "2x", "4x", "8x", + "16x", 0 };