11# fortran-raylib
22
33A work-in-progress collection of interface bindings to
4- [ raylib] ( https://www.raylib.com/ ) 4.5/4.6/5.0/5.1 , for 2-D and 3-D game
5- programming in Fortran 2018.
4+ [ raylib] ( https://www.raylib.com/ ) 5.5 , for 2-D and 3-D game programming in
5+ Fortran 2018.
66
77## Build Instructions
88
99Install the raylib package suitable for your operating system, or build from
10- [ source] ( https://github.com/raysan5/raylib/releases/tag/5.0 ) :
10+ [ source] ( https://github.com/raysan5/raylib/releases/tag/5.5 ) :
1111
1212```
13- $ cd raylib-5.0 /
13+ $ cd raylib-5.5 /
1414$ mkdir build && cd build/
1515$ cmake ..
1616$ make PLATFORM=PLATFORM_DESKTOP
17+ $ make install
1718```
18- Select platform ` PLATFORM_DESKTOP_SDL ` for the SDL 2.0 backend instead :
19+ Select platform ` PLATFORM_DESKTOP_SDL ` for the SDL 2.0 back-end :
1920
2021```
2122$ make PLATFORM=PLATFORM_DESKTOP_SDL
@@ -64,7 +65,7 @@ additional platform-dependent libraries:
6465
6566| System | Linker Libraries |
6667| -----------------| ----------------------------------------------------------------------------------------------------------|
67- | FreeBSD | ` -lraylib -lGL -lpthread -lm ` |
68+ | FreeBSD | ` -lraylib -lglfw - lGL -lpthread -lm ` |
6869| Linux | ` -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 ` |
6970| Linux (Wayland) | ` -lraylib -lGL -lm -lpthread -ldl -lrt -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon ` |
7071| macOS | ` -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo ` |
@@ -102,11 +103,13 @@ end program main
102103Compile and link the example program:
103104
104105```
105- $ gfortran -L/usr/local/lib -I/usr/local/include -o example example.f90 \
106- libfortran-raylib.a -lraylib -lGL -lpthread -lm
106+ $ gfortran -L/usr/local/lib -o example example.f90 libfortran-raylib.a -lraylib -lGL -lpthread -lm
107107$ ./example
108108```
109109
110+ Depending on the build flags chosen for * raylib* , you may have to link with
111+ ` -lglfw ` additionally.
112+
110113## Further Examples
111114
112115More examples can be found in ` examples/ ` :
@@ -128,7 +131,7 @@ More examples can be found in `examples/`:
128131* ** maze** renders a 3-D maze in first-person view.
129132* ** plane** demonstrates pitch/yaw/roll of a 3-D model.
130133* ** shapes** renders basic shapes.
131- * ** truck ** rotates a 3-D model loaded from file.
134+ * ** ship ** rotates a 3-D model loaded from file.
132135* ** window** opens a window with raylib.
133136
134137Build all examples with:
@@ -147,7 +150,7 @@ $ make examples RAYLIB=libraylib.a
147150
148151Some issues have to be regarded when calling raylib from Fortran:
149152
150- * Model loading is broken in raylib 5.0
153+ * Loading models in Wavefront OBJ format is broken since raylib 5.0
151154 ([ issue] ( https://github.com/raysan5/raylib/issues/3576 ) ).
152155* All procedure names and dummy arguments have been converted to snake case.
153156* As Fortran does not feature unsigned data types, use the compiler flag
@@ -161,7 +164,7 @@ Some issues have to be regarded when calling raylib from Fortran:
161164* If a function returns ` type(c_ptr) ` , the result has to be converted to a
162165 Fortran pointer with the intrinsic subroutine ` c_f_pointer() ` first. C char
163166 pointers may be converted with utility subroutine ` c_f_str_ptr() ` from module
164- ` raylib_util ` .
167+ ` raylib_util ` , or the intrinsic ` c_f_strpointer() ` (Fortran 2023) .
165168
166169## Licence
167170
0 commit comments