diff options
-rw-r--r-- | axis.hs | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -177,7 +177,8 @@ main = | |||
177 | warpMouse = do | 177 | warpMouse = do |
178 | _ <- SDL.warpMouse (fromIntegral (sWidth `div` 2)) (fromIntegral (sHeight `div` 2)) | 178 | _ <- SDL.warpMouse (fromIntegral (sWidth `div` 2)) (fromIntegral (sHeight `div` 2)) |
179 | return () | 179 | return () |
180 | _ <- SDL.setVideoMode sWidth sHeight 32 [SDL.SWSurface, SDL.Resizable] | 180 | setVideoMode w h = SDL.setVideoMode w h 32 [SDL.HWSurface, SDL.Resizable, SDL.DoubleBuf] |
181 | _ <- setVideoMode sWidth sHeight | ||
181 | 182 | ||
182 | _ <- SDL.TTF.init | 183 | _ <- SDL.TTF.init |
183 | font <- SDL.TTF.openFont "LiberationMono-Bold.ttf" (chooseFontSize sWidth sHeight) | 184 | font <- SDL.TTF.openFont "LiberationMono-Bold.ttf" (chooseFontSize sWidth sHeight) |
@@ -204,7 +205,7 @@ main = | |||
204 | 205 | ||
205 | Control.Monad.when restartVideo $ do | 206 | Control.Monad.when restartVideo $ do |
206 | let (w, h) = resolution' | 207 | let (w, h) = resolution' |
207 | screen <- SDL.setVideoMode w h 32 [SDL.SWSurface, SDL.Resizable] | 208 | _ <- setVideoMode w h |
208 | return () | 209 | return () |
209 | 210 | ||
210 | let (w, h) = resolution' | 211 | let (w, h) = resolution' |
@@ -259,7 +260,7 @@ main = | |||
259 | -- textBand videoSurface videoClipRect (SDL.Rect 0 140 0 70) font text | 260 | -- textBand videoSurface videoClipRect (SDL.Rect 0 140 0 70) font text |
260 | -- Control.Monad.when (x /= 0 || y /= 0) warpMouse | 261 | -- Control.Monad.when (x /= 0 || y /= 0) warpMouse |
261 | 262 | ||
262 | _ <- SDL.updateRect videoSurface videoClipRect -- draw it all! probably a bad idea | 263 | _ <- SDL.flip videoSurface |
263 | 264 | ||
264 | let framerate = 30 | 265 | let framerate = 30 |
265 | let delay = 1000 `div` framerate - 1000 * (floor $ dtime ds) | 266 | let delay = 1000 `div` framerate - 1000 * (floor $ dtime ds) |