Fixed bug 1582 - Allow disabling SDL_VIDEO_DRIVER_WINDOWS
authorSam Lantinga <slouken@libsdl.org>
Thu, 25 Apr 2013 00:26:17 -0700
changeset 71102a98852fd58d
parent 7109 003d40e446f5
child 7111 f4ae9f1233df
Fixed bug 1582 - Allow disabling SDL_VIDEO_DRIVER_WINDOWS

Marcus von Appen

Trying to build SDL 2.x (HG) on Win32 platforms with either VS.NET or MinGW requires one to have the video subsystem and SDL_VIDEO_DRIVER_WINDOWS flag enabled due to the helper window creation routines.

The attached patch changes the helper window creation behaviour, so that one can build SDL2 without the video subsystem or Windows video drivers on Win32 platforms.
src/SDL.c
     1.1 --- a/src/SDL.c	Thu Apr 25 00:15:09 2013 -0700
     1.2 +++ b/src/SDL.c	Thu Apr 25 00:26:17 2013 -0700
     1.3 @@ -36,7 +36,7 @@
     1.4  extern int SDL_TimerInit(void);
     1.5  extern void SDL_TimerQuit(void);
     1.6  #endif
     1.7 -#if defined(__WIN32__)
     1.8 +#if SDL_VIDEO_DRIVER_WINDOWS
     1.9  extern int SDL_HelperWindowCreate(void);
    1.10  extern int SDL_HelperWindowDestroy(void);
    1.11  #endif
    1.12 @@ -200,7 +200,7 @@
    1.13      /* Clear the error message */
    1.14      SDL_ClearError();
    1.15  
    1.16 -#if defined(__WIN32__)
    1.17 +#if SDL_VIDEO_DRIVER_WINDOWS
    1.18      if (SDL_HelperWindowCreate() < 0) {
    1.19          return -1;
    1.20      }
    1.21 @@ -310,7 +310,7 @@
    1.22      SDL_bInMainQuit = SDL_TRUE;
    1.23  
    1.24      /* Quit all subsystems */
    1.25 -#if defined(__WIN32__)
    1.26 +#if SDL_VIDEO_DRIVER_WINDOWS
    1.27      SDL_HelperWindowDestroy();
    1.28  #endif
    1.29      SDL_QuitSubSystem(SDL_INIT_EVERYTHING);