2 // app.cpp - Qt-based GUI for Virtual Jaguar
5 // (C) 2010 Underground Software
7 // JLH = James L. Hammons <jlhamm@acm.org>
10 // --- ---------- -------------------------------------------------------------
11 // JLH 12/23/2009 Created this file
12 // JLH 01/21/2011 Added SDL initialization
13 // JLH 06/26/2011 Added fix to keep SDL from hijacking main() on win32
19 #include <QApplication>
25 // Apparently on win32, SDL is hijacking main from Qt. So let's do this:
29 // Here's the main application loop--short and simple...
30 int main(int argc, char * argv[])
34 if (strcmp(argv[1], "--help") == 0)
36 printf("Virtual Jaguar 2.0.0 help\n");
38 printf("This is an experimental branch of Virtual Jaguar, how did you get it?\n");
43 Q_INIT_RESOURCE(virtualjaguar); // This must the same name as the exe filename
44 //or is it the .qrc filename???
45 // This is so we can pass this stuff using signal/slot mechanism...
46 //ick int id = qRegisterMetaType<uint32>();
48 LogInit("virtualjaguar.log"); // Init logfile
49 int retVal = -1; // Default is failure
52 if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0)
54 WriteLog("VJ: Could not initialize the SDL library: %s\n", SDL_GetError());
58 WriteLog("VJ: SDL (joystick, audio) successfully initialized.\n");
59 App app(argc, argv); // Declare an instance of the application
60 retVal = app.exec(); // And run it!
63 LogDone(); // Close logfile
67 // Main app constructor--we stick globally accessible stuff here...
69 App::App(int argc, char * argv[]): QApplication(argc, argv)
71 mainWindow = new MainWin();