示例#1
0
        private void OnSwapChainPanelLoaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            // Create app
            MainApplication application = new MainApplication();

            // Create Services
            UWPWindowsSystem windowsSystem = new UWPWindowsSystem();

            application.Container.RegisterInstance(windowsSystem);
            var surface = (UWPSurface)windowsSystem.CreateSurface(SwapChainPanel);

            ConfigureGraphicsContext(application, surface);

            // Creates XAudio device
            var xaudio = new Evergine.XAudio2.XAudioDevice();

            application.Container.RegisterInstance(xaudio);

            Stopwatch clockTimer = Stopwatch.StartNew();

            windowsSystem.Run(
                () =>
            {
                application.Initialize();
            },
                () =>
            {
                var gameTime = clockTimer.Elapsed;
                clockTimer.Restart();

                application.UpdateFrame(gameTime);
                application.DrawFrame(gameTime);
            });
        }
示例#2
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()
        {
            Stopwatch clockTimer = Stopwatch.StartNew();

            windowsSystem.Run(null,
                              () =>
            {
                var gameTime = clockTimer.Elapsed;
                clockTimer.Restart();

                xrDevice.Update();
                application.UpdateFrame(gameTime);
                application.DrawFrame(gameTime);
            });
        }
        static void Main(string[] args)
        {
            // Create app
            MainApplication application = new MainApplication();

            // Create Services
            uint          width         = 1280;
            uint          height        = 720;
            WindowsSystem windowsSystem = new Evergine.Forms.FormsWindowsSystem();

            application.Container.RegisterInstance(windowsSystem);
            var window = windowsSystem.CreateWindow("AzureRemoteRendering_Demo - DX11", width, height);

            ConfigureGraphicsContext(application, window);

            // Creates XAudio device
            var xaudio = new Evergine.XAudio2.XAudioDevice();

            application.Container.RegisterInstance(xaudio);

            Stopwatch clockTimer = Stopwatch.StartNew();

            windowsSystem.Run(
                () =>
            {
                application.Initialize();
            },
                () =>
            {
                var gameTime = clockTimer.Elapsed;
                clockTimer.Restart();

                application.UpdateFrame(gameTime);
                application.DrawFrame(gameTime);
            });
        }