Fixed bug #1100
authorSam Lantinga <slouken@libsdl.org>
Mon, 24 Jan 2011 17:38:18 -0800
changeset 5088455bc74f7034
parent 5087 b4b0e9f1669c
child 5089 79bd1e289005
Fixed bug #1100

Test the video features with #if instead of #ifdef
include/SDL_config_macosx.h
include/SDL_config_windows.h
src/video/cocoa/SDL_cocoavideo.m
src/video/windows/SDL_windowsvideo.c
src/video/windows/SDL_windowswindow.c
src/video/x11/SDL_x11video.c
src/video/x11/SDL_x11window.c
     1.1 --- a/include/SDL_config_macosx.h	Mon Jan 24 16:10:13 2011 -0800
     1.2 +++ b/include/SDL_config_macosx.h	Mon Jan 24 17:38:18 2011 -0800
     1.3 @@ -148,13 +148,23 @@
     1.4  #define SDL_VIDEO_DRIVER_X11_XV 1
     1.5  #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
     1.6  
     1.7 +#ifndef SDL_VIDEO_RENDER_OGL
     1.8  #define SDL_VIDEO_RENDER_OGL	1
     1.9 +#endif
    1.10 +#ifndef SDL_VIDEO_RENDER_X11
    1.11  #define SDL_VIDEO_RENDER_X11	1
    1.12 +#endif
    1.13  
    1.14  /* Enable OpenGL support */
    1.15 +#ifndef SDL_VIDEO_OPENGL
    1.16  #define SDL_VIDEO_OPENGL	1
    1.17 +#endif
    1.18 +#ifndef SDL_VIDEO_OPENGL_CGL
    1.19  #define SDL_VIDEO_OPENGL_CGL	1
    1.20 +#endif
    1.21 +#ifndef SDL_VIDEO_OPENGL_GLX
    1.22  #define SDL_VIDEO_OPENGL_GLX	1
    1.23 +#endif
    1.24  
    1.25  /* Enable system power support */
    1.26  #define SDL_POWER_MACOSX 1
     2.1 --- a/include/SDL_config_windows.h	Mon Jan 24 16:10:13 2011 -0800
     2.2 +++ b/include/SDL_config_windows.h	Mon Jan 24 17:38:18 2011 -0800
     2.3 @@ -179,18 +179,30 @@
     2.4  #define SDL_VIDEO_DRIVER_WINDOWS	1
     2.5  
     2.6  #ifdef _WIN32_WCE
     2.7 +#ifndef SDL_VIDEO_RENDER_GAPI
     2.8  #define SDL_VIDEO_RENDER_GAPI	1
     2.9 +#endif
    2.10  #else
    2.11 +#ifndef SDL_VIDEO_RENDER_D3D
    2.12  #define SDL_VIDEO_RENDER_D3D	1
    2.13  #endif
    2.14 +#endif
    2.15 +#ifndef SDL_VIDEO_RENDER_GDI
    2.16  #define SDL_VIDEO_RENDER_GDI	1
    2.17 +#endif
    2.18  
    2.19  /* Enable OpenGL support */
    2.20  #ifndef _WIN32_WCE
    2.21 +#ifndef SDL_VIDEO_OPENGL
    2.22  #define SDL_VIDEO_OPENGL	1
    2.23 +#endif
    2.24 +#ifndef SDL_VIDEO_OPENGL_WGL
    2.25  #define SDL_VIDEO_OPENGL_WGL	1
    2.26 +#endif
    2.27 +#ifndef SDL_VIDEO_RENDER_OGL
    2.28  #define SDL_VIDEO_RENDER_OGL	1
    2.29  #endif
    2.30 +#endif
    2.31  
    2.32  /* Enable system power support */
    2.33  #define SDL_POWER_WINDOWS 1
     3.1 --- a/src/video/cocoa/SDL_cocoavideo.m	Mon Jan 24 16:10:13 2011 -0800
     3.2 +++ b/src/video/cocoa/SDL_cocoavideo.m	Mon Jan 24 17:38:18 2011 -0800
     3.3 @@ -98,7 +98,7 @@
     3.4      device->shape_driver.SetWindowShape = Cocoa_SetWindowShape;
     3.5      device->shape_driver.ResizeWindowShape = Cocoa_ResizeWindowShape;
     3.6      
     3.7 -#ifdef SDL_VIDEO_OPENGL_CGL
     3.8 +#if SDL_VIDEO_OPENGL_CGL
     3.9      device->GL_LoadLibrary = Cocoa_GL_LoadLibrary;
    3.10      device->GL_GetProcAddress = Cocoa_GL_GetProcAddress;
    3.11      device->GL_UnloadLibrary = Cocoa_GL_UnloadLibrary;
     4.1 --- a/src/video/windows/SDL_windowsvideo.c	Mon Jan 24 16:10:13 2011 -0800
     4.2 +++ b/src/video/windows/SDL_windowsvideo.c	Mon Jan 24 17:38:18 2011 -0800
     4.3 @@ -197,7 +197,7 @@
     4.4      device->shape_driver.SetWindowShape = Win32_SetWindowShape;
     4.5      device->shape_driver.ResizeWindowShape = Win32_ResizeWindowShape;
     4.6      
     4.7 -#ifdef SDL_VIDEO_OPENGL_WGL
     4.8 +#if SDL_VIDEO_OPENGL_WGL
     4.9      device->GL_LoadLibrary = WIN_GL_LoadLibrary;
    4.10      device->GL_GetProcAddress = WIN_GL_GetProcAddress;
    4.11      device->GL_UnloadLibrary = WIN_GL_UnloadLibrary;
     5.1 --- a/src/video/windows/SDL_windowswindow.c	Mon Jan 24 16:10:13 2011 -0800
     5.2 +++ b/src/video/windows/SDL_windowswindow.c	Mon Jan 24 17:38:18 2011 -0800
     5.3 @@ -243,7 +243,7 @@
     5.4          DestroyWindow(hwnd);
     5.5          return -1;
     5.6      }
     5.7 -#ifdef SDL_VIDEO_OPENGL_WGL
     5.8 +#if SDL_VIDEO_OPENGL_WGL
     5.9      if (window->flags & SDL_WINDOW_OPENGL) {
    5.10          if (WIN_GL_SetupWindow(_this, window) < 0) {
    5.11              WIN_DestroyWindow(_this, window);
     6.1 --- a/src/video/x11/SDL_x11video.c	Mon Jan 24 16:10:13 2011 -0800
     6.2 +++ b/src/video/x11/SDL_x11video.c	Mon Jan 24 17:38:18 2011 -0800
     6.3 @@ -209,7 +209,7 @@
     6.4      device->shape_driver.CreateShaper = X11_CreateShaper;
     6.5      device->shape_driver.SetWindowShape = X11_SetWindowShape;
     6.6      device->shape_driver.ResizeWindowShape = X11_ResizeWindowShape;
     6.7 -#ifdef SDL_VIDEO_OPENGL_GLX
     6.8 +#if SDL_VIDEO_OPENGL_GLX
     6.9      device->GL_LoadLibrary = X11_GL_LoadLibrary;
    6.10      device->GL_GetProcAddress = X11_GL_GetProcAddress;
    6.11      device->GL_UnloadLibrary = X11_GL_UnloadLibrary;
     7.1 --- a/src/video/x11/SDL_x11window.c	Mon Jan 24 16:10:13 2011 -0800
     7.2 +++ b/src/video/x11/SDL_x11window.c	Mon Jan 24 17:38:18 2011 -0800
     7.3 @@ -288,7 +288,7 @@
     7.4      }
     7.5  */
     7.6  #endif
     7.7 -#ifdef SDL_VIDEO_OPENGL_GLX
     7.8 +#if SDL_VIDEO_OPENGL_GLX
     7.9      if (window->flags & SDL_WINDOW_OPENGL) {
    7.10          XVisualInfo *vinfo;
    7.11