Skip to content

Commit 143abd5

Browse files
committed
Updated to raylib 5.1-dev.
1 parent 33a8230 commit 143abd5

File tree

7 files changed

+4572
-4207
lines changed

7 files changed

+4572
-4207
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
FC = gfortran
55
AR = ar
6-
FFLAGS = -O2 -std=f2018 -Wall -Wno-conversion -fmax-errors=1 -fno-range-check
6+
FFLAGS = -g -std=f2018 -Wall -Wno-conversion -fmax-errors=1 -fno-range-check
77
ARFLAGS = rcs
88
LDFLAGS = -L/usr/local/lib/ -I./include/
99
RAYLIB = -lraylib
10-
LDLIBS = $(RAYLIB) -lGL -lglfw -lpthread -lm
10+
LDLIBS = $(RAYLIB) -lGL -lpthread -lm
1111
TARGET = libfortran-raylib.a
1212

1313
.PHONY: all clean examples

README.md

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
# fortran-raylib
22

33
A work-in-progress collection of interface bindings to
4-
[raylib](https://www.raylib.com/) 4.5, for 2-D and 3-D game programming in
5-
Fortran 2018.
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.
66

77
## Build Instructions
88

99
Install the raylib package suitable for your operating system, or build from
10-
[source](https://github.com/raysan5/raylib/releases/tag/4.5.0):
10+
[source](https://github.com/raysan5/raylib/releases/tag/5.0):
1111

1212
```
13-
$ cd raylib-4.5.0/
13+
$ cd raylib-5.0/
1414
$ mkdir build && cd build/
15-
$ cmake -DUSE_EXTERNAL_GLFW=ON ..
16-
$ make
15+
$ cmake ..
16+
$ make PLATFORM=PLATFORM_DESKTOP
17+
```
18+
Select platform `PLATFORM_DESKTOP_SDL` for the SDL 2.0 backend instead:
19+
1720
```
21+
$ make PLATFORM=PLATFORM_DESKTOP_SDL
22+
```
23+
24+
### Make
1825

1926
Build the *fortran-raylib* library by executing the provided Makefile:
2027

@@ -24,10 +31,19 @@ $ cd fortran-raylib/
2431
$ make
2532
```
2633

27-
You may have to overwrite the libraries to link (argument `LDLIBS`), depending
28-
on you operating system.
34+
Pass argument `RAYLIB` to override the raylib library to link. For example, if
35+
the static library `libraylib.a` is in the same directory:
2936

30-
Or, instead with *fpm*:
37+
```
38+
$ make RAYLIB=libraylib.a
39+
```
40+
41+
You may have to set the libraries to link manually (argument `LDLIBS`),
42+
depending on you operating system.
43+
44+
### Fortran Package Manager
45+
46+
Building the library and all examples with *fpm*:
3147

3248
```
3349
$ fpm build --profile release --flag "-fno-range-check"
@@ -41,12 +57,14 @@ your project:
4157
fortran-raylib = { git = "https://github.com/interkosmos/fortran-raylib.git" }
4258
```
4359

60+
### Linking
61+
4462
Link your Fortran application against `libfortran-raylib.a`, `-lraylib`, and
4563
additional platform-dependent libraries:
4664

4765
| System | Linker Libraries |
4866
|-----------------|----------------------------------------------------------------------------------------------------------|
49-
| FreeBSD | `-lraylib -lglfw -lGL -lpthread -lm` |
67+
| FreeBSD | `-lraylib -lGL -lpthread -lm` |
5068
| Linux | `-lraylib -lGL -lm -lpthread -ldl -lrt -lX11` |
5169
| Linux (Wayland) | `-lraylib -lGL -lm -lpthread -ldl -lrt -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon` |
5270
| macOS | `-lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo` |
@@ -85,7 +103,7 @@ Compile and link the example program:
85103

86104
```
87105
$ gfortran -L/usr/local/lib -I/usr/local/include -o example example.f90 \
88-
libfortran-raylib.a -lraylib -lGL -lglfw -lpthread -lm
106+
libfortran-raylib.a -lraylib -lGL -lpthread -lm
89107
$ ./example
90108
```
91109

@@ -119,7 +137,7 @@ Build all examples with:
119137
$ make examples
120138
```
121139

122-
To link against the static raylib library, run:
140+
To link against a static raylib library, run:
123141

124142
```
125143
$ make examples RAYLIB=libraylib.a
@@ -129,6 +147,8 @@ $ make examples RAYLIB=libraylib.a
129147

130148
Some issues have to be regarded when calling raylib from Fortran:
131149

150+
* Model loading is broken in raylib 5.0
151+
([issue](https://github.com/raysan5/raylib/issues/3576)).
132152
* All procedure names and dummy arguments have been converted to snake case.
133153
* As Fortran does not feature unsigned data types, use the compiler flag
134154
`-fno-range-check` to allow signed values to be written into unsigned

fpm.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "fortran-raylib"
2-
version = "0.1.0"
2+
version = "0.2.0"
33
license = "ISC"
44
author = "Philipp Engel"
55
maintainer = "@interkosmos"
@@ -8,7 +8,7 @@ description = "Fortran 2018 ISO C binding interfaces to raylib"
88
keywords = [ "graphics", "raylib" ]
99

1010
[build]
11-
link = [ "libraylib.a", "GL", "pthread", "m" ]
11+
link = [ "raylib", "GL", "pthread", "m" ]
1212

1313
[library]
1414
source-dir = "src"

share/truck.mtl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ Kd 0.9372549 0.9372549 0.9372549
2323

2424
newmtl wheelInside
2525
Kd 0.7960573 0.8047704 0.8396226
26+

0 commit comments

Comments
 (0)