mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2024-11-26 02:27:00 +00:00
Add pollEventsWithImGui (#13)
This commit is contained in:
parent
e220775b21
commit
e4b75e355f
@ -20,6 +20,7 @@ module DearImGui.SDL (
|
|||||||
sdl2NewFrame
|
sdl2NewFrame
|
||||||
, sdl2Shutdown
|
, sdl2Shutdown
|
||||||
, pollEventWithImGui
|
, pollEventWithImGui
|
||||||
|
, pollEventsWithImGui
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
@ -81,3 +82,12 @@ pollEventWithImGui = liftIO do
|
|||||||
[C.exp| void { ImGui_ImplSDL2_ProcessEvent((SDL_Event*) $(void* evPtr')) } |]
|
[C.exp| void { ImGui_ImplSDL2_ProcessEvent((SDL_Event*) $(void* evPtr')) } |]
|
||||||
|
|
||||||
pollEvent
|
pollEvent
|
||||||
|
|
||||||
|
-- | Like the SDL2 'pollEvents' function, while also dispatching the events to
|
||||||
|
-- Dear ImGui. See 'pollEventWithImGui'.
|
||||||
|
pollEventsWithImGui :: MonadIO m => m [Event]
|
||||||
|
pollEventsWithImGui = do
|
||||||
|
e <- pollEventWithImGui
|
||||||
|
case e of
|
||||||
|
Nothing -> pure []
|
||||||
|
Just e' -> ( e' : ) <$> pollEventsWithImGui
|
||||||
|
Loading…
Reference in New Issue
Block a user