Sign in to follow this  

Test if active render target is back buffer

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

D3D9:
Use IDirect3DDevice9::GetRenderTarget() to get the currently set render target(s). Then use IDirect3DDevice9::GetBackBuffer() to get the back buffer. Compare the two surfaces (just the pointers will do), if they're equal then the currently set render target is the back buffer.

I'm not sure how to do it in D3D10, since I don't think it makes any particular distinctions between the back buffer and other render targets. Your best bet would probably be to just store the backbuffer's render target view when you create it, and use that for comparisons later on.

Share this post


Link to post
Share on other sites
I'd suggest that if possible you track which render target is active yourself. Normally this is possible, since you set them, and would be the fastest and most compatible method of doing this.

Share this post


Link to post
Share on other sites

This topic is 3598 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.

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