Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
SwapChainDescriptor | |
|
Instances
Eq SwapChainDescriptor Source # | |
Defined in WGPU.Internal.SwapChain (==) :: SwapChainDescriptor -> SwapChainDescriptor -> Bool # (/=) :: SwapChainDescriptor -> SwapChainDescriptor -> Bool # | |
Show SwapChainDescriptor Source # | |
Defined in WGPU.Internal.SwapChain showsPrec :: Int -> SwapChainDescriptor -> ShowS # show :: SwapChainDescriptor -> String # showList :: [SwapChainDescriptor] -> ShowS # | |
ToRaw SwapChainDescriptor WGPUSwapChainDescriptor Source # | |
Defined in WGPU.Internal.SwapChain |
data PresentMode Source #
Behaviour of the presentation engine based on frame rate.
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 (==) :: PresentMode -> PresentMode -> Bool # (/=) :: PresentMode -> PresentMode -> Bool # | |
Show PresentMode Source # | |
Defined in WGPU.Internal.SwapChain showsPrec :: Int -> PresentMode -> ShowS # show :: PresentMode -> String # showList :: [PresentMode] -> ShowS # | |
ToRaw PresentMode WGPUPresentMode Source # | |
Defined in WGPU.Internal.SwapChain raw :: PresentMode -> ContT r IO WGPUPresentMode Source # |
Functions
getSwapChainPreferredFormat Source #
:: 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.
:: 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 #
:: 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.