Jump to content
  • Advertisement
Sign in to follow this  
schupf

DX9 render targets

This topic is 2544 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

Hello,

in D3D9 a Win32 window and a texture could be considered as render targets (something I can render into). Let's say I have 3 windows and 1 render texture (a texture I want to render into).
If I want to render into any of the windows, the code (pseudo!) is basically this:

for each window
win->swapChainWindow->getBackBuffer(&backBuffer);
device->setRenderTarget(backbuffer);
device->begin();
render stuff
device->end();
win->swapChainWindow->present();

When I want to render into the render texture the code looks like this:

renderTexture->getSurface(0. &backBuffer);
device->setRenderTarget(backbuffer);
device->begin();
render stuff
device->end();
// Now the texture is alreay updated? No need for a call to Present()?

So in order to update the render texture I do NOT have to call Present()? Are my assumptions correct?

Share this post


Link to post
Share on other sites
Advertisement
Yes, you're correct. Present is used to transfer a rendered back-buffer to the screen, so it doesn't make sense for off-screen (render-to-texture) operations.

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!