// Shows how to configure logging with a property file int main(int argc, char *argv[]) { QCoreApplication application(argc, argv); LoggerObject * object = new LoggerObject(&application); LoggerObjectPrio * object1 = new LoggerObjectPrio(&application); Q_UNUSED(object1) QObject::connect(object, &LoggerObject::exit, &application, &QCoreApplication::exit); initializeRootLogger(); logStartup(); int ret; { QScopedPointer<LoggerStatic> object2(new LoggerStatic()); ret = application.exec(); } logShutdown(); shutdownRootLogger(); return ret; }
void appShutdown(void) { // console // input // audio // gfx // font // texture videoShutdown(); flubCfgShutdown(); flubPhysfsShutdown(); flubSDLShutdown(); cmdlineShutdown(); logShutdown(); }
// In a windows program, instead of main(), we use WinMain() // Refer to earlier lessons for comments and more detail. int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow ) { // Setup a console consoleCreate() ; consoleWhite() ; consoleMove( 32, 500 ) ; consoleRowsAndCols( 10, 120 ) ; // Start up the log. logStartup() ; // Put these after log start up, b/c start up inits them with some init values logOutputsForConsole = LOG_ERROR | LOG_WARNING | LOG_INFO ; // See ERROR and WARNING messages at Console. logOutputsForFile = LOG_ERROR | LOG_WARNING | LOG_INFO ; // See all types of messages in file logOutputsForDebugStream = LOG_ERROR | LOG_WARNING ; // See all ERROR and WARNING messages at debugstream. Suppress 'info()' messages. // Start up GDI+, which we use to draw // For GDI+, used only for shape render GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); // Setup the window window = new GameWindow( hInstance, TEXT( "eternity engine base" ), 32, 32, // x pos, y pos 640, 480 // width, height ) ; // After the window comes up, we call Init // to load the game's content Init() ; MSG message ; while( 1 ) { if( PeekMessage( &message, NULL, 0, 0, PM_REMOVE ) ) { if( message.message == WM_QUIT ) // if we got a WM_QUIT message.. { break ; // ..then end the program by jumping out of the while(1) loop. } // Send the message over to WndProc for // further processing. TranslateMessage( &message ) ; DispatchMessage( &message ) ; } else { // Run our game, one frame Update() ; window->step() ; // ^^ update fmod engine, grab updated keystates, etc. // Draw the game out, all at once if( window->beginDrawing() ) // only continue if beginDrawing() succeeds { Draw() ; window->endDrawing() ; } } } info( "Game over!" ) ; logShutdown() ; GdiplusShutdown(gdiplusToken); //system( "pause" ) ; // uncomment to make it pause before exit return 0 ; }