Esempio n. 1
0
        /// <summary>
        /// This method is called after the window becomes active. It oversees the
        /// update, draw, and present loop, and also oversees window message processing.
        /// </summary>
        public void Run()
        {
            HolographicFrame previousFrame = null;

            while (!windowClosed)
            {
                if (windowVisible && (null != holographicSpace))
                {
                    CoreWindow.GetForCurrentThread().Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessAllIfPresent);

                    HolographicFrame currentFrame = main.Update(previousFrame);

                    if (main.Render(currentFrame))
                    {
                        deviceResources.Present(currentFrame);
                    }

                    previousFrame = currentFrame;
                }
                else
                {
                    CoreWindow.GetForCurrentThread().Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessOneAndAllPending);
                }
            }
        }