From d30b146ce320a48d58d37a8f191daa4ef29fbc67 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Mon, 30 Dec 2024 12:01:06 -0800 Subject: Spacing. --- Demos/Pong/Main.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Demos/Pong/Main.hs') diff --git a/Demos/Pong/Main.hs b/Demos/Pong/Main.hs index d51a324..66fa223 100644 --- a/Demos/Pong/Main.hs +++ b/Demos/Pong/Main.hs @@ -26,12 +26,15 @@ data GameState = GameState , world :: [GameObject] } + app = App defaultAppOptions step render resize + main = withWindow (1920, 1200) (Just "Pong") initGame endGame $ loop app + initGame :: Window -> Game () GameState initGame window = do (immRenderState, renderCoreState) <- runSiblingGame newImmRenderer newRenderCoreState @@ -42,6 +45,7 @@ endGame = do game <- getGameState runSubGame' (deleteImmRenderer $ immRenderState game) (renderCoreState game) + step :: Elapsed -> Dt -> [InputEvent] -> Game GameState Bool step elapsed dt inputEvents = do gs <- getGameState @@ -61,6 +65,7 @@ processInput window = processKeys window exitRequested = elem (KeyDown KEY_ESC) + render :: Game GameState () render = do gameState <- getGameState @@ -108,6 +113,7 @@ renderGO go = do ,vec2 xmax ymax ,vec2 xmin ymax)] + resize :: WindowEvent -> Game GameState () resize (ResizeEvent w h) = let r = fromIntegral w / fromIntegral h -- cgit v1.2.3