/// <inheritdoc/> public void SetWindow(CoreWindow window) { this.window = window; // Safely dispose any previous instance RemoveAndDispose(ref deviceManager); RemoveAndDispose(ref target); RemoveAndDispose(ref cubeRenderer); // Creates a new DeviceManager (Direct3D, Direct2D, DirectWrite, WIC) deviceManager = ToDispose(new DeviceManager()); // Use CoreWindowTarget as the rendering target (Initialize SwapChain, RenderTargetView, DepthStencilView, BitmapTarget) target = ToDispose(new CoreWindowTarget(window)); // New CubeRenderer cubeRenderer = ToDispose(new CubeTextureRenderer()); // Add Initializer to device manager deviceManager.OnInitialize += target.Initialize; deviceManager.OnInitialize += cubeRenderer.Initialize; // Render the cube within the CoreWindow target.OnRender += cubeRenderer.Render; // Initialize the device manager and all registered deviceManager.OnInitialize deviceManager.Initialize(DisplayProperties.LogicalDpi); }
/// <inheritdoc/> public void SetWindow(CoreWindow window) { this.window = window; // Safely dispose any previous instance RemoveAndDispose(ref deviceManager); RemoveAndDispose(ref target); RemoveAndDispose(ref cubeRenderer); // Creates a new DeviceManager (Direct3D, Direct2D, DirectWrite, WIC) deviceManager = ToDispose(new DeviceManager()); // Use CoreWindowTarget as the rendering target (Initialize SwapChain, RenderTargetView, DepthStencilView, BitmapTarget) target = ToDispose(new CoreWindowTarget(window)); // New CubeRenderer cubeRenderer = ToDispose(new CubeTextureRenderer()); }