/// <summary> /// Main render method called each frame. get next swapchain image, process resize if needed, submit and present to the presentQueue. /// Wait QueueIdle after presenting. /// </summary> protected virtual void render() { int idx = swapChain.GetNextImage(); if (idx < 0) { OnResize(); return; } if (cmds[idx] == null) { return; } drawFence.Wait(); drawFence.Reset(); presentQueue.Submit(cmds[idx], swapChain.presentComplete, drawComplete[idx], drawFence); presentQueue.Present(swapChain, drawComplete[idx]); //presentQueue.WaitIdle (); }