Jump to content
  • Advertisement
Sign in to follow this  
dachande

Multiple Viewports / Swap Chain

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

Hi all, I'm having a quick look at drawing to multiple views in a windowed DX9 app... With the search facility disabled at the moment, I can't look look for answers just yet!... Looking at the documentation, it is recommended that using multiple swap chains is the best way to get multiple views. Looking at the Device Present() function, it is possible to specify a destination rectangle to draw to (so long as the default swap chain is created using D3DSWAPEFFECT_COPY). Is this not a viable way of creating multiple viewports? Render each view one after then other, and present them to different parts of the window? Or have I missed something?! I can see that if the viewports are of different sizes, then using Present with a destination rectangle might obscure the final image when it's resized, but this is not a problem if all windows are of the same size... Would anyone mind filling me in? Thanks in advance, Dachande

Share this post


Link to post
Share on other sites
Advertisement
Within the same window, you can use Viewports to render multiple views (you don't even need to specify the target rect in Present(), just set the correct viewport).
Swap chains are only required if you have multiple windows. They also come in handy if you resize your window often and want to avoid scaling (swap chain can be reset very fast).

HTH,
Pat.

Share this post


Link to post
Share on other sites
Thanks darookie,

It's always nice to know that I'm on the right tracks!..

Reading this article:

http://www.fairyengine.com/articles/dxmultiviews.htm

Suggests that swap chains are required for multiple views, which got me wondering a little...

Can I assume then, that the only reason why the DXC docs recommend swap chains, is to avoid scaling? Is it slower to adjust the viewport than the swap chain?


Thanks again for your speedy response,

Dachande

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!