Jump to content
  • Advertisement
Sign in to follow this  
Naruto-kun

IDirect3DDevice9::SetRenderTarget

This topic is 1945 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys

 

If i have created a separate swap chain for a child window that i want to render to, how would i get its position in the RenderTargetIndex so I can use SetRenderTarget?

 

Thanks

JB

Share this post


Link to post
Share on other sites
Advertisement

That's not what the index is for. When drawing, the triangles are drawn to the currently bound render target(s). Usually you only have a single render-target bound at a time, to index 0, however by using different indices, you can bind more than one render target simultaneously. This allows your pixel shader to output multiple colour values -- the triangle is drawn to the same position to every bound render-target, but different colour values are written. This is known as MRT (multiple render targets) and is usually how deferred rendering is implemented.

 

You use the Present function to make swap-chains appear on the screen, or GetBackBuffer to retrieve a swap-chain object's internal render-target that will be presented.

Share this post


Link to post
Share on other sites

Ok...I tried to mod this example: http://www.mvps.org/directx/articles/rendering_to_multiple_windows.htm

 

to work with DirectX9 but it appears there are certain things done here that i cant do. I tried switching to getting the back buffer of my swapchain and using ColorFill on it but more often than not i get the same scene as what is being rendered to the main window and then the program totally freezes. Any one got any ideas? So far there seems to be almost nil on the web about drawing to child windows without interfering with the main window...

Edited by Naruto-kun

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!