Skip to content

Instantly share code, notes, and snippets.

@573
Created July 14, 2012 18:35
Show Gist options
  • Save 573/3112571 to your computer and use it in GitHub Desktop.
Save 573/3112571 to your computer and use it in GitHub Desktop.
Test for Graphics.UI.SDL (for SDL binding library on hackage)
import qualified Graphics.UI.SDL as SDL
import qualified Graphics.UI.SDL.Events as E
main :: IO ()
main = do
SDL.init [SDL.InitEverything]
SDL.setVideoMode 640 480 32 []
SDL.setCaption "Video Test!" "video test"
eventLoop
SDL.quit
print "done"
where
eventLoop = SDL.waitEventBlocking >>= checkEvent
checkEvent (E.KeyUp _) = return ()
checkEvent _ = eventLoop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment