GameLoopThreadFunction added to GameEngine.cs