wgpu-hs-0.4.0.0: WGPU
Safe HaskellNone
LanguageHaskell2010

WGPU.Internal.SwapChain

Description

 
Synopsis

Types

data SwapChain Source #

Instances

Instances details
Eq SwapChain Source # 
Instance details

Defined in WGPU.Internal.SwapChain

Show SwapChain Source # 
Instance details

Defined in WGPU.Internal.SwapChain

ToRaw SwapChain WGPUSwapChain Source # 
Instance details

Defined in WGPU.Internal.SwapChain

data SwapChainDescriptor Source #

Describes a swapchain.

Constructors

SwapChainDescriptor 

Fields

data PresentMode Source #

Behaviour of the presentation engine based on frame rate.

Constructors

PresentModeImmediate

The presentation engine does not wait for a vertical blanking period and the request is presented immediately. This is a low-latency presentation mode, but visible tearing may be observed. Will fallback to Fifo if unavailable on the selected platform and backend. Not optimal for mobile.

PresentModeMailbox

The presentation engine waits for the next vertical blanking period to update the current image, but frames may be submitted without delay. This is a low-latency presentation mode and visible tearing will not be observed. Will fallback to Fifo if unavailable on the selected platform and backend. Not optimal for mobile.

PresentModeFifo

The presentation engine waits for the next vertical blanking period to update the current image. The framerate will be capped at the display refresh rate, corresponding to the VSync. Tearing cannot be observed. Optimal for mobile.

Instances

Instances details
Eq PresentMode Source # 
Instance details

Defined in WGPU.Internal.SwapChain

Show PresentMode Source # 
Instance details

Defined in WGPU.Internal.SwapChain

ToRaw PresentMode WGPUPresentMode Source # 
Instance details

Defined in WGPU.Internal.SwapChain

Functions

getSwapChainPreferredFormat Source #

Arguments

:: MonadIO m 
=> Surface

Surface for which to obtain an optimal texture format.

-> Adapter

Adapter for which to obtain an optimal texture format.

-> m TextureFormat

IO action which returns the optimal texture format.

Returns an optimal texture format to use for the swapchain with this adapter and surface.

createSwapChain Source #

Arguments

:: MonadIO m 
=> Device

Device for which the SwapChain will be created.

-> Surface

Surface for which the SwapChain will be created.

-> SwapChainDescriptor

Description of the SwapChain to be created.

-> m SwapChain

IO action which creates the swap chain.

Createa a new SwapChain which targets a Surface.

To determine the preferred TextureFormat for the Surface, use the getSwapChainPreferredFormat function.

getSwapChainCurrentTextureView Source #

Arguments

:: MonadIO m 
=> SwapChain

Swap chain from which to fetch the current texture view.

-> m TextureView

IO action which returns the current swap chain texture view.

Get the TextureView for the current swap chain frame.

swapChainPresent Source #

Arguments

:: MonadIO m 
=> SwapChain

Swap chain to present.

-> m ()

IO action which presents the swap chain image.

Present the latest swap chain image.