/// <summary> /// Call Game when your application's done. Disposes of Game and fires any /// OnGameTermination events. /// </summary> public static void Terminate() { if (Game.Terminated) { return; } if (AudioSystem != null) { AudioSystem.Dispose(); } if (InputSystem.InputProvider != null) { InputSystem.InputProvider.Dispose(); } if (RenderSystem != null) { RenderSystem.Dispose(); } if (Game.OnGameTermination != null) { Game.OnGameTermination(null, Game.internedEventArg); } Game.Terminated = true; Unsubscribe(messenger); }
/// <inheritdoc/> protected override void Destroy() { // Dispose renderers Game?.Dispose(); // Cleanup created visibility groups foreach (var sceneInstance in initializedSceneInstances) { for (var i = 0; i < sceneInstance.VisibilityGroups.Count; i++) { var visibilityGroup = sceneInstance.VisibilityGroups[i]; if (visibilityGroup.RenderSystem == RenderSystem) { sceneInstance.VisibilityGroups.RemoveAt(i); break; } } } RenderSystem.Dispose(); base.Destroy(); }
protected override void Destroy() { RenderSystem.Dispose(); base.Destroy(); }