LoadingWindow driver fallbacks.
This commit is contained in:
@@ -23,7 +23,50 @@
|
|||||||
#include "arch_Win32.h"
|
#include "arch_Win32.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LoadingWindow *MakeLoadingWindow() { return new ARCH_LOADING_WINDOW; }
|
LoadingWindow *MakeLoadingWindow()
|
||||||
|
{
|
||||||
|
/* Don't load NULL by default. On most systems, if we can't load the SDL
|
||||||
|
* loading window, we won't be able to init OpenGL, either, so don't bother. */
|
||||||
|
CString drivers = "win32,cocoa,gtk,sdl";
|
||||||
|
CStringArray DriversToTry;
|
||||||
|
split(drivers, ",", DriversToTry, true);
|
||||||
|
|
||||||
|
ASSERT( DriversToTry.size() != 0 );
|
||||||
|
|
||||||
|
CString Driver;
|
||||||
|
LoadingWindow *ret = NULL;
|
||||||
|
|
||||||
|
for(unsigned i = 0; ret == NULL && i < DriversToTry.size(); ++i)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
Driver = DriversToTry[i];
|
||||||
|
|
||||||
|
#ifdef HAVE_LOADING_WINDOW_WIN32
|
||||||
|
if(!DriversToTry[i].CompareNoCase("Win32")) ret = new LoadingWindow_Win32;
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_LOADING_WINDOW_GTK
|
||||||
|
if(!DriversToTry[i].CompareNoCase("Gtk")) ret = new LoadingWindow_Gtk;
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_LOADING_WINDOW_COCOA
|
||||||
|
if(!DriversToTry[i].CompareNoCase("Cocoa")) ret = new LoadingWindow_Cocoa;
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_LOADING_WINDOW_SDL
|
||||||
|
if(!DriversToTry[i].CompareNoCase("SDL")) ret = new LoadingWindow_SDL;
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_LOADING_WINDOW_NULL
|
||||||
|
if(!DriversToTry[i].CompareNoCase("Null")) ret = new LoadingWindow_Null;
|
||||||
|
#endif
|
||||||
|
} catch(const RageException &e) {
|
||||||
|
LOG->Info("Couldn't load driver %s: %s", DriversToTry[i].c_str(), e.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ret)
|
||||||
|
LOG->Info("Loading window: %s", Driver.c_str());
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ErrorDialog *MakeErrorDialog() { return new ARCH_ERROR_DIALOG; }
|
ErrorDialog *MakeErrorDialog() { return new ARCH_ERROR_DIALOG; }
|
||||||
ArchHooks *MakeArchHooks() { return new ARCH_HOOKS; }
|
ArchHooks *MakeArchHooks() { return new ARCH_HOOKS; }
|
||||||
#if defined(SUPPORT_OPENGL)
|
#if defined(SUPPORT_OPENGL)
|
||||||
|
|||||||
Reference in New Issue
Block a user