Fixed bug #1100
authorSam Lantinga <slouken@libsdl.org>
Mon, 24 Jan 2011 17:38:18 -0800
changeset 5088 455bc74f7034
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
--- a/include/SDL_config_macosx.h	Mon Jan 24 16:10:13 2011 -0800
+++ b/include/SDL_config_macosx.h	Mon Jan 24 17:38:18 2011 -0800
@@ -148,13 +148,23 @@
 #define SDL_VIDEO_DRIVER_X11_XV 1
 #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
 
+#ifndef SDL_VIDEO_RENDER_OGL
 #define SDL_VIDEO_RENDER_OGL	1
+#endif
+#ifndef SDL_VIDEO_RENDER_X11
 #define SDL_VIDEO_RENDER_X11	1
+#endif
 
 /* Enable OpenGL support */
+#ifndef SDL_VIDEO_OPENGL
 #define SDL_VIDEO_OPENGL	1
+#endif
+#ifndef SDL_VIDEO_OPENGL_CGL
 #define SDL_VIDEO_OPENGL_CGL	1
+#endif
+#ifndef SDL_VIDEO_OPENGL_GLX
 #define SDL_VIDEO_OPENGL_GLX	1
+#endif
 
 /* Enable system power support */
 #define SDL_POWER_MACOSX 1
--- a/include/SDL_config_windows.h	Mon Jan 24 16:10:13 2011 -0800
+++ b/include/SDL_config_windows.h	Mon Jan 24 17:38:18 2011 -0800
@@ -179,18 +179,30 @@
 #define SDL_VIDEO_DRIVER_WINDOWS	1
 
 #ifdef _WIN32_WCE
+#ifndef SDL_VIDEO_RENDER_GAPI
 #define SDL_VIDEO_RENDER_GAPI	1
+#endif
 #else
+#ifndef SDL_VIDEO_RENDER_D3D
 #define SDL_VIDEO_RENDER_D3D	1
 #endif
+#endif
+#ifndef SDL_VIDEO_RENDER_GDI
 #define SDL_VIDEO_RENDER_GDI	1
+#endif
 
 /* Enable OpenGL support */
 #ifndef _WIN32_WCE
+#ifndef SDL_VIDEO_OPENGL
 #define SDL_VIDEO_OPENGL	1
+#endif
+#ifndef SDL_VIDEO_OPENGL_WGL
 #define SDL_VIDEO_OPENGL_WGL	1
+#endif
+#ifndef SDL_VIDEO_RENDER_OGL
 #define SDL_VIDEO_RENDER_OGL	1
 #endif
+#endif
 
 /* Enable system power support */
 #define SDL_POWER_WINDOWS 1
--- a/src/video/cocoa/SDL_cocoavideo.m	Mon Jan 24 16:10:13 2011 -0800
+++ b/src/video/cocoa/SDL_cocoavideo.m	Mon Jan 24 17:38:18 2011 -0800
@@ -98,7 +98,7 @@
     device->shape_driver.SetWindowShape = Cocoa_SetWindowShape;
     device->shape_driver.ResizeWindowShape = Cocoa_ResizeWindowShape;
     
-#ifdef SDL_VIDEO_OPENGL_CGL
+#if SDL_VIDEO_OPENGL_CGL
     device->GL_LoadLibrary = Cocoa_GL_LoadLibrary;
     device->GL_GetProcAddress = Cocoa_GL_GetProcAddress;
     device->GL_UnloadLibrary = Cocoa_GL_UnloadLibrary;
--- a/src/video/windows/SDL_windowsvideo.c	Mon Jan 24 16:10:13 2011 -0800
+++ b/src/video/windows/SDL_windowsvideo.c	Mon Jan 24 17:38:18 2011 -0800
@@ -197,7 +197,7 @@
     device->shape_driver.SetWindowShape = Win32_SetWindowShape;
     device->shape_driver.ResizeWindowShape = Win32_ResizeWindowShape;
     
-#ifdef SDL_VIDEO_OPENGL_WGL
+#if SDL_VIDEO_OPENGL_WGL
     device->GL_LoadLibrary = WIN_GL_LoadLibrary;
     device->GL_GetProcAddress = WIN_GL_GetProcAddress;
     device->GL_UnloadLibrary = WIN_GL_UnloadLibrary;
--- a/src/video/windows/SDL_windowswindow.c	Mon Jan 24 16:10:13 2011 -0800
+++ b/src/video/windows/SDL_windowswindow.c	Mon Jan 24 17:38:18 2011 -0800
@@ -243,7 +243,7 @@
         DestroyWindow(hwnd);
         return -1;
     }
-#ifdef SDL_VIDEO_OPENGL_WGL
+#if SDL_VIDEO_OPENGL_WGL
     if (window->flags & SDL_WINDOW_OPENGL) {
         if (WIN_GL_SetupWindow(_this, window) < 0) {
             WIN_DestroyWindow(_this, window);
--- a/src/video/x11/SDL_x11video.c	Mon Jan 24 16:10:13 2011 -0800
+++ b/src/video/x11/SDL_x11video.c	Mon Jan 24 17:38:18 2011 -0800
@@ -209,7 +209,7 @@
     device->shape_driver.CreateShaper = X11_CreateShaper;
     device->shape_driver.SetWindowShape = X11_SetWindowShape;
     device->shape_driver.ResizeWindowShape = X11_ResizeWindowShape;
-#ifdef SDL_VIDEO_OPENGL_GLX
+#if SDL_VIDEO_OPENGL_GLX
     device->GL_LoadLibrary = X11_GL_LoadLibrary;
     device->GL_GetProcAddress = X11_GL_GetProcAddress;
     device->GL_UnloadLibrary = X11_GL_UnloadLibrary;
--- a/src/video/x11/SDL_x11window.c	Mon Jan 24 16:10:13 2011 -0800
+++ b/src/video/x11/SDL_x11window.c	Mon Jan 24 17:38:18 2011 -0800
@@ -288,7 +288,7 @@
     }
 */
 #endif
-#ifdef SDL_VIDEO_OPENGL_GLX
+#if SDL_VIDEO_OPENGL_GLX
     if (window->flags & SDL_WINDOW_OPENGL) {
         XVisualInfo *vinfo;