New game loop for torque 2D?
by Marcelo Panaro de Moraes Zamith · in Torque 2D Professional · 08/13/2013 (10:38 am) · 1 replies
I have some doubts about the torque 2d game loop:
1 - How does the torque 2d game loop work?
2 - Can I implement my own game loop inside torque 2d?
Does anyone know this?
dic
1 - How does the torque 2d game loop work?
2 - Can I implement my own game loop inside torque 2d?
Does anyone know this?
dic
Employee Michael Perry
ZombieShortbus
Inside of the source code, it's a bit more complex. The platform main loop starts. Then it runs the game loop, which is dedicated to processing events. Here's a really rough callstack:
void DefaultGame::mainLoop - Calls the process function for major systems like Platform, Net, TimeManager, and Game. This will then jump into GameInterface::processEvent()
GameInterface::processEvent - This primarily contains a switch statement that processes the last event. It has cases for mouse movement, input event, time event, and so on.
You eventually end up in DefaultGame::processTimeEvent. This is where time events, simulation ticks, and the root render call occur.
Now, I do not know how you define a game loop. If you describe what kind of actions you want to happen in your game loop, it will better help us determine where it needs to go.