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); }); }
/// <summary> /// The Load method can be used to initialize scene resources or to load a /// previously saved app state. /// </summary> public void Load(string entryPoint) { if (!isApplicationInitilized) { isApplicationInitilized = true; application.Initialize(); ConfigureMixedRealityDisplay(application, xrDevice); } }
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); }); }