Compare commits
1 Commits
dev
...
f17acc45e0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f17acc45e0 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
lib
|
lib
|
||||||
|
include
|
||||||
result*
|
result*
|
||||||
dist-newstyle
|
dist-newstyle
|
||||||
|
|||||||
19
generate.sh
19
generate.sh
@@ -1,11 +1,22 @@
|
|||||||
echo "#"
|
echo "# copying header..."
|
||||||
echo "# generating library RGFW.Generated in folder lib"
|
|
||||||
echo "#"
|
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 \
|
hs-bindgen-cli preprocess \
|
||||||
-Irgfw \
|
-Ilib/include \
|
||||||
--create-output-dirs \
|
--create-output-dirs \
|
||||||
--overwrite-files \
|
--overwrite-files \
|
||||||
--hs-output-dir lib \
|
--hs-output-dir lib \
|
||||||
--module RGFW.Generated \
|
--module RGFW.Generated \
|
||||||
--clang-option=-DRGFW_OPENGL \
|
--clang-option=-DRGFW_OPENGL \
|
||||||
|
--clang-option=-DRGFW_EXPORT \
|
||||||
RGFW.h
|
RGFW.h
|
||||||
|
|
||||||
|
|||||||
@@ -12,13 +12,17 @@ common warnings
|
|||||||
|
|
||||||
library
|
library
|
||||||
import: warnings
|
import: warnings
|
||||||
exposed-modules: RGFW.Generated
|
exposed-modules:
|
||||||
|
, RGFW.Generated
|
||||||
|
, RGFW.Generated.FunPtr
|
||||||
|
, RGFW.Generated.Safe
|
||||||
|
, RGFW.Generated.Unsafe
|
||||||
build-depends:
|
build-depends:
|
||||||
, base
|
, base
|
||||||
, primitive
|
, primitive
|
||||||
, c-expr-runtime
|
, c-expr-runtime
|
||||||
, hs-bindgen-runtime
|
, hs-bindgen-runtime
|
||||||
include-dirs: rgfw
|
include-dirs: lib/include
|
||||||
hs-source-dirs: lib
|
hs-source-dirs: lib
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
default-extensions: FlexibleInstances
|
default-extensions: FlexibleInstances
|
||||||
@@ -37,6 +41,6 @@ executable hs-rgfw
|
|||||||
, xcursor
|
, xcursor
|
||||||
, xrandr
|
, xrandr
|
||||||
, xi
|
, xi
|
||||||
include-dirs: rgfw
|
include-dirs: lib/include
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
|
import qualified Foreign.Ptr (ToFunPtr)
|
||||||
|
|
||||||
import qualified RGFW.Generated as RGFW
|
import qualified RGFW.Generated as RGFW
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = putStrLn "Hello World"
|
main = do
|
||||||
|
putStrLn "Hello World"
|
||||||
|
window <- toFunPtr ()
|
||||||
|
|||||||
Reference in New Issue
Block a user