push examples to new sdl version
This commit is contained in:
parent
8ff4b216c3
commit
25fd9acffd
3 changed files with 10 additions and 6 deletions
|
@ -12,6 +12,7 @@ import Control.Monad (when)
|
|||
import qualified SDL hiding (Window(..))
|
||||
|
||||
import Data.Maybe (isJust, fromJust)
|
||||
import Data.String
|
||||
|
||||
data StateData = StateData
|
||||
{ sdSubs :: Subsystems
|
||||
|
@ -111,7 +112,7 @@ main = do
|
|||
[
|
||||
( 0
|
||||
, SDL.defaultWindow
|
||||
{ SDL.windowOpenGL = Just SDL.defaultOpenGL
|
||||
{ SDL.windowGraphicsContext = SDL.OpenGLContext SDL.defaultOpenGL
|
||||
{ SDL.glProfile = SDL.Core SDL.Normal 3 3
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +184,8 @@ handle es = do
|
|||
=<< consumeSDLEvents b
|
||||
=<< consumeSDLEvents c
|
||||
=<< consumeSDLEvents d es
|
||||
mapM_ (\e -> liftIO $ logIO Verbose $ "LEFTOVER: " ++ show e) leftovers
|
||||
mapM_ (\e -> liftIO $ logIO Verbose $ "LEFTOVER: " <> fromString (show e))
|
||||
leftovers
|
||||
|
||||
update _ = return ()
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import Control.DeepSeq (deepseq)
|
|||
|
||||
import Data.Matrix as M
|
||||
import qualified Data.Set as S
|
||||
import Data.String
|
||||
|
||||
import System.Random (randomRIO)
|
||||
|
||||
|
@ -40,7 +41,7 @@ main = do
|
|||
[
|
||||
( 0
|
||||
, SDL.defaultWindow
|
||||
{ SDL.windowOpenGL = Just SDL.defaultOpenGL
|
||||
{ SDL.windowGraphicsContext = SDL.OpenGLContext SDL.defaultOpenGL
|
||||
{ SDL.glProfile = SDL.Core SDL.Normal 3 3
|
||||
}
|
||||
, SDL.windowInitialSize = SDL.V2 600 600
|
||||
|
@ -133,7 +134,7 @@ showFPS (MsgKeyboardEvent _ _ _ _ sym) =
|
|||
case SDL.keysymKeycode sym of
|
||||
SDL.KeycodeF -> do
|
||||
dt <- getDelta
|
||||
liftIO $ logIO A.Debug $ "FPS: " ++ show (1 / dt)
|
||||
liftIO $ logIO A.Debug $ "FPS: " <> fromString (show (1 / dt))
|
||||
_ -> return ()
|
||||
showFPS _ = return ()
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import Control.DeepSeq (deepseq)
|
|||
|
||||
import Data.Matrix as M
|
||||
import qualified Data.Set as S
|
||||
import Data.String
|
||||
|
||||
import System.Random (randomRIO)
|
||||
|
||||
|
@ -43,7 +44,7 @@ main = do
|
|||
[
|
||||
( 0
|
||||
, SDL.defaultWindow
|
||||
{ SDL.windowOpenGL = Just SDL.defaultOpenGL
|
||||
{ SDL.windowGraphicsContext = SDL.OpenGLContext SDL.defaultOpenGL
|
||||
{ SDL.glProfile = SDL.Core SDL.Normal 3 3
|
||||
}
|
||||
, SDL.windowInitialSize = SDL.V2 600 600
|
||||
|
@ -136,7 +137,7 @@ showFPS (MsgKeyboardEvent _ _ _ _ sym) =
|
|||
case SDL.keysymKeycode sym of
|
||||
SDL.KeycodeF -> do
|
||||
dt <- getDelta
|
||||
liftIO $ logIO A.Debug $ "FPS: " ++ show (1 / dt)
|
||||
liftIO $ logIO A.Debug $ "FPS: " <> fromString (show (1 / dt))
|
||||
_ -> return ()
|
||||
showFPS _ = return ()
|
||||
|
||||
|
|
Loading…
Reference in a new issue