summaryrefslogtreecommitdiff
path: root/src/sdl
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-26 00:10:07 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:05 +0000
commit0fed3b1c32d99560482ea162b197531439df76e5 (patch)
treedd5f74d3124715a538462aa474f9af294f79bbbd /src/sdl
parentaf6fd4fa5aaa4dc7c59ae54ead20d5ef0fbcc946 (diff)
* Merge ioq3-r1708
Diffstat (limited to 'src/sdl')
-rw-r--r--src/sdl/sdl_glimp.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c
index 1bbccb84..0c765b66 100644
--- a/src/sdl/sdl_glimp.c
+++ b/src/sdl/sdl_glimp.c
@@ -26,13 +26,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# include <SDL.h>
#endif
-#if !SDL_VERSION_ATLEAST(1, 2, 10)
-#define SDL_GL_ACCELERATED_VISUAL 15
-#define SDL_GL_SWAP_CONTROL 16
-#elif MINSDL_PATCH >= 10
-#error Code block no longer necessary, please remove
-#endif
-
#ifdef SMP
# ifdef USE_LOCAL_HEADERS
# include "SDL_thread.h"
@@ -155,16 +148,8 @@ static void GLimp_DetectAvailableModes(void)
SDL_Rect **modes;
int numModes;
int i;
- SDL_PixelFormat *format = NULL;
-
-#if SDL_VERSION_ATLEAST(1, 2, 10)
- format = videoInfo->vfmt;
-# if MINSDL_PATCH >= 10
-# error Ifdeffery no longer necessary, please remove
-# endif
-#endif
- modes = SDL_ListModes( format, SDL_OPENGL | SDL_FULLSCREEN );
+ modes = SDL_ListModes( videoInfo->vfmt, SDL_OPENGL | SDL_FULLSCREEN );
if( !modes )
{
@@ -225,12 +210,6 @@ static int GLimp_SetMode( qboolean failSafe, qboolean fullscreen )
if ( r_allowResize->integer )
flags |= SDL_RESIZABLE;
-#if !SDL_VERSION_ATLEAST(1, 2, 10)
- // 1.2.10 is needed to get the desktop resolution
- glConfig.displayAspect = 4.0f / 3.0f;
-#elif MINSDL_PATCH >= 10
-# error Ifdeffery no longer necessary, please remove
-#else
if( videoInfo == NULL )
{
static SDL_VideoInfo sVideoInfo;
@@ -260,7 +239,6 @@ static int GLimp_SetMode( qboolean failSafe, qboolean fullscreen )
"Cannot estimate display aspect, assuming 1.333\n" );
}
}
-#endif
if( !failSafe )
{
@@ -728,7 +706,13 @@ success:
// This values force the UI to disable driver selection
glConfig.driverType = GLDRV_ICD;
glConfig.hardwareType = GLHW_GENERIC;
- glConfig.deviceSupportsGamma = !!( SDL_SetGamma( 1.0f, 1.0f, 1.0f ) >= 0 );
+ glConfig.deviceSupportsGamma = SDL_SetGamma( 1.0f, 1.0f, 1.0f ) >= 0;
+
+ // Mysteriously, if you use an NVidia graphics card and multiple monitors,
+ // SDL_SetGamma will incorrectly return false... the first time; ask
+ // again and you get the correct answer. This is a suspected driver bug, see
+ // http://bugzilla.icculus.org/show_bug.cgi?id=4316
+ glConfig.deviceSupportsGamma = SDL_SetGamma( 1.0f, 1.0f, 1.0f ) >= 0;
// get our config strings
Q_strncpyz( glConfig.vendor_string, (char *) qglGetString (GL_VENDOR), sizeof( glConfig.vendor_string ) );