Skip to content

Commit

Permalink
Added interface to enable/disable the mouse cursor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Cowley committed Dec 20, 2011
1 parent d86fd07 commit 844bc35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GLFW-b.cabal
@@ -1,5 +1,5 @@
name: GLFW-b
version: 0.1.0.0
version: 0.1.0.1

category: Graphics

Expand Down
13 changes: 13 additions & 0 deletions src/Graphics/UI/GLFW.hsc
Expand Up @@ -73,6 +73,8 @@ module Graphics.UI.GLFW
, setMouseButtonCallback
, setMousePositionCallback
, setMouseWheelCallback
, enableMouseCursor
, disableMouseCursor
--
, MouseButton(..)
, MouseButtonCallback
Expand Down Expand Up @@ -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 ()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 844bc35

Please sign in to comment.