Jump to content
  • Advertisement
Sign in to follow this  
LevyDee

Setting the render target back

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

I might be missing something here, or my brain not working, but after rendering to different surfaces for post processing ect... how would you set the render target back to the back buffer?

Right now, I am doing this

IDirect3DSurface9* backBuffer;
_d3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE::D3DBACKBUFFER_TYPE_MONO, &backBuffer);
_d3dDevice->SetRenderTarget(0, backBuffer);


This works, but it feels completely wrong.

What am I missing here?

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Nope, that's more or less correct (the only thing you're missing is a Release call after you set back - without it you'll leak the IDirect3DSurface9 - and some error checking).

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!