Sign in to follow this  

Setting the render target back

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?


Share this post

Link to post
Share on other sites
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

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