diff options
| author | mtgmonkey <mtgmonkey@nixos> | 2025-12-16 00:24:10 +0100 |
|---|---|---|
| committer | mtgmonkey <mtgmonkey@nixos> | 2025-12-16 00:24:10 +0100 |
| commit | 5a701a36328eeca44ad5dab85ab3b8287c96d79b (patch) | |
| tree | 87070e5957dc22016e987ee952b48f96557e20e0 /src/Main.hs | |
| parent | 170685f6c80e3e66decc1a0b8f34e6446032993c (diff) | |
[feat] unify with example, actually win for once
Diffstat (limited to 'src/Main.hs')
| -rw-r--r-- | src/Main.hs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Main.hs b/src/Main.hs new file mode 100644 index 0000000..7dcf9c3 --- /dev/null +++ b/src/Main.hs @@ -0,0 +1,36 @@ +module Main (main) where + +import Foreign.C.String (withCString) + +import RGFW + +-------------------------------------------------------------------------------- +-- main +-------------------------------------------------------------------------------- + +main :: IO () +main = do + window <- withCString "window <3" (\name -> + c'RGFW_createWindow + name + 0 + 0 + 800 + 600 + $ sum + [ c'RGFW_windowNoResize + , c'RGFW_windowOpenGL + , c'RGFW_windowedFullscreen + ] + ) + putStrLn $ show window + let loop ctr = do + shouldClose <- c'RGFW_window_shouldClose window + if 0 /= shouldClose + then return shouldClose + else do + c'RGFW_window_swapBuffers_OpenGL window + loop $ ctr + 1 + exitCode <- loop (0 :: Integer) + putStrLn $ show exitCode + return () |
