private void layoutRoot_Loaded(object sender, RoutedEventArgs e) { _pipeline = new D3D12Pipeline(); _pipeline.InitPipeline(Window.Current.CoreWindow, (int)Window.Current.Bounds.Width, (int)Window.Current.Bounds.Height); DoWorkAsyncInfiniteLoop(_pipeline); }
private async Task DoWorkAsyncInfiniteLoop(D3D12Pipeline pipeline) { while (true) { // do the work in the loop pipeline.Update(); // update the UI pipeline.Render(); // don't run again for at least 200 milliseconds await Task.Delay(30); } }
private void LayoutRoot_Unloaded(object sender, RoutedEventArgs e) { _pipeline = null; }