Sign in to follow this  
Bangladesh

Multiple rendertargets in multiple views

Recommended Posts

Bangladesh    122
I'm sure someone knows why I can't get this to work. Problem: Having one or more childwindows (in windowed mode) and render to them. What I currently do: A main window has four childwindows sitting inside it. The main window gets the directX-device assigned to it. Then I use CreateAdditionalSwapChain to create four buffers for the four childwindows, taking care of setting the correct HWNDs in the D3DPRESENT_PARAMETERS structure while doing so. Then, using GetBackBuffer() on the swapchain-object to get a pointer to the backbuffer/rendersurface of that chain, I use SetRenderTarget() to set the previous mentioned rendersurface as active and draw on it. I repeat this step for the other three childwindows. Error: This does not work. Setting a new rendertarget seems difficult and when I do it like above, the switch goes through without errors but the draw does not switch. I suspect the swapchain draws into the HWND set in D3DPRESENT_PARAMETERS.hDeviceWindow so setting a swapchains backbuffer as the active rendertarget should render into that window right? But it currently doesn't. Just to the HWND set when declaring the device (there you set the HWND in both the d3dpp and the method). Other thing that's bothering me. Sometimes the rendertarget doesn't get swapped out, even then the application has ended. If I print text to the screen, end the application and removed the code that prints the text, when I restart the application, the text is till there! I hope someone can help me out of this dilemma! How do I get to render into additional created child-windows? (In windows mode). Using: Visual Studio C++ 2005 Express Edition, DirectX SKD 2006 (April).

Share this post


Link to post
Share on other sites
circlesoft    1178
It sounds like you have the right idea, so I just have a few questions:

(1) Are you getting any debug output from the debug runtimes? Even though the call is succeeding, maybe there is something going on that you don't know about.

(2) Are you presenting each swap chain individually (IDirect3DSwapChain9::Present())?

(3) Have you tried setting the device's D3DPRESENT_PARAMETERS.hDeviceWindow to NULL?

Edit: ahh beaten by ntnet [grin]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this