Sign in to follow this  
LevyDee

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
[code]
IDirect3DSurface9* backBuffer;
_d3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE::D3DBACKBUFFER_TYPE_MONO, &backBuffer);
_d3dDevice->SetRenderTarget(0, backBuffer);
[/code]

This works, but it feels completely wrong.

What am I missing here?

Thanks!

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