mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2025-07-04 20:18:47 +02:00
Return Bool when appropriate (#11)
I also updated the main functions to use (/=0) instead of (==1).
This commit is contained in:
@ -42,9 +42,9 @@ Cpp.using "namespace ImGui"
|
||||
|
||||
|
||||
-- | Wraps @ImGui_ImplOpenGL2_Init@.
|
||||
openGL2Init :: MonadIO m => m ()
|
||||
openGL2Init :: MonadIO m => m Bool
|
||||
openGL2Init = liftIO do
|
||||
[C.exp| void { ImGui_ImplOpenGL2_Init(); } |]
|
||||
( 0 /= ) <$> [C.exp| bool { ImGui_ImplOpenGL2_Init() } |]
|
||||
|
||||
|
||||
-- | Wraps @ImGui_ImplOpenGL2_Shutdown@.
|
||||
|
@ -49,9 +49,9 @@ Cpp.using "namespace ImGui"
|
||||
|
||||
|
||||
-- | Wraps @ImGui_ImplSDL2_InitForOpenGL@.
|
||||
sdl2InitForOpenGL :: MonadIO m => Window -> GLContext -> m ()
|
||||
sdl2InitForOpenGL :: MonadIO m => Window -> GLContext -> m Bool
|
||||
sdl2InitForOpenGL (Window windowPtr) glContext = liftIO do
|
||||
[C.exp| void { ImGui_ImplSDL2_InitForOpenGL((SDL_Window*)$(void* windowPtr), $(void* glContextPtr)); } |]
|
||||
( 0 /= ) <$> [C.exp| bool { ImGui_ImplSDL2_InitForOpenGL((SDL_Window*)$(void* windowPtr), $(void* glContextPtr)) } |]
|
||||
where
|
||||
glContextPtr :: Ptr ()
|
||||
glContextPtr = unsafeCoerce glContext
|
||||
|
Reference in New Issue
Block a user