X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fapp.cpp;h=b313f66c6eba21bc35b76fd25b5af6151668a565;hb=5da604521611a960140b58a2fb0f236c65610b70;hp=e878edfc9c206836db892fc13cb7cf572038f230;hpb=ec553d06e2718a1c6c0d6bdfcd508ce1ba89c706;p=virtualjaguar diff --git a/src/gui/app.cpp b/src/gui/app.cpp index e878edf..b313f66 100644 --- a/src/gui/app.cpp +++ b/src/gui/app.cpp @@ -9,15 +9,23 @@ // Who When What // --- ---------- ------------------------------------------------------------- // JLH 12/23/2009 Created this file +// JLH 01/21/2011 Added SDL initialization +// JLH 06/26/2011 Added fix to keep SDL from hijacking main() on win32 // #include "app.h" +#include #include #include "log.h" #include "mainwin.h" #include "types.h" +#ifdef __GCCWIN32__ +// Apparently on win32, SDL is hijacking main from Qt. So let's do this: +#undef main +#endif + // Here's the main application loop--short and simple... int main(int argc, char * argv[]) { @@ -38,9 +46,20 @@ int main(int argc, char * argv[]) //ick int id = qRegisterMetaType(); LogInit("virtualjaguar.log"); // Init logfile - App app(argc, argv); // Declare an instance of the application + int retVal = -1; // Default is failure + + // Set up SDL library + if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0) + { + WriteLog("VJ: Could not initialize the SDL library: %s\n", SDL_GetError()); + } + else + { + WriteLog("VJ: SDL (joystick, audio) successfully initialized.\n"); + App app(argc, argv); // Declare an instance of the application + retVal = app.exec(); // And run it! + } - int retVal = app.exec(); // And run it! LogDone(); // Close logfile return retVal; }