Jump to content
  • Advertisement
Sign in to follow this  
poigwym

Confusion Of Swapchain

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

The back buffer in swapchain is different from  render target , it look like a pointer to render target.

When I setRenderTarget( the one I create ), and render. When device->present, the dx present the render target which the back buffer points to, 

but not the one I create, though I set it as current render target. And I need to copy the data to the  render target the back buffer points to.

The question is how to make back buffer point to other render target (those I create ) ?

Share this post


Link to post
Share on other sites
Advertisement
You cannot and do not make the swap chain point to other render targets.

The _only_ way to render to the screen is to make a render target for the backbuffer. You first grab the back buffer of the swap chain and then create a render target view using that back buffer.

See http://www.directxtutorial.com/Lesson.aspx?lessonid=111-4-4 for some example code on the process of creating a render target view for the back buffer of a swap chain.

If for some reason you must create a render target view for a different texture (e.g. post processing) you must eventually copy that to a render target view on the back buffer to display it. This is frequently done by rendering a full-screen primitive with a shader that reads from the intermediary buffer and writes to the back buffer's render target view.

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!