/// <summary> /// Render the frame /// </summary> protected void RenderScene() { if (needsResizing) { needsResizing = false; renderTargetView.Dispose(); SwapChainDescription sd = swapChain.Description; swapChain.ResizeBuffers(sd.BufferCount, (uint)directControl.ClientSize.Width, (uint)directControl.ClientSize.Height, sd.BufferDescription.Format, sd.Options); SetViews(); } // Just clear the backbuffer device.ClearRenderTargetView(renderTargetView, backColor); TechniqueDescription techDesc = technique.Description; for (uint p = 0; p < techDesc.Passes; ++p) { technique.GetPassByIndex(p).Apply(); device.Draw(3, 0); } swapChain.Present(0, PresentOptions.None); }