X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fapp.cpp;h=1e36fe4c6450b2d515276aa2d039a0e19fe09aa9;hb=ea10984eaf09364d9f6e08114caa4bcfcaa72d9e;hp=9a2cdbfaddba548b5fef72f0fa73a35275ac319d;hpb=09adab3161f986d5cc8dbeffe15cb6545afa138f;p=virtualjaguar diff --git a/src/gui/app.cpp b/src/gui/app.cpp index 9a2cdbf..1e36fe4 100644 --- a/src/gui/app.cpp +++ b/src/gui/app.cpp @@ -9,11 +9,14 @@ // 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" @@ -31,14 +34,28 @@ 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(); - App app(argc, argv); // Declare an instance of the application + LogInit("virtualjaguar.log"); // Init logfile + int retVal = -1; // Default is failure - return app.exec(); // And run it! + // 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! + } + + LogDone(); // Close logfile + return retVal; } // Main app constructor--we stick globally accessible stuff here...