int CreateMainWindowAndReturnExitCodeWhenItCloses( const HINSTANCE i_thisInstanceOfTheProgram, const int i_initialWindowDisplayState ) { // Try to create the main window if ( CreateMainWindow( i_thisInstanceOfTheProgram, i_initialWindowDisplayState ) ) { if (Gameplay::Initialize(s_mainWindow)) { // If the main window was successfully created wait for it to be closed const int exitCode = WaitForMainWindowToCloseAndReturnExitCode(i_thisInstanceOfTheProgram); Gameplay::Shutdown(); return exitCode; } else { //Our game code failed to initialize. Return a made-up error code return -2; } } else { // If the main window wasn't created return a made-up error code return -1; } }
int CreateMainWindowAndReturnExitCodeWhenItCloses(const HINSTANCE i_thisInstanceOfTheProgram, const int i_initialWindowDisplayState) { // Try to create the main window if (CreateMainWindow(i_thisInstanceOfTheProgram, i_initialWindowDisplayState)) { eae6320::Graphics::Initialize(s_mainWindow); // If the main window was successfully created wait for it to be closed const int exitCode = WaitForMainWindowToCloseAndReturnExitCode(i_thisInstanceOfTheProgram); return exitCode; } else { // If the main window wasn't created return a made-up error code return -1; } }