Skip to content

Instantly share code, notes, and snippets.

@bananu7
Created February 19, 2014 18:52
Show Gist options
  • Save bananu7/03e1dc77a945c5ad1f44 to your computer and use it in GitHub Desktop.
Save bananu7/03e1dc77a945c5ad1f44 to your computer and use it in GitHub Desktop.
runGlisha loadFn drawFn callbacks = do
window <- glishaInit callbacks
userState <- loadFn
G.setKeyCallback window $ Just $ \window key scancode action mods -> do
when (action == G.KeyState'Pressed) (onKeyDown callbacks $ key)
when (action == G.KeyState'Released) (onKeyUp callbacks $ key)
glishaLoop window drawFn userState
glishaSuccessfulExit window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment