| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
WGPU.Internal.SwapChain
Description
Synopsis
- data SwapChain
- data SwapChainDescriptor = SwapChainDescriptor {}
- data PresentMode
- getSwapChainPreferredFormat :: MonadIO m => Surface -> Adapter -> m TextureFormat
- createSwapChain :: MonadIO m => Device -> Surface -> SwapChainDescriptor -> m SwapChain
- getSwapChainCurrentTextureView :: MonadIO m => SwapChain -> m TextureView
- swapChainPresent :: MonadIO m => SwapChain -> m ()
Types
data SwapChainDescriptor Source #
Describes a swapchain.
Constructors
| SwapChainDescriptor | |
Fields
| |
Instances
| Eq SwapChainDescriptor Source # | |
Defined in WGPU.Internal.SwapChain Methods (==) :: SwapChainDescriptor -> SwapChainDescriptor -> Bool # (/=) :: SwapChainDescriptor -> SwapChainDescriptor -> Bool # | |
| Show SwapChainDescriptor Source # | |
Defined in WGPU.Internal.SwapChain Methods showsPrec :: Int -> SwapChainDescriptor -> ShowS # show :: SwapChainDescriptor -> String # showList :: [SwapChainDescriptor] -> ShowS # | |
| ToRaw SwapChainDescriptor WGPUSwapChainDescriptor Source # | |
Defined in WGPU.Internal.SwapChain Methods raw :: SwapChainDescriptor -> ContT r IO WGPUSwapChainDescriptor Source # | |
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 |
| 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
| Eq PresentMode Source # | |
Defined in WGPU.Internal.SwapChain | |
| Show PresentMode Source # | |
Defined in WGPU.Internal.SwapChain Methods showsPrec :: Int -> PresentMode -> ShowS # show :: PresentMode -> String # showList :: [PresentMode] -> ShowS # | |
| ToRaw PresentMode WGPUPresentMode Source # | |
Defined in WGPU.Internal.SwapChain Methods raw :: PresentMode -> ContT r IO WGPUPresentMode Source # | |
Functions
getSwapChainPreferredFormat Source #
Arguments
| :: MonadIO m | |
| => Surface |
|
| -> Adapter |
|
| -> 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.
Arguments
| :: MonadIO m | |
| => Device |
|
| -> Surface |
|
| -> SwapChainDescriptor | Description of the |
| -> 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.