Jump to content

  • Log In with Google      Sign In   
  • Create Account

IDirect3DDevice9::SetRenderTarget


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Naruto-kun   Members   -  Reputation: 339

Like
0Likes
Like

Posted 26 February 2013 - 06:14 AM

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



Sponsor:

#2 Hodgman   Moderators   -  Reputation: 32008

Like
1Likes
Like

Posted 26 February 2013 - 06:25 AM

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.



#3 Naruto-kun   Members   -  Reputation: 339

Like
0Likes
Like

Posted 26 February 2013 - 06:46 AM

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, 26 February 2013 - 08:21 AM.


#4 Naruto-kun   Members   -  Reputation: 339

Like
0Likes
Like

Posted 26 February 2013 - 10:22 AM

Anyone?


Edited by Naruto-kun, 26 February 2013 - 10:22 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS