我正在使用 SlimDX 渲染表单中的控件。由于该控件的大小可能会经常变化,并且有很多复杂的网格,因此传统的自由重置构造方法可能对我来说太慢了。有什么办法提升吗?
1 回答
create an additional SwapChain linked to your current window using IDirect3DDevice9::CreateAdditionalSwapChain Method,
then, get the back buffer of the new SwapChain, and, use IDirect3DDevice9::SetRenderTarget method to set the back buffer of the new SwapChain as the render target,
when you finished your drawings, call the present method of the new SwapChain instead of the IDirect3DDevice9::present,
when your window is resized, just release the additional SwapChain and re-create it with new back buffer sizes and do the render target setting thing again, now, you don`t have to do the device reset which is very slow.
if you have any more questions, email me : xux660@hotmail.com
I am a chinese so my english is not so good, forgive me.