diff options
| author | mtgmonkey <mtgmonkey@nixos> | 2025-12-10 21:12:56 +0100 |
|---|---|---|
| committer | mtgmonkey <mtgmonkey@nixos> | 2025-12-10 21:12:56 +0100 |
| commit | ab69702910741af752ff7ee5820bb85b1f3ddd5c (patch) | |
| tree | 3f6d9b7321f859ba30095000ea2c5f74e2be8ff4 /src/Main.hs | |
| parent | 5e2d2b89c855cc0713d6f64788eaca530f21fc81 (diff) | |
add library as git submodule, wayland, window shows
Diffstat (limited to 'src/Main.hs')
| -rw-r--r-- | src/Main.hs | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/Main.hs b/src/Main.hs index d7f12a6..67f745e 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -21,25 +21,19 @@ main = do 800 600 $ mkWindowFlags - [ WindowCenter - , WindowNoResize + [ WindowNoResize , WindowOpenGL + , WindowFullscreen ] ) - let loop = do - putStrLn $ show window - putStrLn - $ show - $ mkWindowFlags - [ WindowCenter - , WindowNoResize - , WindowOpenGL - ] + let loop ctr = do shouldClose <- rgfwWindowShouldClose window - if 0 == shouldClose - then return () - else loop - loop + if 0 /= shouldClose + then return shouldClose + else loop $ ctr + 1 + exitCode <- loop 0 + putStrLn $ show exitCode + return () -------------------------------------------------------------------------------- -- Haskell-ier abstractions @@ -107,15 +101,15 @@ type RGFWwindowFlags = Word32 type RGFWbool = CUInt -foreign import capi "lib/RGFW.h RGFW_createWindow" rgfwCreateWindow - :: CString - -> Int32 - -> Int32 - -> Int32 - -> Int32 +foreign import capi "lib/RGFW_HS.h RGFW_createWindow" rgfwCreateWindow + :: Ptr CChar + -> CInt + -> CInt + -> CInt + -> CInt -> RGFWwindowFlags -> IO RGFWwindowPtr -foreign import capi "lib/RGFW.h RGFW_window_shouldClose" rgfwWindowShouldClose +foreign import capi "lib/RGFW_HS.h RGFW_window_shouldClose" rgfwWindowShouldClose :: RGFWwindowPtr -> IO RGFWbool |
