public void Render() { if (!PauseRendering) { mD3D11DeviceContext.OutputMerger.SetTargets(mD3D11DepthStencilView, mD3D11RenderTargetView); mD3D11DeviceContext.Rasterizer.SetViewports(Viewport); if (RenderingStrategy != null) { RenderingStrategy.Render(mD3D11DeviceContext, Viewport, mD3D11RenderTargetView, mD3D11DepthStencilView); } mSwapChain.Present(0, PresentFlags.None); } }
public void Dispose() { DestroyD3D11Resources(); if (mSwapChain != null) { mSwapChain.Dispose(); mSwapChain = null; } if (RenderingStrategy != null) { RenderingStrategy.Dispose(); RenderingStrategy = null; } }
/// <summary> /// Renders the buffer on the screen. /// </summary> public void Render(RenderingStrategy strategy) { var window = Renderer.GetOutputBufferWindow(); //Go up the chain to root and render there. if (strategy == RenderingStrategy.BubbleUp) { Restore(parent); Render(window, parent); //If there's no parent then we are root and we need to render here. if (parent != null) { parent.Render(strategy); } } else if (strategy == RenderingStrategy.RenderHere) { Restore(null); Render(window, null); } }
public AbstractRender(String id, RenderingStrategy strategy) : base(id, null) { base.Set(Render); renderingStrategy = strategy; }