From 4230dee81a4da577772344d736b9194ea4fda8da Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Wed, 22 Jan 2014 17:19:53 -0500 Subject: switch to SDL HWSurface --- axis.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'axis.hs') diff --git a/axis.hs b/axis.hs index 3158c9d..6ecbe7e 100644 --- a/axis.hs +++ b/axis.hs @@ -177,7 +177,8 @@ main = warpMouse = do _ <- SDL.warpMouse (fromIntegral (sWidth `div` 2)) (fromIntegral (sHeight `div` 2)) return () - _ <- SDL.setVideoMode sWidth sHeight 32 [SDL.SWSurface, SDL.Resizable] + setVideoMode w h = SDL.setVideoMode w h 32 [SDL.HWSurface, SDL.Resizable, SDL.DoubleBuf] + _ <- setVideoMode sWidth sHeight _ <- SDL.TTF.init font <- SDL.TTF.openFont "LiberationMono-Bold.ttf" (chooseFontSize sWidth sHeight) @@ -204,7 +205,7 @@ main = Control.Monad.when restartVideo $ do let (w, h) = resolution' - screen <- SDL.setVideoMode w h 32 [SDL.SWSurface, SDL.Resizable] + _ <- setVideoMode w h return () let (w, h) = resolution' @@ -259,7 +260,7 @@ main = -- textBand videoSurface videoClipRect (SDL.Rect 0 140 0 70) font text -- Control.Monad.when (x /= 0 || y /= 0) warpMouse - _ <- SDL.updateRect videoSurface videoClipRect -- draw it all! probably a bad idea + _ <- SDL.flip videoSurface let framerate = 30 let delay = 1000 `div` framerate - 1000 * (floor $ dtime ds) -- cgit v1.2.3