From c10a8df32742ec46bf2b8f3a154c9ebb554a1f70 Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 13 Jun 2011 18:28:06 +0000 Subject: [PATCH] fix detection of multisampling for ATC git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11197 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=67046d5bb087c89301a4a645a5f294fe2c4da207 --- vid_shared.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/vid_shared.c b/vid_shared.c index 4539f9d8..c34f1c82 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -1085,7 +1085,7 @@ void VID_CheckExtensions(void) Con_Printf("vid.support.arb_multisample %i\n", vid.support.arb_multisample); Con_Printf("vid.mode.samples %i\n", vid.mode.samples); Con_Printf("vid.support.gl20shaders %i\n", vid.support.gl20shaders); - vid.allowalphatocoverage = vid.support.arb_multisample && vid_samples.integer > 1 && vid.support.gl20shaders; + vid.allowalphatocoverage = true; // but see below, it may get turned to false again if GL_SAMPLES_ARB is <= 1 } else if (vid.support.arb_texture_env_combine && vid.texunits >= 2 && vid_gl13.integer) { @@ -1110,9 +1110,19 @@ void VID_CheckExtensions(void) vid.sRGBcapable3D = false; vid.useinterleavedarrays = false; } + // enable multisample antialiasing if possible - if (vid_samples.integer > 1 && vid.support.arb_multisample) - qglEnable(GL_MULTISAMPLE_ARB); + if(vid.support.arb_multisample) + { + int samples = 0; + qglGetIntegerv(GL_SAMPLES_ARB, &samples); + if (samples > 1) + qglEnable(GL_MULTISAMPLE_ARB); + else + vid.allowalphatocoverage = false; + } + else + vid.allowalphatocoverage = false; // VorteX: set other info (maybe place them in VID_InitMode?) Cvar_SetQuick(&gl_info_vendor, gl_vendor); -- 2.39.2