mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2024-11-22 08:56:59 +00:00
Add new GLFW callback from 1.87 (#128)
This commit is contained in:
parent
ccdff36774
commit
ae3fdb8bc3
@ -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<GLFWwindow *>(
|
||||
$(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 {
|
||||
|
Loading…
Reference in New Issue
Block a user