Skip to content

Commit 98327cf

Browse files
readme
1 parent 9985ec1 commit 98327cf

1 file changed

Lines changed: 16 additions & 24 deletions

File tree

README.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,19 @@ they are auto-generated. See [How To Build](#how-to-build)
1515

1616
## How to use
1717

18-
Download the latest [jaylib.jar](https://github.com/electronstudio/jaylib/releases/download/v3.0.0-rc5/jaylib.jar) from [releases](https://github.com/electronstudio/jaylib/releases)
18+
Download the latest `jaylib.jar` and `jaylib-natives.jar` for your platform(s) from [releases](https://github.com/electronstudio/jaylib/releases)
1919

2020
Write a demo program, e.g. Demo.java
2121

2222
```java
23-
import com.raylib.Jaylib.Vector3;
24-
import com.raylib.Jaylib.Camera;
2523
import com.raylib.Raylib;
2624
import static com.raylib.Jaylib.*;
2725

2826
public class Demo {
2927
public static void main(String args[]) {
3028
InitWindow(800, 450, "Demo");
3129
SetTargetFPS(60);
32-
Camera camera = new Camera(new Vector3(18,16,18),new Vector3(), new Vector3(0,1,0), 45, 0);
30+
Camera camera = new Camera(new Vector3().x(18).y(16).z(18),new Vector3(), new Vector3().x(0).y(1).z(0), 45, 0);
3331
SetCameraMode(camera, CAMERA_ORBITAL);
3432

3533
while(!WindowShouldClose()){
@@ -50,25 +48,25 @@ public class Demo {
5048

5149
Compile it:
5250

53-
javac -cp jaylib.jar Demo.java
51+
javac -cp jaylib.jar:jaylib-natives.jar Demo.java
5452

5553
Run it:
5654

57-
java -cp jaylib.jar:. Demo
55+
java -cp jaylib.jar:jaylib-natives.jar:. Demo
5856

5957
On MacOS you need this option:
6058

61-
java -XstartOnFirstThread -cp jaylib.jar:. Demo
59+
java -XstartOnFirstThread -cp jaylib.jar:jaylib-natives.jar:. Demo
6260

6361
On weirdy Windows:
6462

65-
java -cp jaylib.jar;. Demo
63+
java -cp jaylib.jar;:jaylib-natives.jar. Demo
6664

6765
## Known issues
6866

6967
### Getters and setters
7068

71-
JavaCPP does not use the 'get' and 'set' names nor does it use public fields. To access a field:
69+
JavaCPP does not use the 'get' and 'set' names in the methods (nor does it expose public fields). To access a field:
7270

7371
var x = vector.x()
7472

@@ -80,23 +78,11 @@ Remember each time you do either of those you are accessing native memory.
8078

8179
### Constructors
8280

83-
JavaCPP does not generate constructors. There are three ways you can construct objects. The recommended JavaCPP way is like this:
81+
JavaCPP does not generate constructors. The recommended JavaCPP way is like this:
8482

8583
var vec = new Vector3().x(1).y(2).z(3);
8684

87-
I made some sub classes in Jaylib.java. To use those:
88-
89-
import com.raylib.Jaylib.Vector3;
90-
...
91-
var vec = new Vector3(1, 2, 3);
92-
93-
I made some constructor functions in Jaylib.java. To use those:
94-
95-
import static com.raylib.Jaylib.Vector3;
96-
97-
var vec = Vector3(1, 2, 3);
98-
99-
I'm undecided which of these methods is cleanest but I recommend the first because it's autogenerated by JavaCPP.
85+
For discussion of other ways, [see here](https://github.com/electronstudio/jaylib/issues/1#issuecomment-873485303).
10086

10187
### Arrays
10288

@@ -105,8 +91,14 @@ of which have an arrays of `maps`. To access the second map of the first materi
10591

10692
model.materials().position(1).maps().position(2)
10793

94+
### RLGL and Raymath
95+
96+
These additional libraries are included in the Linux and Mac natives but may not be (or may not work) in the Windows.
97+
10898
## How to build
10999

100+
(See the Github Actions build file for latest more detailed exact platform specific steps.)
101+
110102
Clone this repo including submodules so you get correct version of Raylib. (On Windows, Google for how to enable symlinks
111103
)
112104

@@ -121,7 +113,7 @@ Edit `build.sh` to set platform variables.
121113
Run:
122114
`./build.sh`
123115

124-
This will build you a jaylib.jar uber-jar.
116+
This will build you a jaylib.jar uber-jar and natives jar and a docs jar.
125117

126118
On Windows the script must be run from inside a Visual C 2019 native x64 command prompt, and needs git-bash to be installed.
127119

0 commit comments

Comments
 (0)