We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e220775 commit e4b75e3Copy full SHA for e4b75e3
src/DearImGui/SDL.hs
@@ -20,6 +20,7 @@ module DearImGui.SDL (
20
sdl2NewFrame
21
, sdl2Shutdown
22
, pollEventWithImGui
23
+ , pollEventsWithImGui
24
)
25
where
26
@@ -81,3 +82,12 @@ pollEventWithImGui = liftIO do
81
82
[C.exp| void { ImGui_ImplSDL2_ProcessEvent((SDL_Event*) $(void* evPtr')) } |]
83
84
pollEvent
85
+
86
+-- | Like the SDL2 'pollEvents' function, while also dispatching the events to
87
+-- Dear ImGui. See 'pollEventWithImGui'.
88
+pollEventsWithImGui :: MonadIO m => m [Event]
89
+pollEventsWithImGui = do
90
+ e <- pollEventWithImGui
91
+ case e of
92
+ Nothing -> pure []
93
+ Just e' -> ( e' : ) <$> pollEventsWithImGui
0 commit comments