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