예제 #1
0
        public void SetWindow(CoreWindow window)
        {
            // At this point we have access to the device and we can create device-dependent
            // resources.
            // Create app
            application = new MainApplication()
            {
                IsLowProfile = true
            };

            // Create Services
            xrDevice = new MixedRealityPlatform();
            application.Container.RegisterInstance(xrDevice);
            windowsSystem = new MixedRealityWindowsSystem(window);
            application.Container.RegisterInstance(windowsSystem);

            application.Container.RegisterInstance(new VoiceCommandService());

            ConfigureGraphicsContext(application);

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

            application.Container.RegisterInstance(xaudio);
        }
예제 #2
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);
            });
        }
예제 #3
0
        private static AudioDevice CreateAudioDevice()
        {
            AudioDevice audioDevice;

            if (DeviceInfo.PlatformType == PlatformType.Windows)
            {
                audioDevice = new Evergine.XAudio2.XAudioDevice();
            }
            else if (DeviceInfo.PlatformType == PlatformType.Linux || DeviceInfo.PlatformType == PlatformType.MacOS)
            {
                audioDevice = new Evergine.OpenAL.ALAudioDevice();
            }
            else
            {
                throw new Exception("Audio device can not be created.");
            }

            return(audioDevice);
        }
예제 #4
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // Create app
            WaveApplication = new MyApplication();

            // Create Window System
            var windowsSystem = new Evergine.WPF.WPFWindowsSystem(this);

            WaveApplication.Container.RegisterInstance(windowsSystem);

            // Create Graphic context
            var graphicsContext = new Evergine.DirectX11.DX11GraphicsContext();

            graphicsContext.CreateDevice();
            WaveApplication.Container.RegisterInstance(graphicsContext);

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

            WaveApplication.Container.RegisterInstance(xaudio);

            Stopwatch clockTimer = Stopwatch.StartNew();

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

                WaveApplication.UpdateFrame(gameTime);
                WaveApplication.DrawFrame(gameTime);

                graphicsContext.DXDeviceContext.Flush();
            });
        }
예제 #5
0
        static void Main(string[] args)
        {
            // Create app
            MyApplication application = new MyApplication();

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

            application.Container.RegisterInstance(windowsSystem);
            var window = windowsSystem.CreateWindow("AreaLightsDemo - OpenGL", 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);
            });
        }