1 Commits

Author SHA1 Message Date
andromeda
f17acc45e0 stash 2026-01-27 09:32:23 +01:00
4 changed files with 28 additions and 8 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
lib
include
result*
dist-newstyle

View File

@@ -1,11 +1,22 @@
echo "#"
echo "# generating library RGFW.Generated in folder lib"
echo "#"
echo "# copying header..."
mkdir lib
mkdir lib/include
cp rgfw/RGFW.h lib/include/RGFW.h
echo "# creating c file to generate from..."
clang -E -DRGFW_IMPLEMENTATION -DRGFW_OPENGL lib/include/RGFW.h -o lib/include/RGFW.c
echo "# generating library RGFW.Generated..."
hs-bindgen-cli preprocess \
-Irgfw \
-Ilib/include \
--create-output-dirs \
--overwrite-files \
--hs-output-dir lib \
--module RGFW.Generated \
--clang-option=-DRGFW_OPENGL \
--clang-option=-DRGFW_EXPORT \
RGFW.h

View File

@@ -12,13 +12,17 @@ common warnings
library
import: warnings
exposed-modules: RGFW.Generated
exposed-modules:
, RGFW.Generated
, RGFW.Generated.FunPtr
, RGFW.Generated.Safe
, RGFW.Generated.Unsafe
build-depends:
, base
, primitive
, c-expr-runtime
, hs-bindgen-runtime
include-dirs: rgfw
include-dirs: lib/include
hs-source-dirs: lib
default-language: Haskell2010
default-extensions: FlexibleInstances
@@ -37,6 +41,6 @@ executable hs-rgfw
, xcursor
, xrandr
, xi
include-dirs: rgfw
include-dirs: lib/include
hs-source-dirs: src
default-language: Haskell2010

View File

@@ -1,6 +1,10 @@
module Main where
import qualified Foreign.Ptr (ToFunPtr)
import qualified RGFW.Generated as RGFW
main :: IO ()
main = putStrLn "Hello World"
main = do
putStrLn "Hello World"
window <- toFunPtr ()