diff --git a/src/DearImGui/GLFW.hs b/src/DearImGui/GLFW.hs index a476144..6f8fcc6 100644 --- a/src/DearImGui/GLFW.hs +++ b/src/DearImGui/GLFW.hs @@ -23,6 +23,7 @@ module DearImGui.GLFW ( -- $callbacks , glfwWindowFocusCallback , glfwCursorEnterCallback + , glfwCursorPosCallback , glfwMouseButtonCallback , glfwScrollCallback , glfwKeyCallback @@ -108,6 +109,20 @@ glfwCursorEnterCallback window entered = liftIO do where windowPtr = castPtr $ unWindow window +glfwCursorPosCallback :: MonadIO m => Window -> CDouble -> CDouble -> m () +glfwCursorPosCallback window x y = liftIO do + [C.exp| void { + ImGui_ImplGlfw_CursorPosCallback( + static_cast( + $(void * windowPtr) + ), + $(double x), + $(double y) + ); + } |] + where + windowPtr = castPtr $ unWindow window + glfwMouseButtonCallback :: MonadIO m => Window -> CInt -> CInt -> CInt -> m () glfwMouseButtonCallback window button action mods = liftIO do [C.exp| void {