void Window_Loaded(object sender, RoutedEventArgs e) { D3DImageContainer = new D3DImageSlimDX(); D3DImageContainer.IsFrontBufferAvailableChanged += OnIsFrontBufferAvailableChanged; SlimDXImage.Source = D3DImageContainer; D3DScene = new Scene(); SlimDX.Direct3D10.Texture2D Texture = D3DScene.SharedTexture; D3DImageContainer.SetBackBufferSlimDX(Texture); BeginRenderingScene(); }
void Window_Closing(object sender, CancelEventArgs e) { if (D3DImageContainer != null) { D3DImageContainer.Dispose(); D3DImageContainer = null; } if (D3DScene != null) { D3DScene.Dispose(); D3DScene = null; } }