internal override void Run() { Debug.Assert(InitCallback != null, $"{nameof(InitCallback)} is null"); Debug.Assert(RunCallback != null, $"{nameof(RunCallback)} is null"); // Initialize the init callback InitCallback(); var runCallback = new SDLMessageLoop.RenderCallback(RunCallback); // Run the rendering loop try { SDLMessageLoop.Run(window, () => { if (Exiting) { Destroy(); return; } runCallback(); }); } finally { ExitCallback?.Invoke(); } }
internal override void Run() { Debug.Assert(InitCallback != null, $"{nameof(InitCallback)} is null"); Debug.Assert(RunCallback != null, $"{nameof(RunCallback)} is null"); // Initialize the init callback InitCallback(); var context = (GameContextSDL)GameContext; if (context.IsUserManagingRun) { context.RunCallback = RunCallback; context.ExitCallback = ExitCallback; } else { var runCallback = new SDLMessageLoop.RenderCallback(RunCallback); // Run the rendering loop try { SDLMessageLoop.Run(window, () => { if (Exiting) { Destroy(); return; } runCallback(); }); } finally { ExitCallback?.Invoke(); } } }