Class DxgiSwapChain2
Provides presentation capabilities that are enhanced from IDXGISwapChain. These presentation capabilities consist of specifying dirty rectangles and scroll rectangle to optimize the presentation.
Inherited Members
Namespace: JeremyAnsel.DirectX.Dxgi
Assembly: JeremyAnsel.DirectX.Dxgi.dll
Syntax
public sealed class DxgiSwapChain2 : DxgiDeviceSubObject, IDisposable, IDxgiReleasable
Properties
| Edit this page View SourceBackgroundColor
Gets or sets the background color of the swap chain.
Declaration
public DxgiColorRgba BackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| DxgiColorRgba |
Description
Gets a description of the swap chain.
Declaration
public DxgiSwapChainDesc1 Description { get; }
Property Value
| Type | Description |
|---|---|
| DxgiSwapChainDesc1 |
FrameStatistics
Gets performance statistics about the last render frame.
Declaration
public DxgiFrameStatistics FrameStatistics { get; }
Property Value
| Type | Description |
|---|---|
| DxgiFrameStatistics |
FullscreenDescription
Gets a description of a full-screen swap chain.
Declaration
public DxgiSwapChainFullscreenDesc FullscreenDescription { get; }
Property Value
| Type | Description |
|---|---|
| DxgiSwapChainFullscreenDesc |
Handle
Gets an handle representing the DXGI object interface.
Declaration
public override object Handle { get; }
Property Value
| Type | Description |
|---|---|
| object |
Overrides
| Edit this page View SourceIsTemporaryMonoSupported
Gets a value indicating whether a swap chain supports “temporary mono.”
Declaration
public bool IsTemporaryMonoSupported { get; }
Property Value
| Type | Description |
|---|---|
| bool |
LastPresentCount
Gets the number of times that IDXGISwapChain::Present or IDXGISwapChain1::Present1 has been called.
Declaration
public uint LastPresentCount { get; }
Property Value
| Type | Description |
|---|---|
| uint |
Rotation
Gets or sets the rotation of the back buffers for the swap chain.
Declaration
public DxgiModeRotation Rotation { get; set; }
Property Value
| Type | Description |
|---|---|
| DxgiModeRotation |
WindowHandle
Gets the underlying HWND for this swap-chain object.
Declaration
public nint WindowHandle { get; }
Property Value
| Type | Description |
|---|---|
| nint |
Methods
| Edit this page View SourceGetBuffer(uint, Guid)
Accesses one of the swap-chain's back buffers.
Declaration
public object? GetBuffer(uint buffer, Guid riid)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | buffer | A zero-based buffer index. |
| Guid | riid | The type of interface used to manipulate the buffer. |
Returns
| Type | Description |
|---|---|
| object | A pointer to a back-buffer interface. |
GetContainingOutput()
Get the output (the display monitor) that contains the majority of the client area of the target window.
Declaration
public DxgiOutput2? GetContainingOutput()
Returns
| Type | Description |
|---|---|
| DxgiOutput2 | The output interface. |
GetFullscreenState()
Get the state associated with full-screen mode.
Declaration
public bool GetFullscreenState()
Returns
| Type | Description |
|---|---|
| bool | A value indicating whether to set the display state to windowed or full screen. |
GetFullscreenState(out DxgiOutput2?)
Get the state associated with full-screen mode.
Declaration
public bool GetFullscreenState(out DxgiOutput2? target)
Parameters
| Type | Name | Description |
|---|---|---|
| DxgiOutput2 | target | The output target when the mode is full screen. |
Returns
| Type | Description |
|---|---|
| bool | A value indicating whether to set the display state to windowed or full screen. |
GetRestrictToOutput()
Gets the output (the display monitor) to which you can restrict the contents of a present operation.
Declaration
public DxgiOutput2? GetRestrictToOutput()
Returns
| Type | Description |
|---|---|
| DxgiOutput2 | The |
GetSurface(uint)
Accesses one of the swap-chain's back buffers.
Declaration
public DxgiSurface2? GetSurface(uint buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | buffer | A zero-based buffer index. |
Returns
| Type | Description |
|---|---|
| DxgiSurface2 | A back-buffer surface. |
Present(uint, DxgiPresentOptions)
Presents a frame on the display screen.
Declaration
public void Present(uint syncInterval, DxgiPresentOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | syncInterval | An integer that specifies how to synchronize presentation of a frame with the vertical blank. |
| DxgiPresentOptions | options | An integer value that contains swap-chain presentation options. |
Present(uint, DxgiPresentOptions, DxgiRect[]?, DxgiRect, DxgiPoint)
Presents a frame on the display screen.
Declaration
public void Present(uint syncInterval, DxgiPresentOptions options, DxgiRect[]? dirtyRects, DxgiRect scrollRect, DxgiPoint scrollOffset)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | syncInterval | An integer that specifies how to synchronize presentation of a frame with the vertical blank. |
| DxgiPresentOptions | options | An integer value that contains swap-chain presentation options. |
| DxgiRect[] | dirtyRects | A list of updated rectangles that you update in the back buffer for the presented frame. |
| DxgiRect | scrollRect | The rectangle of the previous frame from which the runtime bit-block transfers content. |
| DxgiPoint | scrollOffset | The offset of the scrolled area that goes from the source rectangle (of previous frame) to the destination rectangle (of current frame). |
ResizeBuffers(uint, uint, uint, DxgiFormat, DxgiSwapChainOptions)
Changes the swap chain's back buffer size, format, and number of buffers. This should be called when the application window is resized.
Declaration
public void ResizeBuffers(uint bufferCount, uint width, uint height, DxgiFormat format, DxgiSwapChainOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | bufferCount | The number of buffers in the swap chain (including all back and front buffers). This number can be different from the number of buffers with which you created the swap chain. |
| uint | width | New width of the back buffer. If you specify zero, DXGI will use the width of the client area of the target window. |
| uint | height | New height of the back buffer. If you specify zero, DXGI will use the height of the client area of the target window. |
| DxgiFormat | format | A |
| DxgiSwapChainOptions | options | The options for swap-chain behavior. |
ResizeTarget(DxgiModeDesc)
Resizes the output target.
Declaration
public void ResizeTarget(DxgiModeDesc targetParameters)
Parameters
| Type | Name | Description |
|---|---|---|
| DxgiModeDesc | targetParameters | A |
SetFullscreenState(bool)
Sets the display state to windowed or full screen.
Declaration
public void SetFullscreenState(bool fullscreen)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | fullscreen | A value indicating whether to set the display state to windowed or full screen. |
SetFullscreenState(bool, DxgiOutput2?)
Sets the display state to windowed or full screen.
Declaration
public void SetFullscreenState(bool fullscreen, DxgiOutput2? target)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | fullscreen | A value indicating whether to set the display state to windowed or full screen. |
| DxgiOutput2 | target | A pointer to an |