MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / TorqueMain

Function TorqueMain

Engine/source/main/main.cpp:291–326  ·  view source on GitHub ↗

Entry point for your game. This is build by default using the "StandardMainLoop" toolkit. Feel free to bring code over directly as you need to modify or extend things. You will need to merge against future changes to the SML code if you do this.

Source from the content-addressed store, hash-verified

289// to bring code over directly as you need to modify or extend things. You
290// will need to merge against future changes to the SML code if you do this.
291S32 TorqueMain(S32 argc, const char **argv)
292{
293 // Some handy debugging code:
294 // if (argc == 1) {
295 // static const char* argvFake[] = { "dtest.exe", "-jload", "test.jrn" };
296 // argc = 3;
297 // argv = argvFake;
298 // }
299
300 // Memory::enableLogging("testMem.log");
301 // Memory::setBreakAlloc(104717);
302
303 // Initialize the subsystems.
304 StandardMainLoop::init();
305
306 // Handle any command line args.
307 if(!StandardMainLoop::handleCommandLine(argc, argv))
308 {
309 Platform::AlertOK("Error", "Failed to initialize game, shutting down.");
310
311 return 1;
312 }
313
314 // Main loop
315 while(StandardMainLoop::doMainLoop());
316
317 // Clean everything up.
318 StandardMainLoop::shutdown();
319
320 // Do we need to restart?
321 if( StandardMainLoop::requiresRestart() )
322 Platform::restartInstance();
323
324 // Return.
325 return StandardMainLoop::getReturnStatus();
326}
327
328#endif //TORQUE_SHARED

Callers

nothing calls this directly

Calls 2

initFunction · 0.50
shutdownFunction · 0.50

Tested by

no test coverage detected