protected override void Destroy() { RootScene = null; // Cleaning processors should not be necessary anymore, but physics are not properly cleaned up otherwise Reset(); // TODO: Dispose of Scene, graphics compositor...etc. // Currently in Destroy(), not sure if we should clear that list on Reset() as well? VisibilityGroups.Clear(); base.Destroy(); }
protected override void Destroy() { Reset(); // TODO: Dispose of Scene, graphics compositor...etc. // Currently in Destroy(), not sure if we should clear that list on Reset() as well? VisibilityGroups.Clear(); if (scene != null) { scene.ReleaseInternal(); scene = null; } base.Destroy(); }
public VisibilityGroup GetOrCreateVisibilityGroup(RenderSystem renderSystem) { // Find if it exists VisibilityGroup visibilityGroup = null; foreach (var currentVisibilityGroup in VisibilityGroups) { if (currentVisibilityGroup.RenderSystem == renderSystem) { visibilityGroup = currentVisibilityGroup; break; } } // If first time, let's create and register it if (visibilityGroup == null) { VisibilityGroups.Add(visibilityGroup = new VisibilityGroup(renderSystem)); } return(visibilityGroup); }