mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2024-11-22 16:57:00 +00:00
Relax MonadUnliftIO constraint on vulkanInit (#65)
This commit is contained in:
parent
c4f3a1e0b9
commit
1d6b7cc97b
@ -91,8 +91,11 @@ withVulkan initInfo renderPass action =
|
|||||||
vulkanShutdown
|
vulkanShutdown
|
||||||
( \ ( _, initResult ) -> action initResult )
|
( \ ( _, initResult ) -> action initResult )
|
||||||
|
|
||||||
-- | Wraps @ImGui_ImplVulkan_Init@
|
-- | Wraps @ImGui_ImplVulkan_Init@.
|
||||||
vulkanInit :: MonadUnliftIO m => InitInfo -> Vulkan.RenderPass -> m (FunPtr (Vulkan.Result -> IO ()), Bool)
|
--
|
||||||
|
-- Use 'vulkanShutdown' to clean up on shutdown.
|
||||||
|
-- Prefer using 'withVulkan' when possible, as it automatically handles cleanup.
|
||||||
|
vulkanInit :: MonadIO m => InitInfo -> Vulkan.RenderPass -> m (FunPtr (Vulkan.Result -> IO ()), Bool)
|
||||||
vulkanInit ( InitInfo {..} ) renderPass = do
|
vulkanInit ( InitInfo {..} ) renderPass = do
|
||||||
let
|
let
|
||||||
instancePtr :: Ptr Vulkan.Instance_T
|
instancePtr :: Ptr Vulkan.Instance_T
|
||||||
@ -133,6 +136,9 @@ vulkanInit ( InitInfo {..} ) renderPass = do
|
|||||||
}|]
|
}|]
|
||||||
pure ( checkResultFunPtr, initResult /= 0 )
|
pure ( checkResultFunPtr, initResult /= 0 )
|
||||||
|
|
||||||
|
-- | Wraps @ImGui_ImplVulkan_Shutdown@.
|
||||||
|
--
|
||||||
|
-- Counterpart to 'vulkanInit', for clean-up.
|
||||||
vulkanShutdown :: MonadIO m => (FunPtr a, b) -> m ()
|
vulkanShutdown :: MonadIO m => (FunPtr a, b) -> m ()
|
||||||
vulkanShutdown ( checkResultFunPtr, _ ) = liftIO do
|
vulkanShutdown ( checkResultFunPtr, _ ) = liftIO do
|
||||||
[C.exp| void { ImGui_ImplVulkan_Shutdown(); } |]
|
[C.exp| void { ImGui_ImplVulkan_Shutdown(); } |]
|
||||||
|
Loading…
Reference in New Issue
Block a user