Commits

Jared Thirsk committed d994338

Added event so that people know when GetViewport's viewports are no longer valid

  • Participants
  • Parent commits 385672b

Comments (0)

Files changed (1)

File MogreImage/MogreImage.cs

         } private ViewportDefinition[] viewportDefinitions;
         private bool viewportDefinitionsChanged;
 
+        /// <summary>
+        /// Indicates that viewports have been recreated.  If you got a viewport via GetViewport, you will likely have to get it again.
+        /// </summary>
+        public event Action ViewportsChanged;
+
+        /// <summary>
+        /// Warning: The ViewportsChanged event indicates when the Viewport returned may have become invalid.  Listen for this
+        /// event to know when to get new versons of the viewports.
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
         public Viewport GetViewport(int index)
         {
             return viewports[index];
                         viewports[i] = viewport;
                     }
                 }
+                {var ev = ViewportsChanged;
+                if (ev != null) ev();}
             }
             viewportDefinitionsChanged = false;
         }
 
+
+
         public SceneManager SceneManager
         {
             get { return _sceneManager; }