Jump to content
  • Advertisement
Sign in to follow this  
jameszhao00

Test if active render target is back buffer

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

Advertisement
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
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!