pituicat/src/Util.hs
2021-01-12 00:53:00 +01:00

35 lines
628 B
Haskell

module Util where
import Affection
import qualified SDL
import qualified SDL.Internal.Numbered as SDL
import Linear
-- internal imports
import Types.Application
import Types.Subsystems
globalKeyHandle
:: GameData
-> KeyboardMessage
-> Affection ()
globalKeyHandle gd mesg@(MsgKeyboardEvent time win motion repeat keysym) =
case mesg of
MsgKeyboardEvent
_
_
SDL.Pressed
False
(SDL.Keysym SDL.ScancodeF11 _ mod) ->
if mod == SDL.fromNumber 0
then
toggleScreen 0
else
return ()
_ -> return ()
constG :: V2 Double
constG = V2 0 (-500)