| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Utils.WindowLoop
Description
Per-frame window loop shared by windowed applications.
The skeleton — read swapchain, run a frame inside runFrame, recreate on
threwSwapchainError, advance — is the same for any
windowed Vulkan app. Each consumer only varies in:
- the per-swapchain state it holds (framebuffers, descriptor sets, …),
- the per-frame render action, and
- the "what to do on exit / per-frame metric" hooks.
runWindowLoop takes those four points as fields of a WindowLoop record.
Synopsis
- data WindowLoop s = WindowLoop {}
- runWindowLoop :: VulkanContext -> Swapchain -> IO Extent2D -> IO Bool -> WindowLoop s -> ResourceT IO ()
- noWindowState :: Swapchain -> ResourceT IO ((), ReleaseKey)
- noOnFrame :: Word64 -> Word64 -> ResourceT IO ()
- noOnExit :: Frame -> ResourceT IO ()
Documentation
data WindowLoop s Source #
Constructors
| WindowLoop | |
Fields
| |
Arguments
| :: VulkanContext | |
| -> Swapchain | |
| -> IO Extent2D | Get current drawable size (called on resize) |
| -> IO Bool | Per-frame poller; |
| -> WindowLoop s | |
| -> ResourceT IO () |
noWindowState :: Swapchain -> ResourceT IO ((), ReleaseKey) Source #
wlMkState for callers that have no per-swapchain state.