SwapChain Class |
Language: |
Manipulates a swap chain.
Visual Basic NotInheritable Public Class SwapChain
Inherits MarshalByRefObject
Implements IDisposableC# public sealed class SwapChain : MarshalByRefObject, IDisposable C++ public ref class SwapChain sealed : MarshalByRefObject, IDisposable JScript public final class SwapChain extends MarshalByRefObject implements IDisposable
ObjectMarshalByRefObjectSwapChain
Each device always has at least one swap chain, which is known as the implicit swap chain. Additional SwapChain objects can be created for rendering multiple views from the same device.
Create an Additional Swap Chain
This example demonstrates how to create an additional swap chain using the SwapChain class. Additional swap chains are useful for supporting multiple viewports; for example, a single window partitioned into four sub-windows, each with different views of the same scene.
In Microsoft DirectX 9.0 for Managed Code, each Device is created with a default swap chain known as the implicit swap chain. Using the SwapChain class allows creation of additional swap chains for rendering operations.
To create a new swap chain:
- Create an instance of the PresentParameters class, or use an existing instance and set the presentation properties to the values you need for the swap chain.
- Then create a swap chain object using the SwapChain class constructor.
In the following C# code example, device is assumed to be the rendering Device.
[C#]
// Create a swap chain using an existing instance of PresentParameters. SwapChain sc = new SwapChain(device, presentParams);
Namespace Microsoft.DirectX.Direct3D Assembly Microsoft.DirectX.Direct3D (microsoft.directx.direct3d.dll) Strong Name Microsoft.DirectX.Direct3D, Version=1.0.900.0, Culture=neutral, PublicKeyToken=d3231b57b74a1492
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center