Swap Chains

Started by
7 comments, last by discman1028 17 years, 11 months ago
Does anybody have some really specific information on swap chains? I'm trying to find out if it's possible to have different render states (AA settings, etc) in two scenes in the same window, without having to create multiple devices. Are there settings that having only one device will not allow? Thanks.
--== discman1028 ==--
Advertisement
Hi,

One thing for sure, resources are created by device. This mean, you can't use "two scene" to do your rendering. Normally, Swap Chain are use to build tools like 3DSMax, where's 4viewport are rendering the scene from different views.

Another thing, SwapChain are simply RenderTarget associated to a Device. So, RenderStates are perDevice not per SwapChains. Exception to this, is SwapChain creation where you supply PresentParameters, but normally it's the same as the one use for device creation.

PS: It make a while i've implemented SwapChains in my engine, maybe if you need more help, ill dig the code out...

Hope this helps,
Jonathan
None that I'm aware of. The only thing you can do with multiple swap chains that you don't need multiple devices for is rendering to a different swap chain (So you can composite two screens for instance).

All the device states that are lost when a device gets lost, and all resources are specific to a device, not a swap chain.
Quote:Original post by Evil Steve
... (So you can composite two screens for instance).


Can you elaborate on what this is?
--== discman1028 ==--
Notice in the below image there are several "views" of the scene. This is the kind of thing that could be done using multiple swap chains.



Also, you can learn more about swap chain creation and use here.

Cheers and good luck!
Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints
Quote:Original post by jwalsh
Notice in the below image there are several "views" of the scene.


I believe you can do that using just multiple viewports...
--== discman1028 ==--
Quote:Original post by discman1028
Quote:Original post by jwalsh
Notice in the below image there are several "views" of the scene.


I believe you can do that using just multiple viewports...
Yes, sort-of...

The multiple viewports technique requires that all views are still contained within the same parent window area. With multiple swap-chains you can target them at different window areas (new HWND's)...

In jwalsh's example you could define 4 regions and 4 swap-chains and have them arbitrarily placed in the window with other non-D3D controls/spacing between them. Or you could create one large D3D "window" and have 4 viewports that must be arranged next to each other - without any non-D3D controls/spacing between them.

Either is valid depending on what you want to achieve [smile]

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Ok, thanks.

Somewhat new question: say I went the direction of using multiple devices (w/ a single swap chain each). Say I want to change multisampling settings on one of the devices. (This is a setting that is specified during device creation.)

Do I have to Release() the device, and reload all things associated with the device? (textures, vertex buffers, etc) Or is there some way to preserve some things that were already loaded with the device?

Thanks.
--== discman1028 ==--
In other words: what's the best way to approach changing AA settings in-game? I know that releasing the device and re-creating it and all entities works, with a noticable pause of animation.
--== discman1028 ==--

This topic is closed to new replies.

Advertisement