X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fapp.cpp;h=bb0f9243bf7e7f5471d2d446e26d4a69cf4913a4;hb=4c951d1b043c8ee14603ffdc6704962280df40d6;hp=264a79a6f54050ec5e0b238ce5deab0df74a5f22;hpb=68e8886a9aaf48fcc130334d8cf4fe35a4534a02;p=virtualjaguar diff --git a/src/gui/app.cpp b/src/gui/app.cpp index 264a79a..bb0f924 100644 --- a/src/gui/app.cpp +++ b/src/gui/app.cpp @@ -9,15 +9,20 @@ // Who When What // --- ---------- ------------------------------------------------------------- // JLH 12/23/2009 Created this file +// JLH 01/21/2011 Added SDL initialization // #include "app.h" +#include #include #include "log.h" #include "mainwin.h" #include "types.h" +// Apparently on other archs, SDL is hijacking main, so let's do this: +#undef main + // Here's the main application loop--short and simple... int main(int argc, char * argv[]) { @@ -32,15 +37,26 @@ int main(int argc, char * argv[]) } } - Q_INIT_RESOURCE(vj); // This must the same name as the exe filename + Q_INIT_RESOURCE(virtualjaguar); // This must the same name as the exe filename //or is it the .qrc filename??? // This is so we can pass this stuff using signal/slot mechanism... //ick int id = qRegisterMetaType(); - LogInit("vj.log"); // Init logfile - App app(argc, argv); // Declare an instance of the application + LogInit("virtualjaguar.log"); // Init logfile + 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; }