Class DxgiSwapChain1
An IDXGISwapChain interface implements one or more surfaces for storing rendered data before presenting it to an output.
Inherited Members
Namespace: JeremyAnsel.DirectX.Dxgi
Assembly: JeremyAnsel.DirectX.Dxgi.dll
Syntax
public sealed class DxgiSwapChain1 : DxgiDeviceSubObject, IDisposable, IDxgiReleasable
Properties
| Edit this page View SourceDescription
Gets a description of the swap chain.
Declaration
public DxgiSwapChainDesc Description { get; }
Property Value
| Type | Description |
|---|---|
| DxgiSwapChainDesc |
FrameStatistics
Gets performance statistics about the last render frame.
Declaration
public DxgiFrameStatistics FrameStatistics { get; }
Property Value
| Type | Description |
|---|---|
| DxgiFrameStatistics |
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 SourceLastPresentCount
Gets the number of times that IDXGISwapChain::Present or IDXGISwapChain1::Present1 has been called.
Declaration
public uint LastPresentCount { get; }
Property Value
| Type | Description |
|---|---|
| uint |
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 DxgiOutput1? GetContainingOutput()
Returns
| Type | Description |
|---|---|
| DxgiOutput1 | 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 DxgiOutput1?)
Get the state associated with full-screen mode.
Declaration
public bool GetFullscreenState(out DxgiOutput1? target)
Parameters
| Type | Name | Description |
|---|---|---|
| DxgiOutput1 | 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. |
GetSurface(uint)
Accesses one of the swap-chain's back buffers.
Declaration
public DxgiSurface1? GetSurface(uint buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | buffer | A zero-based buffer index. |
Returns
| Type | Description |
|---|---|
| DxgiSurface1 | A back-buffer surface. |
Present(uint, DxgiPresentOptions)
Presents a rendered image to the user.
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 | The swap-chain presentation options. |
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, DxgiOutput1?)
Sets the display state to windowed or full screen.
Declaration
public void SetFullscreenState(bool fullscreen, DxgiOutput1? target)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | fullscreen | A value indicating whether to set the display state to windowed or full screen. |
| DxgiOutput1 | target | A pointer to an |