LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::SwapChainDescriptor Struct Reference

Swap chain descriptor structure. More...

#include <SwapChainFlags.h>

Public Attributes

const char * debugName = nullptr
 Optional name for debugging purposes. By default null.
Extent2D resolution
 Screen resolution (in pixels).
Format colorFormat = Format::Undefined
 Preferred color format for the swap-chain buffers. By default Format::Undefined.
Format depthStencilFormat = Format::Undefined
 Preferred depth-stencil format for the swap-chain. By default Format::Undefined.
int colorBits = 32
 Number of bits for each pixel in the color buffer. Should be 24 or 32. By default 32.
int depthBits = 24
 Number of bits for each pixel in the depth buffer. Should be 24, 32, or zero to disable depth buffer. By default 24.
int stencilBits = 8
 Number of bits for each pixel in the stencil buffer. Should be 8, or zero to disable stencil buffer. By default 8.
std::uint32_t samples = 1
 Number of samples for the swap-chain buffers. By default 1.
std::uint32_t swapBuffers = 2
 Number of swap buffers. By default 2 (for double-buffering).
bool fullscreen = false
 Specifies whether to create the swap-chain initially in fullscreen mode or windowed mode otherwise.
bool resizable = false
 Specifies whether to create the default surface for the swap-chain with the resizable attribute.

Detailed Description

Swap chain descriptor structure.

See also
RenderSystem::CreateSwapChain

Member Data Documentation

◆ colorBits

int LLGL::SwapChainDescriptor::colorBits = 32

Number of bits for each pixel in the color buffer. Should be 24 or 32. By default 32.

Remarks
This is only a hint to the renderer and there is no guarantee which hardware format is finally used for the color buffer. To determine the actual color format of a swap-chain, use the SwapChain::GetColorFormat function.
Note
This field is deprecated and ignored if colorFormat is not Format::Undefined; Use colorFormat instead!
See also
colorFormat
SwapChain::GetColorFormat
Todo
Deprecate these as soon as colorFormat fields is supported in all backends.

◆ colorFormat

Format LLGL::SwapChainDescriptor::colorFormat = Format::Undefined

Preferred color format for the swap-chain buffers. By default Format::Undefined.

Remarks
If this is Format::Undefined, the renderer picks a format automatically from the deprecated colorBits field (the default behavior). Otherwise the renderer uses this format if the presentation surface supports it, and falls back to its automatic selection if it does not. This is primarily intended to request an sRGB format (e.g. Format::BGRA8UNorm_sRGB), so the hardware performs the linear-to-sRGB conversion on write. To determine the actual color format of a swap-chain, use the SwapChain::GetColorFormat function.
See also
SwapChain::GetColorFormat

◆ debugName

const char* LLGL::SwapChainDescriptor::debugName = nullptr

Optional name for debugging purposes. By default null.

Remarks
The final name of the native hardware resource is implementation defined.
See also
RenderSystemChild::SetDebugName

◆ depthBits

int LLGL::SwapChainDescriptor::depthBits = 24

Number of bits for each pixel in the depth buffer. Should be 24, 32, or zero to disable depth buffer. By default 24.

Remarks
This is only a hint to the renderer and there is no guarantee which hardware format is finally used for the depth buffer. To determine the actual depth-stencil format of a swap-chain, use the SwapChain::GetDepthStencilFormat function.
Note
This field is deprecated and ignored if depthStencilFormat is not Format::Undefined; Use depthStencilFormat instead!
See also
depthStencilFormat
SwapChain::GetDepthStencilFormat
Todo
Deprecate these as soon as depthStencilFormat fields is supported in all backends.

◆ depthStencilFormat

Format LLGL::SwapChainDescriptor::depthStencilFormat = Format::Undefined

Preferred depth-stencil format for the swap-chain. By default Format::Undefined.

Remarks
If this is Format::Undefined, the renderer picks a format automatically from the deprecated depthBits and stencilBits fields (the default behavior). Otherwise this must be one of the depth-stencil formats, i.e. Format::D16UNorm, Format::D24UNormS8UInt, Format::D32Float, or Format::D32FloatS8X24UInt. The renderer uses this format if the hardware supports it and falls back to its automatic selection if it does not. To determine the actual depth-stencil format of a swap-chain, use the SwapChain::GetDepthStencilFormat function.
See also
SwapChain::GetDepthStencilFormat

◆ fullscreen

bool LLGL::SwapChainDescriptor::fullscreen = false

Specifies whether to create the swap-chain initially in fullscreen mode or windowed mode otherwise.

See also
SwapChain::ResizeBuffers
ResizeBuffersFlags::FullscreenMode

◆ resizable

bool LLGL::SwapChainDescriptor::resizable = false

Specifies whether to create the default surface for the swap-chain with the resizable attribute.

Remarks
If a custom surface is specified, this field is ignored.
See also
WindowFlags::Resizable

◆ resolution

Extent2D LLGL::SwapChainDescriptor::resolution

Screen resolution (in pixels).

Remarks
If the resolution contains a member with a value of 0, the video mode is invalid.
See also
RenderTarget::GetResolution

◆ samples

std::uint32_t LLGL::SwapChainDescriptor::samples = 1

Number of samples for the swap-chain buffers. By default 1.

Remarks
If the specified number of samples is not supported, LLGL will silently reduce it. The actual number of samples can be queried by the GetSamples function of the RenderTarget interface.
See also
RenderTarget::GetSamples

◆ stencilBits

int LLGL::SwapChainDescriptor::stencilBits = 8

Number of bits for each pixel in the stencil buffer. Should be 8, or zero to disable stencil buffer. By default 8.

Remarks
This is only a hint to the renderer and there is no guarantee which hardware format is finally used for the stencil buffer. To determine the actual depth-stencil format of a swap-chain, use the SwapChain::GetDepthStencilFormat function.
Note
This field is deprecated and ignored if depthStencilFormat is not Format::Undefined; Use depthStencilFormat instead!
See also
depthStencilFormat
SwapChain::GetDepthStencilFormat
Todo
Deprecate these as soon as depthStencilFormat fields is supported in all backends.

◆ swapBuffers

std::uint32_t LLGL::SwapChainDescriptor::swapBuffers = 2

Number of swap buffers. By default 2 (for double-buffering).

Remarks
This is only a hint to the renderer and there is no guarantee how many buffers are finally used for the swap chain. Especially OpenGL does not support custom swap chain sizes.
See also
SwapChain::GetCurrentSwapIndex
SwapChain::GetNumSwapBuffers

The documentation for this struct was generated from the following file: