From 844bc3565a8f9fd38990e7b7704e2935abe490c2 Mon Sep 17 00:00:00 2001 From: Anthony Cowley Date: Tue, 20 Dec 2011 11:22:37 -0500 Subject: [PATCH] Added interface to enable/disable the mouse cursor. --- GLFW-b.cabal | 2 +- src/Graphics/UI/GLFW.hsc | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/GLFW-b.cabal b/GLFW-b.cabal index c20f8f9..74c12c5 100644 --- a/GLFW-b.cabal +++ b/GLFW-b.cabal @@ -1,5 +1,5 @@ name: GLFW-b -version: 0.1.0.0 +version: 0.1.0.1 category: Graphics diff --git a/src/Graphics/UI/GLFW.hsc b/src/Graphics/UI/GLFW.hsc index fdcb922..853319a 100644 --- a/src/Graphics/UI/GLFW.hsc +++ b/src/Graphics/UI/GLFW.hsc @@ -73,6 +73,8 @@ module Graphics.UI.GLFW , setMouseButtonCallback , setMousePositionCallback , setMouseWheelCallback + , enableMouseCursor + , disableMouseCursor -- , MouseButton(..) , MouseButtonCallback @@ -163,6 +165,9 @@ foreign import ccall glfwSleep :: CDouble -> IO () foreign import ccall glfwGetGLVersion :: Ptr CInt -> Ptr CInt -> Ptr CInt -> IO () +foreign import ccall glfwEnable :: CInt -> IO () +foreign import ccall glfwDisable :: CInt -> IO () + type GlfwCharCallback = CInt -> CInt -> IO () type GlfwKeyCallback = CInt -> CInt -> IO () type GlfwMouseButtonCallback = CInt -> CInt -> IO () @@ -825,6 +830,14 @@ setMouseWheelCallback cb = do glfwSetMouseWheelCallback ccb storeCallback mouseWheelCallback ccb +-- |Make the mouse cursor visible. +enableMouseCursor :: IO () +enableMouseCursor = glfwEnable (#const GLFW_MOUSE_CURSOR) + +-- |Make the mouse cursor invisible. +disableMouseCursor :: IO () +disableMouseCursor = glfwDisable (#const GLFW_MOUSE_CURSOR) + -- -- -- -- -- -- -- -- -- -- data MouseButton