Skip to content
Browse files

Add SDL2 support to framework/Common.cpp

  • Loading branch information...
1 parent 918e06c commit 227e8ee5c9fc054b8b8d6422c50638393eecf9ac @dhewg dhewg committed Jul 20, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 neo/framework/Common.cpp
View
4 neo/framework/Common.cpp
@@ -2726,9 +2726,13 @@ void idCommonLocal::Init( int argc, char **argv ) {
// we want to use the SDL event queue for dedicated servers. That
// requires video to be initialized, so we just use the dummy
// driver for headless boxen
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ SDL_setenv("SDL_VIDEODRIVER", "dummy", 1);
+#else
char dummy[] = "SDL_VIDEODRIVER=dummy\0";
SDL_putenv(dummy);
#endif
+#endif
if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO))
Sys_Error("Error while initializing SDL: %s", SDL_GetError());

0 comments on commit 227e8ee

Please sign in to comment.
Something went wrong with that request. Please try again.