aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Sunet <jeannekamikaze@gmail.com>2012-08-27 12:43:15 +0200
committerMarc Sunet <jeannekamikaze@gmail.com>2012-08-27 12:43:15 +0200
commit63bb9eb070b2b41012050c6c24343a4e9937efa5 (patch)
tree7fe56dcacf8814c08a8ded6309051ea5ec7df02b
parentff7bdbb784705e5f28d0857a282a783ba7e4e208 (diff)
Renamed keystate to buttonstate in getMouse
-rw-r--r--Spear/App/Input.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Spear/App/Input.hs b/Spear/App/Input.hs
index 8165d8b..3a6090f 100644
--- a/Spear/App/Input.hs
+++ b/Spear/App/Input.hs
@@ -99,15 +99,16 @@ getMouse oldMouse =
99 prop' xpos _ MouseDX = xpos - property oldMouse MouseX 99 prop' xpos _ MouseDX = xpos - property oldMouse MouseX
100 prop' _ ypos MouseDY = ypos - property oldMouse MouseY 100 prop' _ ypos MouseDY = ypos - property oldMouse MouseY
101 101
102 buttons = fmap toEnum [0..fromEnum (maxBound :: MouseButton)] 102 buttons = fmap toEnum [0..fromEnum (maxBound :: MouseButton)]
103 getKeystate = fmap (V.fromList . fmap ((==) GLFW.Press)) . 103 getButtonState =
104 mapM GLFW.getMouseButton . 104 fmap (V.fromList . fmap ((==) GLFW.Press)) .
105 fmap toGLFWbutton $ buttons 105 mapM GLFW.getMouseButton .
106 fmap toGLFWbutton $ buttons
106 in do 107 in do
107 Position xpos ypos <- get GLFW.mousePos 108 Position xpos ypos <- get GLFW.mousePos
108 keystate <- getKeystate 109 buttonState <- getButtonState
109 return $ Mouse 110 return $ Mouse
110 { button = getButton keystate 111 { button = getButton buttonState
111 , property = prop' (fromIntegral xpos) (fromIntegral ypos) 112 , property = prop' (fromIntegral xpos) (fromIntegral ypos)
112 } 113 }
113 114