diff options
author | 3gg <3gg@shellblade.net> | 2024-12-30 12:48:31 -0800 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-12-30 12:48:31 -0800 |
commit | 34cac097d15cdd7ef0a0de8b9024db9acfe8618d (patch) | |
tree | fa573d4d4436abfa83b940938c385e929dbabd06 /Demos | |
parent | d30b146ce320a48d58d37a8f191daa4ef29fbc67 (diff) |
Move window setup to App.
Diffstat (limited to 'Demos')
-rw-r--r-- | Demos/Pong/Main.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Demos/Pong/Main.hs b/Demos/Pong/Main.hs index 66fa223..de8e6f2 100644 --- a/Demos/Pong/Main.hs +++ b/Demos/Pong/Main.hs | |||
@@ -26,14 +26,13 @@ data GameState = GameState | |||
26 | , world :: [GameObject] | 26 | , world :: [GameObject] |
27 | } | 27 | } |
28 | 28 | ||
29 | options = defaultAppOptions { title = "Pong" } | ||
29 | 30 | ||
30 | app = App defaultAppOptions step render resize | 31 | app = App options initGame endGame step render resize |
31 | 32 | ||
32 | 33 | ||
33 | main = | 34 | main :: IO () |
34 | withWindow (1920, 1200) (Just "Pong") initGame endGame $ | 35 | main = runApp app |
35 | loop app | ||
36 | |||
37 | 36 | ||
38 | initGame :: Window -> Game () GameState | 37 | initGame :: Window -> Game () GameState |
39 | initGame window = do | 38 | initGame window = do |