Add new GLFW callback from 1.87 (#128)

This commit is contained in:
Alexander Bondarenko 2022-02-13 19:12:15 +03:00 committed by GitHub
parent ccdff36774
commit ae3fdb8bc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ module DearImGui.GLFW (
-- $callbacks -- $callbacks
, glfwWindowFocusCallback , glfwWindowFocusCallback
, glfwCursorEnterCallback , glfwCursorEnterCallback
, glfwCursorPosCallback
, glfwMouseButtonCallback , glfwMouseButtonCallback
, glfwScrollCallback , glfwScrollCallback
, glfwKeyCallback , glfwKeyCallback
@ -108,6 +109,20 @@ glfwCursorEnterCallback window entered = liftIO do
where where
windowPtr = castPtr $ unWindow window 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<GLFWwindow *>(
$(void * windowPtr)
),
$(double x),
$(double y)
);
} |]
where
windowPtr = castPtr $ unWindow window
glfwMouseButtonCallback :: MonadIO m => Window -> CInt -> CInt -> CInt -> m () glfwMouseButtonCallback :: MonadIO m => Window -> CInt -> CInt -> CInt -> m ()
glfwMouseButtonCallback window button action mods = liftIO do glfwMouseButtonCallback window button action mods = liftIO do
[C.exp| void { [C.exp| void {