finished episode 25
This commit is contained in:
parent
fa0c6c4670
commit
9fca6a7617
1 changed files with 9 additions and 2 deletions
|
@ -119,6 +119,7 @@ main = do
|
|||
update sceneObject 0
|
||||
render sceneObject
|
||||
else do
|
||||
GL.clearColor $= GL.Color4 0 0 0 1
|
||||
GL.clear [GL.ColorBuffer]
|
||||
|
||||
-- Switch to different scene on keyboard presses F1 thourgh F?
|
||||
|
@ -160,7 +161,13 @@ sceneSwitch curScene evs = mapM_ (switch . SDL.eventPayload) evs
|
|||
(SDL.Keysym _ code mod))) =
|
||||
when (SDL.toNumber mod == 0) $
|
||||
case code of
|
||||
SDL.KeycodeEscape -> do
|
||||
isEmpty <- isEmptyMVar curScene
|
||||
when (not isEmpty) $
|
||||
void $ tryTakeMVar curScene
|
||||
SDL.KeycodeF1 -> do
|
||||
isEmpty <- isEmptyMVar curScene
|
||||
when isEmpty $ do
|
||||
void $ tryTakeMVar curScene
|
||||
putMVar curScene =<< scene1
|
||||
_ ->
|
||||
|
|
Loading…
Reference in a new issue