1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
{-# LANGUAGE OverloadedStrings #-}
module Lazyfoo.Lesson01 (main) where
import Control.Concurrent (threadDelay)
import Foreign.C.Types
import SDL.Vect
import qualified SDL
screenWidth, screenHeight :: CInt
(screenWidth, screenHeight) = (640, 480)
main :: IO ()
main = do
SDL.initialize [SDL.InitVideo]
window <- SDL.createWindow "SDL Tutorial" SDL.defaultWindow { SDL.windowInitialSize = V2 screenWidth screenHeight }
SDL.showWindow window
screenSurface <- SDL.getWindowSurface window
let white = V4 maxBound maxBound maxBound maxBound
SDL.surfaceFillRect screenSurface Nothing white
SDL.updateWindowSurface window
threadDelay 2000000
SDL.destroyWindow window
SDL.quit
|