From ab69702910741af752ff7ee5820bb85b1f3ddd5c Mon Sep 17 00:00:00 2001 From: mtgmonkey Date: Wed, 10 Dec 2025 21:12:56 +0100 Subject: add library as git submodule, wayland, window shows --- src/Main.hs | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'src/Main.hs') 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 -- cgit v1.3.1