From 50402806d09ea00550984c0726b12461f98b2a49 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 23 Jul 2003 20:51:46 +0000 Subject: [PATCH] Cleanup Fix OpenGL in Windows. --- stepmania/src/arch/arch.cpp | 8 +++++++- stepmania/src/arch/arch_Win32.h | 3 +++ stepmania/src/arch/arch_darwin.h | 2 -- stepmania/src/arch/arch_default.h | 31 +++++++++++++++++++++++++++---- stepmania/src/arch/arch_linux.h | 10 ++++------ stepmania/src/arch/arch_xbox.h | 8 +++++++- 6 files changed, 48 insertions(+), 14 deletions(-) diff --git a/stepmania/src/arch/arch.cpp b/stepmania/src/arch/arch.cpp index 46e312dca9..1b70647c83 100644 --- a/stepmania/src/arch/arch.cpp +++ b/stepmania/src/arch/arch.cpp @@ -26,7 +26,9 @@ LoadingWindow *MakeLoadingWindow() { return new ARCH_LOADING_WINDOW; } ErrorDialog *MakeErrorDialog() { return new ARCH_ERROR_DIALOG; } ArchHooks *MakeArchHooks() { return new ARCH_HOOKS; } +#if defined(SUPPORT_OPENGL) LowLevelWindow *MakeLowLevelWindow() { return new ARCH_LOW_LEVEL_WINDOW; } +#endif void MakeInputHandlers(vector &Add) { @@ -34,7 +36,11 @@ void MakeInputHandlers(vector &Add) Add.push_back(new InputHandler_DInput); Add.push_back(new InputHandler_Win32_Pump); // Add.push_back(new InputHandler_Win32_Para); -#else +#else if defined(_XBOX) + // Add.push_back(new InputHandler_DInput); +#endif + +#if defined(SUPPORT_SDL_INPUT) Add.push_back(new InputHandler_SDL); #endif } diff --git a/stepmania/src/arch/arch_Win32.h b/stepmania/src/arch/arch_Win32.h index b62aa69d42..bfe34ec265 100644 --- a/stepmania/src/arch/arch_Win32.h +++ b/stepmania/src/arch/arch_Win32.h @@ -14,6 +14,9 @@ #include "Sound/RageSoundDriver_DSound_Software.h" #include "Sound/RageSoundDriver_WaveOut.h" +#define SUPPORT_D3D +#undef SUPPORT_SDL_INPUT + #endif /* diff --git a/stepmania/src/arch/arch_darwin.h b/stepmania/src/arch/arch_darwin.h index 8da0e05441..1945c0cd60 100644 --- a/stepmania/src/arch/arch_darwin.h +++ b/stepmania/src/arch/arch_darwin.h @@ -13,8 +13,6 @@ #include "Sound/RageSoundDriver_QT1.h" #include "Sound/RageSoundDriver_QT.h" #include "LoadingWindow/LoadingWindow_Cocoa.h" -#include "InputHandler/InputHandler_SDL.h" -#include "LowLevelWindow/LowLevelWindow_SDL.h" #include "ErrorDialog/ErrorDialog_darwin.h" #include "ArchHooks/ArchHooks_darwin.h" diff --git a/stepmania/src/arch/arch_default.h b/stepmania/src/arch/arch_default.h index d94b537bb4..214c660e3e 100644 --- a/stepmania/src/arch/arch_default.h +++ b/stepmania/src/arch/arch_default.h @@ -5,17 +5,40 @@ * here. */ /* None of these SDL implementations run on Xbox, so I've commented * out use of this header and added the #includes to each arch_*.h */ +/* + * The basic design principle of arch is that a new platform can be up and running + * quickly using only arch_default, with OpenGL graphics and SDL input, and things can + * be overloaded later. That way, people don't have to learn how arch works + * until after they have the basic stuff running. + * + * For Xbox, let's leave this file alone, and special case stuff in arch_xbox.h. + * + * For LowLevelWindow, just undefine SUPPORT_OPENGL and don't link any LLW at + * all. (We'll still include the header here, but it'll never be used.) We + * can remove LowLevelWindow_Null, but I'll wait for you to confirm that there + * aren't any strange problems with this before doing that. -/* Load default fallback drivers; some of these may be overridden by arch-specific drivers. */ + * For InputHandler, undef SUPPORT_SDL_INPUT and we won't create the SDL input + * handler. + */ + +/* We can have any number of input drivers. By default, use SDL for keyboards + * and joysticks. If you write your own handler for these devices types, or if + * SDL input doesn't work on your platform, undef SUPPORT_SDL_INPUT in your platform + * header. */ +#define SUPPORT_SDL_INPUT +#include "InputHandler/InputHandler_SDL.h" + +/* Load default fallback drivers; some of these may be overridden by arch-specific + * drivers. These are all singleton drivers--we never use more than one. */ #include "LoadingWindow/LoadingWindow_SDL.h" /* XXX: null, none, Null--pick one */ #include "ErrorDialog/ErrorDialog_null.h" #include "ArchHooks/ArchHooks_none.h" #include "Sound/RageSoundDriver_Null.h" -#include "LowLevelWindow/LowLevelWindow_Null.h" +#include "LowLevelWindow/LowLevelWindow_SDL.h" -// not supported on Xbox -//#include "InputHandler/InputHandler_SDL.h" +#define SUPPORT_OPENGL #endif diff --git a/stepmania/src/arch/arch_linux.h b/stepmania/src/arch/arch_linux.h index 57abdf8a16..213e345ef4 100644 --- a/stepmania/src/arch/arch_linux.h +++ b/stepmania/src/arch/arch_linux.h @@ -1,19 +1,17 @@ #ifndef LINUX_ARCH_H #define LINUX_ARCH_H -#include "global.h" - #ifdef HAVE_ALSA -# include "Sound/RageSoundDriver_ALSA9.h" +#include "Sound/RageSoundDriver_ALSA9.h" #endif +#ifdef HAVE_OSS #include "Sound/RageSoundDriver_OSS.h" +#endif #ifdef HAVE_GTK -# include "LoadingWindow/LoadingWindow_Gtk.h" +#include "LoadingWindow/LoadingWindow_Gtk.h" #endif -#include "InputHandler/InputHandler_SDL.h" -#include "LowLevelWindow/LowLevelWindow_SDL.h" #endif /* diff --git a/stepmania/src/arch/arch_xbox.h b/stepmania/src/arch/arch_xbox.h index c536363621..8cc950850d 100644 --- a/stepmania/src/arch/arch_xbox.h +++ b/stepmania/src/arch/arch_xbox.h @@ -2,14 +2,20 @@ #define XBOX_ARCH_H /* Load drivers for Xbox. */ -#include "LoadingWindow/LoadingWindow_Null.h" #include "ErrorDialog/ErrorDialog_null.h" #include "ArchHooks/ArchHooks_none.h" +/* Err, is SDL input working on Xbox? arch_default comments indicated no. + * (Best to use a custom driver for threaded input, anyway.) */ #include "InputHandler/InputHandler_SDL.h" #include "Sound/RageSoundDriver_DSound.h" +#define SUPPORT_D3D +#undef SUPPORT_OPENGL +/* Undef this if you need no SDL input. */ +// #undef SUPPORT_SDL_INPUT + #endif /*