basic functionality on Wayland and X11

This commit is contained in:
mtgmonkey
2025-12-11 18:15:32 +01:00
parent ab69702910
commit 8a16c6695e
16 changed files with 14299 additions and 190 deletions

38
lib/Main.hs Normal file
View File

@@ -0,0 +1,38 @@
{-# LANGUAGE CApiFFI #-}
module Main (main) where
import Data.Bits (shiftL, (.|.))
import Foreign
import Foreign.C.String
import Foreign.C.Types
import Lib
--------------------------------------------------------------------------------
-- main
--------------------------------------------------------------------------------
main :: IO ()
main = do
window <- withCString "a window" (\name ->
rgfwCreateWindow
name
0
0
800
600
$ mkWindowFlags
[ WindowNoResize
, WindowOpenGL
, WindowFullscreen
]
)
let loop ctr = do
shouldClose <- rgfwWindowShouldClose window
if 0 /= shouldClose
then return shouldClose
else loop $ ctr + 1
exitCode <- loop 0
putStrLn $ show exitCode
return ()