|
发表于 2004-8-12 10:15:00
|
显示全部楼层
Re:请问如何在mfc多视图情况下,显示DX的图形呢?
以下摘自dx9c sdk
In addition to the swap chain that is owned and manipulated through the IDirect3DDevice9 interface, an application can create additional swap chains in order to present multiple views from the same device. The application typically creates one swap chain per view by using the IDirect3DDevice9::CreateAdditionalSwapChain method, and associates each swap chain with a particular window. The application renders images into the back buffers of each swap chain, and then presents them individually.
以前有一个dx8开发指南,里面特意提到注意多窗口不要创建多个设备,而增加swap chain.这样才能保证效率,具体做法是这样:
每个窗口建立一个D3DPRESENT_PARAMETERS,选一个窗口建立设备(一般是最大的那个窗口,这样可以共用一个depth buffer),然后建立多个swap chain,每个swapchain对应相应窗口的D3DPRESENT_PARAMETERS,然后get back buffer,得到render target.然后渲染时先SetRenderTarget(如果需要,也SetDepthStencilSurface),然后正常渲染需要的东西,然后用IDirect3DSwapChain9: resent显示. |
|