diff --git a/README.md b/README.md index 1c3ba2d..5d3f4e9 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,11 @@ they are auto-generated. See [How To Build](#how-to-build) ## How to use -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) +Download the latest `jaylib.jar` and `jaylib-natives.jar` for your platform(s) from [releases](https://github.com/electronstudio/jaylib/releases) Write a demo program, e.g. Demo.java ```java -import com.raylib.Jaylib.Vector3; -import com.raylib.Jaylib.Camera; import com.raylib.Raylib; import static com.raylib.Jaylib.*; @@ -29,7 +27,7 @@ public class Demo { public static void main(String args[]) { InitWindow(800, 450, "Demo"); SetTargetFPS(60); - Camera camera = new Camera(new Vector3(18,16,18),new Vector3(), new Vector3(0,1,0), 45, 0); + Camera camera = new Camera(new Vector3().x(18).y(16).z(18),new Vector3(), new Vector3().x(0).y(1).z(0), 45, 0); SetCameraMode(camera, CAMERA_ORBITAL); while(!WindowShouldClose()){ @@ -50,25 +48,25 @@ public class Demo { Compile it: - javac -cp jaylib.jar Demo.java + javac -cp jaylib.jar:jaylib-natives.jar Demo.java Run it: - java -cp jaylib.jar:. Demo + java -cp jaylib.jar:jaylib-natives.jar:. Demo On MacOS you need this option: - java -XstartOnFirstThread -cp jaylib.jar:. Demo + java -XstartOnFirstThread -cp jaylib.jar:jaylib-natives.jar:. Demo On weirdy Windows: - java -cp jaylib.jar;. Demo + java -cp jaylib.jar;:jaylib-natives.jar. Demo ## Known issues ### Getters and setters -JavaCPP does not use the 'get' and 'set' names nor does it use public fields. To access a field: +JavaCPP does not use the 'get' and 'set' names in the methods (nor does it expose public fields). To access a field: var x = vector.x() @@ -80,23 +78,11 @@ Remember each time you do either of those you are accessing native memory. ### Constructors -JavaCPP does not generate constructors. There are three ways you can construct objects. The recommended JavaCPP way is like this: +JavaCPP does not generate constructors. The recommended JavaCPP way is like this: var vec = new Vector3().x(1).y(2).z(3); -I made some sub classes in Jaylib.java. To use those: - - import com.raylib.Jaylib.Vector3; - ... - var vec = new Vector3(1, 2, 3); - -I made some constructor functions in Jaylib.java. To use those: - - import static com.raylib.Jaylib.Vector3; - - var vec = Vector3(1, 2, 3); - -I'm undecided which of these methods is cleanest but I recommend the first because it's autogenerated by JavaCPP. +For discussion of other ways, [see here](https://github.com/electronstudio/jaylib/issues/1#issuecomment-873485303). ### Arrays @@ -105,8 +91,14 @@ of which have an arrays of `maps`. To access the second map of the first materi model.materials().position(1).maps().position(2) +### RLGL and Raymath + +These additional libraries are included in the Linux and Mac natives but may not be (or may not work) in the Windows. + ## How to build +(See the Github Actions build file for latest more detailed exact platform specific steps.) + Clone this repo including submodules so you get correct version of Raylib. (On Windows, Google for how to enable symlinks ) @@ -121,7 +113,7 @@ Edit `build.sh` to set platform variables. Run: `./build.sh` -This will build you a jaylib.jar uber-jar. +This will build you a jaylib.jar uber-jar and natives jar and a docs jar. On Windows the script must be run from inside a Visual C 2019 native x64 command prompt, and needs git-bash to be installed.