vulkan-utils-0.5.11.0: Utils for the vulkan package
Safe HaskellNone
LanguageHaskell2010

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

Documentation

data WindowLoop s Source #

Constructors

WindowLoop 

Fields

runWindowLoop Source #

Arguments

:: VulkanContext 
-> Swapchain 
-> IO Extent2D

Get current drawable size (called on resize)

-> IO Bool

Per-frame poller; True means quit

-> WindowLoop s 
-> ResourceT IO () 

noWindowState :: Swapchain -> ResourceT IO ((), ReleaseKey) Source #

wlMkState for callers that have no per-swapchain state.