├── .gitattributes ├── README.md ├── build.gradle └── src ├── main ├── c │ ├── raylib.h │ └── raylib.i ├── java │ └── raylib │ │ ├── AudioStream.java │ │ ├── BlendMode.java │ │ ├── BoundingBox.java │ │ ├── Camera2D.java │ │ ├── Camera3D.java │ │ ├── CameraMode.java │ │ ├── CameraType.java │ │ ├── CharInfo.java │ │ ├── Color.java │ │ ├── Font.java │ │ ├── Gestures.java │ │ ├── Image.java │ │ ├── LogType.java │ │ ├── Material.java │ │ ├── MaterialMap.java │ │ ├── Matrix.java │ │ ├── Mesh.java │ │ ├── Model.java │ │ ├── PixelFormat.java │ │ ├── Ray.java │ │ ├── RayHitInfo.java │ │ ├── Raylib.java │ │ ├── RaylibConstants.java │ │ ├── RaylibJNI.java │ │ ├── Rectangle.java │ │ ├── RenderTexture2D.java │ │ ├── SWIGTYPE_p_MusicData.java │ │ ├── SWIGTYPE_p_float.java │ │ ├── SWIGTYPE_p_int.java │ │ ├── SWIGTYPE_p_p_char.java │ │ ├── SWIGTYPE_p_unsigned_char.java │ │ ├── SWIGTYPE_p_unsigned_int.java │ │ ├── SWIGTYPE_p_unsigned_short.java │ │ ├── SWIGTYPE_p_void.java │ │ ├── Shader.java │ │ ├── ShaderLocationIndex.java │ │ ├── Sound.java │ │ ├── TexmapIndex.java │ │ ├── Texture2D.java │ │ ├── TextureFilterMode.java │ │ ├── TextureWrapMode.java │ │ ├── Vector2.java │ │ ├── Vector3.java │ │ ├── Vector4.java │ │ ├── VrDeviceInfo.java │ │ ├── VrDeviceType.java │ │ └── Wave.java └── resources │ └── lib │ └── win64 │ └── raylib.dll └── test └── java └── MainTest.java /.gitattributes: -------------------------------------------------------------------------------- 1 | *.dll filter=lfs diff=lfs merge=lfs -text 2 | *.lib filter=lfs diff=lfs merge=lfs -text 3 | *.dylib filter=lfs diff=lfs merge=lfs -text 4 | *.jar filter=lfs diff=lfs merge=lfs -text 5 | *.so filter=lfs diff=lfs merge=lfs -text 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Raylib-Java 3 | 4 | A thin (not yet ergonomic) Java Wrapper for [Raylib](https://github.com/raysan5/raylib). 5 | 6 | --- 7 | 8 | ### Release Notes: 9 | 10 | #### 2018.10.17 11 | Important bugfix: the DLL wasn't being copied correctly from the package to a temporary directory. There were bytes left in the buffer at the tail end which caused crashes. Also make an effort to clean up the temporary files after the application quits. 12 | 13 | #### 2018.10.11 14 | Raylib-Java is not yet production ready or battle hardened. The current release, 2018.10, most closely matches a 0.0.1-alpha build. It is available here only as proof that things are moving forward. 15 | 16 | ### Download: 17 | 18 | If you don't much care for warnings and scoff at the idea of heeding common sense, you can download the initial 0.0.1 release here for Windows64 machines. 19 | 20 | ### Usage: 21 | 22 | Raylib-Java is not yet hosted in Maven Central, but you can use it in your project like so: 23 | 24 | 1) Inside your project folder at the top level (next to src), create a folder named 'libs'. 25 | 2) Download raylib-java-xxxx.xx.jar and place it in this folder. 26 | 3) Update your build.gradle file to include the following: 27 | ``` 28 | repositories { 29 | ... 30 | flatDir { 31 | dirs 'libs' 32 | } 33 | } 34 | 35 | dependencies { 36 | compile name: 'raylib-xxxx.xx-platform' // Note that this does not end in .jar! 37 | } 38 | ``` 39 | 40 | ### TODO: 41 | 42 | - [ ] Convert RaylibConstants from method calls to Java types. (Performance) 43 | - [ ] Make sure NATIVE_INT_SIZE is automatically generated. (Build) 44 | - [ ] Make sure that build process is reproducible and doesn't obliterate work on headers. (Build) 45 | - [ ] AWT robot testing. (Build) 46 | - [ ] Automatically load for all native platforms. (Usability) 47 | - [ ] Javadoc/Inline doc for IDE completion. (Usability) 48 | - [ ] Helper methods on vectors like sum/product. (Usability) 49 | - [x] Extra methods on Material to get/set specific map types. (Usability) 50 | - [ ] Update LoadFontEx so that String is properly converted to an int array of Unicode points. (Usability) 51 | - [ ] A method that will first search for files on-drive, then check JAR resources. (Usability) 52 | 53 | ### License and Legal Nonsense: 54 | Raylib is Copyright (c) 2013-2018 Ramon Santamaria (@raysan5). 55 | 56 | The Raylib-Java is Copyright (c) 2018 Xoana LTD. 57 | 58 | Raylib-Java is offered under the MIT License. 59 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | group 'io.xoana' 2 | version '2018.10' 3 | 4 | apply plugin: 'java' 5 | 6 | sourceCompatibility = 1.8 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | testCompile group: 'junit', name: 'junit', version: '4.12' 14 | } 15 | -------------------------------------------------------------------------------- /src/main/c/raylib.i: -------------------------------------------------------------------------------- 1 | /* raylib.i */ 2 | /* Build instructions: 3 | swig -java -package raylib raylib.i 4 | gcc -c raylib_wrap.c -I/c/Program\ Files/Java/jdk1.8.0_161/include -I/c/Program\ Files/Java/jdk1.8.0_161/include/win32 5 | gcc -shared raylib_wrap.o -lraylib -lglfw3 -lgdi32 -lopengl32 -L./ -Wl,--add-stdcall-alias -o raylib.dll 6 | */ 7 | %module Raylib 8 | %{ 9 | /* Put header files here or function declarations like below */ 10 | /* 11 | extern bool maybe; 12 | TODO: sizeof(each type) 13 | */ 14 | #include "raylib.h" 15 | %} 16 | 17 | %include "raylib.h" 18 | -------------------------------------------------------------------------------- /src/main/java/raylib/AudioStream.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class AudioStream { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected AudioStream(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(AudioStream obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_AudioStream(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setSampleRate(long value) { 39 | RaylibJNI.AudioStream_sampleRate_set(swigCPtr, this, value); 40 | } 41 | 42 | public long getSampleRate() { 43 | return RaylibJNI.AudioStream_sampleRate_get(swigCPtr, this); 44 | } 45 | 46 | public void setSampleSize(long value) { 47 | RaylibJNI.AudioStream_sampleSize_set(swigCPtr, this, value); 48 | } 49 | 50 | public long getSampleSize() { 51 | return RaylibJNI.AudioStream_sampleSize_get(swigCPtr, this); 52 | } 53 | 54 | public void setChannels(long value) { 55 | RaylibJNI.AudioStream_channels_set(swigCPtr, this, value); 56 | } 57 | 58 | public long getChannels() { 59 | return RaylibJNI.AudioStream_channels_get(swigCPtr, this); 60 | } 61 | 62 | public void setAudioBuffer(SWIGTYPE_p_void value) { 63 | RaylibJNI.AudioStream_audioBuffer_set(swigCPtr, this, SWIGTYPE_p_void.getCPtr(value)); 64 | } 65 | 66 | public SWIGTYPE_p_void getAudioBuffer() { 67 | long cPtr = RaylibJNI.AudioStream_audioBuffer_get(swigCPtr, this); 68 | return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false); 69 | } 70 | 71 | public void setFormat(int value) { 72 | RaylibJNI.AudioStream_format_set(swigCPtr, this, value); 73 | } 74 | 75 | public int getFormat() { 76 | return RaylibJNI.AudioStream_format_get(swigCPtr, this); 77 | } 78 | 79 | public void setSource(long value) { 80 | RaylibJNI.AudioStream_source_set(swigCPtr, this, value); 81 | } 82 | 83 | public long getSource() { 84 | return RaylibJNI.AudioStream_source_get(swigCPtr, this); 85 | } 86 | 87 | public void setBuffers(SWIGTYPE_p_unsigned_int value) { 88 | RaylibJNI.AudioStream_buffers_set(swigCPtr, this, SWIGTYPE_p_unsigned_int.getCPtr(value)); 89 | } 90 | 91 | public SWIGTYPE_p_unsigned_int getBuffers() { 92 | long cPtr = RaylibJNI.AudioStream_buffers_get(swigCPtr, this); 93 | return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_int(cPtr, false); 94 | } 95 | 96 | public AudioStream() { 97 | this(RaylibJNI.new_AudioStream(), true); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/raylib/BlendMode.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class BlendMode { 12 | public final static BlendMode BLEND_ALPHA = new BlendMode("BLEND_ALPHA", RaylibJNI.BLEND_ALPHA_get()); 13 | public final static BlendMode BLEND_ADDITIVE = new BlendMode("BLEND_ADDITIVE"); 14 | public final static BlendMode BLEND_MULTIPLIED = new BlendMode("BLEND_MULTIPLIED"); 15 | 16 | public final int swigValue() { 17 | return swigValue; 18 | } 19 | 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static BlendMode swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 26 | return swigValues[swigValue]; 27 | for (int i = 0; i < swigValues.length; i++) 28 | if (swigValues[i].swigValue == swigValue) 29 | return swigValues[i]; 30 | throw new IllegalArgumentException("No enum " + BlendMode.class + " with value " + swigValue); 31 | } 32 | 33 | private BlendMode(String swigName) { 34 | this.swigName = swigName; 35 | this.swigValue = swigNext++; 36 | } 37 | 38 | private BlendMode(String swigName, int swigValue) { 39 | this.swigName = swigName; 40 | this.swigValue = swigValue; 41 | swigNext = swigValue+1; 42 | } 43 | 44 | private BlendMode(String swigName, BlendMode swigEnum) { 45 | this.swigName = swigName; 46 | this.swigValue = swigEnum.swigValue; 47 | swigNext = this.swigValue+1; 48 | } 49 | 50 | private static BlendMode[] swigValues = { BLEND_ALPHA, BLEND_ADDITIVE, BLEND_MULTIPLIED }; 51 | private static int swigNext = 0; 52 | private final int swigValue; 53 | private final String swigName; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/main/java/raylib/BoundingBox.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class BoundingBox { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected BoundingBox(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(BoundingBox obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_BoundingBox(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setMin(Vector3 value) { 39 | RaylibJNI.BoundingBox_min_set(swigCPtr, this, Vector3.getCPtr(value), value); 40 | } 41 | 42 | public Vector3 getMin() { 43 | long cPtr = RaylibJNI.BoundingBox_min_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new Vector3(cPtr, false); 45 | } 46 | 47 | public void setMax(Vector3 value) { 48 | RaylibJNI.BoundingBox_max_set(swigCPtr, this, Vector3.getCPtr(value), value); 49 | } 50 | 51 | public Vector3 getMax() { 52 | long cPtr = RaylibJNI.BoundingBox_max_get(swigCPtr, this); 53 | return (cPtr == 0) ? null : new Vector3(cPtr, false); 54 | } 55 | 56 | public BoundingBox() { 57 | this(RaylibJNI.new_BoundingBox(), true); 58 | } 59 | 60 | public BoundingBox(Vector3 min, Vector3 max) { 61 | this(); 62 | this.setMax(max); 63 | this.setMin(min); 64 | } 65 | 66 | public BoundingBox(float xMin, float yMin, float zMin, float xMax, float yMax, float zMax) { 67 | this(new Vector3(xMin, yMin, zMin), new Vector3(xMax, yMax, zMax)); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/raylib/Camera2D.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Camera2D { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Camera2D(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Camera2D obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Camera2D(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setOffset(Vector2 value) { 39 | RaylibJNI.Camera2D_offset_set(swigCPtr, this, Vector2.getCPtr(value), value); 40 | } 41 | 42 | public Vector2 getOffset() { 43 | long cPtr = RaylibJNI.Camera2D_offset_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new Vector2(cPtr, false); 45 | } 46 | 47 | public void setTarget(Vector2 value) { 48 | RaylibJNI.Camera2D_target_set(swigCPtr, this, Vector2.getCPtr(value), value); 49 | } 50 | 51 | public Vector2 getTarget() { 52 | long cPtr = RaylibJNI.Camera2D_target_get(swigCPtr, this); 53 | return (cPtr == 0) ? null : new Vector2(cPtr, false); 54 | } 55 | 56 | public void setRotation(float value) { 57 | RaylibJNI.Camera2D_rotation_set(swigCPtr, this, value); 58 | } 59 | 60 | public float getRotation() { 61 | return RaylibJNI.Camera2D_rotation_get(swigCPtr, this); 62 | } 63 | 64 | public void setZoom(float value) { 65 | RaylibJNI.Camera2D_zoom_set(swigCPtr, this, value); 66 | } 67 | 68 | public float getZoom() { 69 | return RaylibJNI.Camera2D_zoom_get(swigCPtr, this); 70 | } 71 | 72 | public Camera2D() { 73 | this(RaylibJNI.new_Camera2D(), true); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/raylib/Camera3D.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Camera3D { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Camera3D(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Camera3D obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Camera3D(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setPosition(Vector3 value) { 39 | RaylibJNI.Camera3D_position_set(swigCPtr, this, Vector3.getCPtr(value), value); 40 | } 41 | 42 | public Vector3 getPosition() { 43 | long cPtr = RaylibJNI.Camera3D_position_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new Vector3(cPtr, false); 45 | } 46 | 47 | public void setTarget(Vector3 value) { 48 | RaylibJNI.Camera3D_target_set(swigCPtr, this, Vector3.getCPtr(value), value); 49 | } 50 | 51 | public Vector3 getTarget() { 52 | long cPtr = RaylibJNI.Camera3D_target_get(swigCPtr, this); 53 | return (cPtr == 0) ? null : new Vector3(cPtr, false); 54 | } 55 | 56 | public void setUp(Vector3 value) { 57 | RaylibJNI.Camera3D_up_set(swigCPtr, this, Vector3.getCPtr(value), value); 58 | } 59 | 60 | public Vector3 getUp() { 61 | long cPtr = RaylibJNI.Camera3D_up_get(swigCPtr, this); 62 | return (cPtr == 0) ? null : new Vector3(cPtr, false); 63 | } 64 | 65 | public void setFovy(float value) { 66 | RaylibJNI.Camera3D_fovy_set(swigCPtr, this, value); 67 | } 68 | 69 | public float getFovy() { 70 | return RaylibJNI.Camera3D_fovy_get(swigCPtr, this); 71 | } 72 | 73 | public void setType(int value) { 74 | RaylibJNI.Camera3D_type_set(swigCPtr, this, value); 75 | } 76 | 77 | public int getType() { 78 | return RaylibJNI.Camera3D_type_get(swigCPtr, this); 79 | } 80 | 81 | public Camera3D() { 82 | this(RaylibJNI.new_Camera3D(), true); 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/raylib/CameraMode.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class CameraMode { 12 | public final static CameraMode CAMERA_CUSTOM = new CameraMode("CAMERA_CUSTOM", RaylibJNI.CAMERA_CUSTOM_get()); 13 | public final static CameraMode CAMERA_FREE = new CameraMode("CAMERA_FREE"); 14 | public final static CameraMode CAMERA_ORBITAL = new CameraMode("CAMERA_ORBITAL"); 15 | public final static CameraMode CAMERA_FIRST_PERSON = new CameraMode("CAMERA_FIRST_PERSON"); 16 | public final static CameraMode CAMERA_THIRD_PERSON = new CameraMode("CAMERA_THIRD_PERSON"); 17 | 18 | public final int swigValue() { 19 | return swigValue; 20 | } 21 | 22 | public String toString() { 23 | return swigName; 24 | } 25 | 26 | public static CameraMode swigToEnum(int swigValue) { 27 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 28 | return swigValues[swigValue]; 29 | for (int i = 0; i < swigValues.length; i++) 30 | if (swigValues[i].swigValue == swigValue) 31 | return swigValues[i]; 32 | throw new IllegalArgumentException("No enum " + CameraMode.class + " with value " + swigValue); 33 | } 34 | 35 | private CameraMode(String swigName) { 36 | this.swigName = swigName; 37 | this.swigValue = swigNext++; 38 | } 39 | 40 | private CameraMode(String swigName, int swigValue) { 41 | this.swigName = swigName; 42 | this.swigValue = swigValue; 43 | swigNext = swigValue+1; 44 | } 45 | 46 | private CameraMode(String swigName, CameraMode swigEnum) { 47 | this.swigName = swigName; 48 | this.swigValue = swigEnum.swigValue; 49 | swigNext = this.swigValue+1; 50 | } 51 | 52 | private static CameraMode[] swigValues = { CAMERA_CUSTOM, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON }; 53 | private static int swigNext = 0; 54 | private final int swigValue; 55 | private final String swigName; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/main/java/raylib/CameraType.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class CameraType { 12 | public final static CameraType CAMERA_PERSPECTIVE = new CameraType("CAMERA_PERSPECTIVE", RaylibJNI.CAMERA_PERSPECTIVE_get()); 13 | public final static CameraType CAMERA_ORTHOGRAPHIC = new CameraType("CAMERA_ORTHOGRAPHIC"); 14 | 15 | public final int swigValue() { 16 | return swigValue; 17 | } 18 | 19 | public String toString() { 20 | return swigName; 21 | } 22 | 23 | public static CameraType swigToEnum(int swigValue) { 24 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 25 | return swigValues[swigValue]; 26 | for (int i = 0; i < swigValues.length; i++) 27 | if (swigValues[i].swigValue == swigValue) 28 | return swigValues[i]; 29 | throw new IllegalArgumentException("No enum " + CameraType.class + " with value " + swigValue); 30 | } 31 | 32 | private CameraType(String swigName) { 33 | this.swigName = swigName; 34 | this.swigValue = swigNext++; 35 | } 36 | 37 | private CameraType(String swigName, int swigValue) { 38 | this.swigName = swigName; 39 | this.swigValue = swigValue; 40 | swigNext = swigValue+1; 41 | } 42 | 43 | private CameraType(String swigName, CameraType swigEnum) { 44 | this.swigName = swigName; 45 | this.swigValue = swigEnum.swigValue; 46 | swigNext = this.swigValue+1; 47 | } 48 | 49 | private static CameraType[] swigValues = { CAMERA_PERSPECTIVE, CAMERA_ORTHOGRAPHIC }; 50 | private static int swigNext = 0; 51 | private final int swigValue; 52 | private final String swigName; 53 | } 54 | 55 | -------------------------------------------------------------------------------- /src/main/java/raylib/CharInfo.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class CharInfo { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected CharInfo(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(CharInfo obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_CharInfo(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setValue(int value) { 39 | RaylibJNI.CharInfo_value_set(swigCPtr, this, value); 40 | } 41 | 42 | public int getValue() { 43 | return RaylibJNI.CharInfo_value_get(swigCPtr, this); 44 | } 45 | 46 | public void setRec(Rectangle value) { 47 | RaylibJNI.CharInfo_rec_set(swigCPtr, this, Rectangle.getCPtr(value), value); 48 | } 49 | 50 | public Rectangle getRec() { 51 | long cPtr = RaylibJNI.CharInfo_rec_get(swigCPtr, this); 52 | return (cPtr == 0) ? null : new Rectangle(cPtr, false); 53 | } 54 | 55 | public void setOffsetX(int value) { 56 | RaylibJNI.CharInfo_offsetX_set(swigCPtr, this, value); 57 | } 58 | 59 | public int getOffsetX() { 60 | return RaylibJNI.CharInfo_offsetX_get(swigCPtr, this); 61 | } 62 | 63 | public void setOffsetY(int value) { 64 | RaylibJNI.CharInfo_offsetY_set(swigCPtr, this, value); 65 | } 66 | 67 | public int getOffsetY() { 68 | return RaylibJNI.CharInfo_offsetY_get(swigCPtr, this); 69 | } 70 | 71 | public void setAdvanceX(int value) { 72 | RaylibJNI.CharInfo_advanceX_set(swigCPtr, this, value); 73 | } 74 | 75 | public int getAdvanceX() { 76 | return RaylibJNI.CharInfo_advanceX_get(swigCPtr, this); 77 | } 78 | 79 | public void setData(SWIGTYPE_p_unsigned_char value) { 80 | RaylibJNI.CharInfo_data_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 81 | } 82 | 83 | public SWIGTYPE_p_unsigned_char getData() { 84 | long cPtr = RaylibJNI.CharInfo_data_get(swigCPtr, this); 85 | return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); 86 | } 87 | 88 | public CharInfo() { 89 | this(RaylibJNI.new_CharInfo(), true); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/raylib/Color.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Color { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Color(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Color obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Color(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setR(short value) { 39 | RaylibJNI.Color_r_set(swigCPtr, this, value); 40 | } 41 | 42 | public short getR() { 43 | return RaylibJNI.Color_r_get(swigCPtr, this); 44 | } 45 | 46 | public void setG(short value) { 47 | RaylibJNI.Color_g_set(swigCPtr, this, value); 48 | } 49 | 50 | public short getG() { 51 | return RaylibJNI.Color_g_get(swigCPtr, this); 52 | } 53 | 54 | public void setB(short value) { 55 | RaylibJNI.Color_b_set(swigCPtr, this, value); 56 | } 57 | 58 | public short getB() { 59 | return RaylibJNI.Color_b_get(swigCPtr, this); 60 | } 61 | 62 | public void setA(short value) { 63 | RaylibJNI.Color_a_set(swigCPtr, this, value); 64 | } 65 | 66 | public short getA() { 67 | return RaylibJNI.Color_a_get(swigCPtr, this); 68 | } 69 | 70 | public Color() { 71 | this(RaylibJNI.new_Color(), true); 72 | } 73 | 74 | public Color(int r, int g, int b, int a) { 75 | this(); 76 | this.setR((short)r); 77 | this.setG((short)g); 78 | this.setB((short)b); 79 | this.setA((short)a); 80 | } 81 | 82 | public Color(int r, int g, int b) { 83 | this(r, g, b, 255); 84 | } 85 | 86 | public static final Color LIGHTGRAY = new Color(200, 200, 200, 255 ); 87 | public static final Color GRAY = new Color(130, 130, 130, 255 ); 88 | public static final Color DARKGRAY = new Color(80, 80, 80, 255 ); 89 | public static final Color YELLOW = new Color(253, 249, 0, 255 ); 90 | public static final Color GOLD = new Color(255, 203, 0, 255 ); 91 | public static final Color ORANGE = new Color(255, 161, 0, 255 ); 92 | public static final Color PINK = new Color(255, 109, 194, 255 ); 93 | public static final Color RED = new Color(230, 41, 55, 255 ); 94 | public static final Color MAROON = new Color(190, 33, 55, 255 ); 95 | public static final Color GREEN = new Color(0, 228, 48, 255 ); 96 | public static final Color LIME = new Color(0, 158, 47, 255 ); 97 | public static final Color DARKGREEN = new Color(0, 117, 44, 255 ); 98 | public static final Color SKYBLUE = new Color(102, 191, 255, 255 ); 99 | public static final Color BLUE = new Color(0, 121, 241, 255 ); 100 | public static final Color DARKBLUE = new Color(0, 82, 172, 255 ); 101 | public static final Color PURPLE = new Color(200, 122, 255, 255 ); 102 | public static final Color VIOLET = new Color(135, 60, 190, 255 ); 103 | public static final Color DARKPURPLE= new Color(112, 31, 126, 255 ); 104 | public static final Color BEIGE = new Color(211, 176, 131, 255 ); 105 | public static final Color BROWN = new Color(127, 106, 79, 255 ); 106 | public static final Color DARKBROWN = new Color(76, 63, 47, 255 ); 107 | 108 | public static final Color WHITE = new Color(255, 255, 255, 255 ); 109 | public static final Color BLACK = new Color(0, 0, 0, 255 ); 110 | public static final Color BLANK = new Color(0, 0, 0, 0 ); 111 | public static final Color MAGENTA = new Color(255, 0, 255, 255 ); 112 | public static final Color RAYWHITE = new Color(245, 245, 245, 255 ); 113 | } 114 | -------------------------------------------------------------------------------- /src/main/java/raylib/Font.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Font { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Font(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Font obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Font(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setTexture(Texture2D value) { 39 | RaylibJNI.Font_texture_set(swigCPtr, this, Texture2D.getCPtr(value), value); 40 | } 41 | 42 | public Texture2D getTexture() { 43 | long cPtr = RaylibJNI.Font_texture_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new Texture2D(cPtr, false); 45 | } 46 | 47 | public void setBaseSize(int value) { 48 | RaylibJNI.Font_baseSize_set(swigCPtr, this, value); 49 | } 50 | 51 | public int getBaseSize() { 52 | return RaylibJNI.Font_baseSize_get(swigCPtr, this); 53 | } 54 | 55 | public void setCharsCount(int value) { 56 | RaylibJNI.Font_charsCount_set(swigCPtr, this, value); 57 | } 58 | 59 | public int getCharsCount() { 60 | return RaylibJNI.Font_charsCount_get(swigCPtr, this); 61 | } 62 | 63 | public void setChars(CharInfo value) { 64 | RaylibJNI.Font_chars_set(swigCPtr, this, CharInfo.getCPtr(value), value); 65 | } 66 | 67 | public CharInfo getChars() { 68 | long cPtr = RaylibJNI.Font_chars_get(swigCPtr, this); 69 | return (cPtr == 0) ? null : new CharInfo(cPtr, false); 70 | } 71 | 72 | public Font() { 73 | this(RaylibJNI.new_Font(), true); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/raylib/Gestures.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class Gestures { 12 | public final static Gestures GESTURE_NONE = new Gestures("GESTURE_NONE", RaylibJNI.GESTURE_NONE_get()); 13 | public final static Gestures GESTURE_TAP = new Gestures("GESTURE_TAP", RaylibJNI.GESTURE_TAP_get()); 14 | public final static Gestures GESTURE_DOUBLETAP = new Gestures("GESTURE_DOUBLETAP", RaylibJNI.GESTURE_DOUBLETAP_get()); 15 | public final static Gestures GESTURE_HOLD = new Gestures("GESTURE_HOLD", RaylibJNI.GESTURE_HOLD_get()); 16 | public final static Gestures GESTURE_DRAG = new Gestures("GESTURE_DRAG", RaylibJNI.GESTURE_DRAG_get()); 17 | public final static Gestures GESTURE_SWIPE_RIGHT = new Gestures("GESTURE_SWIPE_RIGHT", RaylibJNI.GESTURE_SWIPE_RIGHT_get()); 18 | public final static Gestures GESTURE_SWIPE_LEFT = new Gestures("GESTURE_SWIPE_LEFT", RaylibJNI.GESTURE_SWIPE_LEFT_get()); 19 | public final static Gestures GESTURE_SWIPE_UP = new Gestures("GESTURE_SWIPE_UP", RaylibJNI.GESTURE_SWIPE_UP_get()); 20 | public final static Gestures GESTURE_SWIPE_DOWN = new Gestures("GESTURE_SWIPE_DOWN", RaylibJNI.GESTURE_SWIPE_DOWN_get()); 21 | public final static Gestures GESTURE_PINCH_IN = new Gestures("GESTURE_PINCH_IN", RaylibJNI.GESTURE_PINCH_IN_get()); 22 | public final static Gestures GESTURE_PINCH_OUT = new Gestures("GESTURE_PINCH_OUT", RaylibJNI.GESTURE_PINCH_OUT_get()); 23 | 24 | public final int swigValue() { 25 | return swigValue; 26 | } 27 | 28 | public String toString() { 29 | return swigName; 30 | } 31 | 32 | public static Gestures swigToEnum(int swigValue) { 33 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 34 | return swigValues[swigValue]; 35 | for (int i = 0; i < swigValues.length; i++) 36 | if (swigValues[i].swigValue == swigValue) 37 | return swigValues[i]; 38 | throw new IllegalArgumentException("No enum " + Gestures.class + " with value " + swigValue); 39 | } 40 | 41 | private Gestures(String swigName) { 42 | this.swigName = swigName; 43 | this.swigValue = swigNext++; 44 | } 45 | 46 | private Gestures(String swigName, int swigValue) { 47 | this.swigName = swigName; 48 | this.swigValue = swigValue; 49 | swigNext = swigValue+1; 50 | } 51 | 52 | private Gestures(String swigName, Gestures swigEnum) { 53 | this.swigName = swigName; 54 | this.swigValue = swigEnum.swigValue; 55 | swigNext = this.swigValue+1; 56 | } 57 | 58 | private static Gestures[] swigValues = { GESTURE_NONE, GESTURE_TAP, GESTURE_DOUBLETAP, GESTURE_HOLD, GESTURE_DRAG, GESTURE_SWIPE_RIGHT, GESTURE_SWIPE_LEFT, GESTURE_SWIPE_UP, GESTURE_SWIPE_DOWN, GESTURE_PINCH_IN, GESTURE_PINCH_OUT }; 59 | private static int swigNext = 0; 60 | private final int swigValue; 61 | private final String swigName; 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/main/java/raylib/Image.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Image { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Image(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Image obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Image(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setData(SWIGTYPE_p_void value) { 39 | RaylibJNI.Image_data_set(swigCPtr, this, SWIGTYPE_p_void.getCPtr(value)); 40 | } 41 | 42 | public SWIGTYPE_p_void getData() { 43 | long cPtr = RaylibJNI.Image_data_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false); 45 | } 46 | 47 | public void setWidth(int value) { 48 | RaylibJNI.Image_width_set(swigCPtr, this, value); 49 | } 50 | 51 | public int getWidth() { 52 | return RaylibJNI.Image_width_get(swigCPtr, this); 53 | } 54 | 55 | public void setHeight(int value) { 56 | RaylibJNI.Image_height_set(swigCPtr, this, value); 57 | } 58 | 59 | public int getHeight() { 60 | return RaylibJNI.Image_height_get(swigCPtr, this); 61 | } 62 | 63 | public void setMipmaps(int value) { 64 | RaylibJNI.Image_mipmaps_set(swigCPtr, this, value); 65 | } 66 | 67 | public int getMipmaps() { 68 | return RaylibJNI.Image_mipmaps_get(swigCPtr, this); 69 | } 70 | 71 | public void setFormat(int value) { 72 | RaylibJNI.Image_format_set(swigCPtr, this, value); 73 | } 74 | 75 | public int getFormat() { 76 | return RaylibJNI.Image_format_get(swigCPtr, this); 77 | } 78 | 79 | public Image() { 80 | this(RaylibJNI.new_Image(), true); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/raylib/LogType.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class LogType { 12 | public final static LogType LOG_INFO = new LogType("LOG_INFO", RaylibJNI.LOG_INFO_get()); 13 | public final static LogType LOG_WARNING = new LogType("LOG_WARNING", RaylibJNI.LOG_WARNING_get()); 14 | public final static LogType LOG_ERROR = new LogType("LOG_ERROR", RaylibJNI.LOG_ERROR_get()); 15 | public final static LogType LOG_DEBUG = new LogType("LOG_DEBUG", RaylibJNI.LOG_DEBUG_get()); 16 | public final static LogType LOG_OTHER = new LogType("LOG_OTHER", RaylibJNI.LOG_OTHER_get()); 17 | 18 | public final int swigValue() { 19 | return swigValue; 20 | } 21 | 22 | public String toString() { 23 | return swigName; 24 | } 25 | 26 | public static LogType swigToEnum(int swigValue) { 27 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 28 | return swigValues[swigValue]; 29 | for (int i = 0; i < swigValues.length; i++) 30 | if (swigValues[i].swigValue == swigValue) 31 | return swigValues[i]; 32 | throw new IllegalArgumentException("No enum " + LogType.class + " with value " + swigValue); 33 | } 34 | 35 | private LogType(String swigName) { 36 | this.swigName = swigName; 37 | this.swigValue = swigNext++; 38 | } 39 | 40 | private LogType(String swigName, int swigValue) { 41 | this.swigName = swigName; 42 | this.swigValue = swigValue; 43 | swigNext = swigValue+1; 44 | } 45 | 46 | private LogType(String swigName, LogType swigEnum) { 47 | this.swigName = swigName; 48 | this.swigValue = swigEnum.swigValue; 49 | swigNext = this.swigValue+1; 50 | } 51 | 52 | private static LogType[] swigValues = { LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG, LOG_OTHER }; 53 | private static int swigNext = 0; 54 | private final int swigValue; 55 | private final String swigName; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/main/java/raylib/Material.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | import static raylib.RaylibConstants.NATIVE_FLOAT_SIZE; 12 | import static raylib.RaylibConstants.NATIVE_INT_SIZE; 13 | 14 | public class Material { 15 | private transient long swigCPtr; 16 | protected transient boolean swigCMemOwn; 17 | 18 | protected Material(long cPtr, boolean cMemoryOwn) { 19 | swigCMemOwn = cMemoryOwn; 20 | swigCPtr = cPtr; 21 | } 22 | 23 | protected static long getCPtr(Material obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | 27 | protected void finalize() { 28 | delete(); 29 | } 30 | 31 | public synchronized void delete() { 32 | if (swigCPtr != 0) { 33 | if (swigCMemOwn) { 34 | swigCMemOwn = false; 35 | RaylibJNI.delete_Material(swigCPtr); 36 | } 37 | swigCPtr = 0; 38 | } 39 | } 40 | 41 | public void setShader(Shader value) { 42 | RaylibJNI.Material_shader_set(swigCPtr, this, Shader.getCPtr(value), value); 43 | } 44 | 45 | public Shader getShader() { 46 | long cPtr = RaylibJNI.Material_shader_get(swigCPtr, this); 47 | return (cPtr == 0) ? null : new Shader(cPtr, false); 48 | } 49 | 50 | public void setMaps(MaterialMap value) { 51 | RaylibJNI.Material_maps_set(swigCPtr, this, MaterialMap.getCPtr(value), value); 52 | } 53 | 54 | public MaterialMap getMaps() { 55 | long cPtr = RaylibJNI.Material_maps_get(swigCPtr, this); 56 | return (cPtr == 0) ? null : new MaterialMap(cPtr, false); 57 | } 58 | 59 | public MaterialMap getMap(int i) { 60 | // i * sizeof(MaterialMap) 61 | // TODO: Add this as a directive in SWIG. sizeof(MaterialMap) = sizeof(texture) + sizeof(Color) + sizeof(float) 62 | if(i < 0 || i > RaylibJNI.MAX_MATERIAL_MAPS_get()) { 63 | return null; 64 | } 65 | long cPtr = RaylibJNI.Material_maps_get(swigCPtr + (i*((5*NATIVE_INT_SIZE)+NATIVE_INT_SIZE+NATIVE_FLOAT_SIZE)), this); 66 | return (cPtr == 0) ? null : new MaterialMap(cPtr, false); 67 | } 68 | 69 | public void setMap(int i, MaterialMap value) { 70 | if(i < 0 || i > RaylibJNI.MAX_MATERIAL_MAPS_get()) { 71 | throw new IndexOutOfBoundsException("Index " + i + " was out of bounds for the range 0 to " + RaylibJNI.MAX_MATERIAL_MAPS_get()); 72 | } 73 | long cPtr = RaylibJNI.Material_maps_get(swigCPtr + (i*((5*4)+4+4)), this); 74 | RaylibJNI.Material_maps_set(cPtr, this, MaterialMap.getCPtr(value), value); 75 | } 76 | 77 | public void setParams(SWIGTYPE_p_float value) { 78 | RaylibJNI.Material_params_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 79 | } 80 | 81 | public SWIGTYPE_p_float getParams() { 82 | long cPtr = RaylibJNI.Material_params_get(swigCPtr, this); 83 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 84 | } 85 | 86 | public Material() { 87 | this(RaylibJNI.new_Material(), true); 88 | } 89 | 90 | public MaterialMap getDiffuseMap() { 91 | return getMap(MAP_DIFFUSE); 92 | } 93 | 94 | public void setDiffuseMap(MaterialMap map) { 95 | setMap(MAP_DIFFUSE, map); 96 | } 97 | 98 | public MaterialMap getSpecularMap() { 99 | return getMap(MAP_SPECULAR); 100 | } 101 | 102 | public void setSpecularMap(MaterialMap map) { 103 | setMap(MAP_SPECULAR, map); 104 | } 105 | 106 | public MaterialMap getMetalnessMap() { 107 | return getMap(MAP_METALNESS); 108 | } 109 | 110 | public void setMetalnessMap(MaterialMap map) { 111 | setMap(MAP_METALNESS, map); 112 | } 113 | 114 | public MaterialMap getNormalMap() { 115 | return getMap(MAP_NORMAL); 116 | } 117 | 118 | public void setNormalMap(MaterialMap map) { 119 | setMap(MAP_NORMAL, map); 120 | } 121 | 122 | public MaterialMap getRoughnessMap() { 123 | return getMap(MAP_ROUGHNESS); 124 | } 125 | 126 | public void setRoughnessMap(MaterialMap map) { 127 | setMap(MAP_ROUGHNESS, map); 128 | } 129 | 130 | public MaterialMap getOcclusionMap() { 131 | return getMap(MAP_OCCLUSION); 132 | } 133 | 134 | public void setOcclusionMap(MaterialMap map) { 135 | setMap(MAP_OCCLUSION, map); 136 | } 137 | 138 | public MaterialMap getEmissionMap() { 139 | return getMap(MAP_EMISSION); 140 | } 141 | 142 | public void setEmissionMap(MaterialMap map) { 143 | setMap(MAP_EMISSION, map); 144 | } 145 | 146 | public MaterialMap getHeightMap() { 147 | return getMap(MAP_ROUGHNESS); 148 | } 149 | 150 | public void setHeightMap(MaterialMap map) { 151 | setMap(MAP_HEIGHT, map); 152 | } 153 | 154 | public static final int MAP_DIFFUSE = 0; 155 | public static final int MAP_ALBEDO = 0; // MAP_DIFFUSE 156 | public static final int MAP_SPECULAR = 1; 157 | public static final int MAP_METALNESS = 1; // MAP_SPECULAR 158 | public static final int MAP_NORMAL = 2; 159 | public static final int MAP_ROUGHNESS = 3; 160 | public static final int MAP_OCCLUSION = 4; 161 | public static final int MAP_EMISSION = 5; 162 | public static final int MAP_HEIGHT = 6; 163 | public static final int MAP_CUBEMAP = 7; // NOTE: Uses GL_TEXTURE_CUBE_MAP 164 | public static final int MAP_IRRADIANCE = 8; // NOTE: Uses GL_TEXTURE_CUBE_MAP 165 | public static final int MAP_PREFILTER = 9; // NOTE: Uses GL_TEXTURE_CUBE_MAP 166 | public static final int MAP_BRDF = 10; 167 | 168 | } 169 | -------------------------------------------------------------------------------- /src/main/java/raylib/MaterialMap.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class MaterialMap { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected MaterialMap(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(MaterialMap obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_MaterialMap(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setTexture(Texture2D value) { 39 | RaylibJNI.MaterialMap_texture_set(swigCPtr, this, Texture2D.getCPtr(value), value); 40 | } 41 | 42 | public Texture2D getTexture() { 43 | long cPtr = RaylibJNI.MaterialMap_texture_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new Texture2D(cPtr, false); 45 | } 46 | 47 | public void setColor(Color value) { 48 | RaylibJNI.MaterialMap_color_set(swigCPtr, this, Color.getCPtr(value), value); 49 | } 50 | 51 | public Color getColor() { 52 | long cPtr = RaylibJNI.MaterialMap_color_get(swigCPtr, this); 53 | return (cPtr == 0) ? null : new Color(cPtr, false); 54 | } 55 | 56 | public void setValue(float value) { 57 | RaylibJNI.MaterialMap_value_set(swigCPtr, this, value); 58 | } 59 | 60 | public float getValue() { 61 | return RaylibJNI.MaterialMap_value_get(swigCPtr, this); 62 | } 63 | 64 | public MaterialMap() { 65 | this(RaylibJNI.new_MaterialMap(), true); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/raylib/Matrix.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Matrix { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | /* Struct Layout: 0-16 in order = column major. 16 | float m0, m4, m8, m12; 17 | float m1, m5, m9, m13; 18 | float m2, m6, m10, m14; 19 | float m3, m7, m11, m15; 20 | */ 21 | 22 | protected Matrix(long cPtr, boolean cMemoryOwn) { 23 | swigCMemOwn = cMemoryOwn; 24 | swigCPtr = cPtr; 25 | } 26 | 27 | protected static long getCPtr(Matrix obj) { 28 | return (obj == null) ? 0 : obj.swigCPtr; 29 | } 30 | 31 | protected void finalize() { 32 | delete(); 33 | } 34 | 35 | public synchronized void delete() { 36 | if (swigCPtr != 0) { 37 | if (swigCMemOwn) { 38 | swigCMemOwn = false; 39 | RaylibJNI.delete_Matrix(swigCPtr); 40 | } 41 | swigCPtr = 0; 42 | } 43 | } 44 | 45 | public void setM0(float value) { 46 | RaylibJNI.Matrix_m0_set(swigCPtr, this, value); 47 | } 48 | 49 | public float getM0() { 50 | return RaylibJNI.Matrix_m0_get(swigCPtr, this); 51 | } 52 | 53 | public void setM4(float value) { 54 | RaylibJNI.Matrix_m4_set(swigCPtr, this, value); 55 | } 56 | 57 | public float getM4() { 58 | return RaylibJNI.Matrix_m4_get(swigCPtr, this); 59 | } 60 | 61 | public void setM8(float value) { 62 | RaylibJNI.Matrix_m8_set(swigCPtr, this, value); 63 | } 64 | 65 | public float getM8() { 66 | return RaylibJNI.Matrix_m8_get(swigCPtr, this); 67 | } 68 | 69 | public void setM12(float value) { 70 | RaylibJNI.Matrix_m12_set(swigCPtr, this, value); 71 | } 72 | 73 | public float getM12() { 74 | return RaylibJNI.Matrix_m12_get(swigCPtr, this); 75 | } 76 | 77 | public void setM1(float value) { 78 | RaylibJNI.Matrix_m1_set(swigCPtr, this, value); 79 | } 80 | 81 | public float getM1() { 82 | return RaylibJNI.Matrix_m1_get(swigCPtr, this); 83 | } 84 | 85 | public void setM5(float value) { 86 | RaylibJNI.Matrix_m5_set(swigCPtr, this, value); 87 | } 88 | 89 | public float getM5() { 90 | return RaylibJNI.Matrix_m5_get(swigCPtr, this); 91 | } 92 | 93 | public void setM9(float value) { 94 | RaylibJNI.Matrix_m9_set(swigCPtr, this, value); 95 | } 96 | 97 | public float getM9() { 98 | return RaylibJNI.Matrix_m9_get(swigCPtr, this); 99 | } 100 | 101 | public void setM13(float value) { 102 | RaylibJNI.Matrix_m13_set(swigCPtr, this, value); 103 | } 104 | 105 | public float getM13() { 106 | return RaylibJNI.Matrix_m13_get(swigCPtr, this); 107 | } 108 | 109 | public void setM2(float value) { 110 | RaylibJNI.Matrix_m2_set(swigCPtr, this, value); 111 | } 112 | 113 | public float getM2() { 114 | return RaylibJNI.Matrix_m2_get(swigCPtr, this); 115 | } 116 | 117 | public void setM6(float value) { 118 | RaylibJNI.Matrix_m6_set(swigCPtr, this, value); 119 | } 120 | 121 | public float getM6() { 122 | return RaylibJNI.Matrix_m6_get(swigCPtr, this); 123 | } 124 | 125 | public void setM10(float value) { 126 | RaylibJNI.Matrix_m10_set(swigCPtr, this, value); 127 | } 128 | 129 | public float getM10() { 130 | return RaylibJNI.Matrix_m10_get(swigCPtr, this); 131 | } 132 | 133 | public void setM14(float value) { 134 | RaylibJNI.Matrix_m14_set(swigCPtr, this, value); 135 | } 136 | 137 | public float getM14() { 138 | return RaylibJNI.Matrix_m14_get(swigCPtr, this); 139 | } 140 | 141 | public void setM3(float value) { 142 | RaylibJNI.Matrix_m3_set(swigCPtr, this, value); 143 | } 144 | 145 | public float getM3() { 146 | return RaylibJNI.Matrix_m3_get(swigCPtr, this); 147 | } 148 | 149 | public void setM7(float value) { 150 | RaylibJNI.Matrix_m7_set(swigCPtr, this, value); 151 | } 152 | 153 | public float getM7() { 154 | return RaylibJNI.Matrix_m7_get(swigCPtr, this); 155 | } 156 | 157 | public void setM11(float value) { 158 | RaylibJNI.Matrix_m11_set(swigCPtr, this, value); 159 | } 160 | 161 | public float getM11() { 162 | return RaylibJNI.Matrix_m11_get(swigCPtr, this); 163 | } 164 | 165 | public void setM15(float value) { 166 | RaylibJNI.Matrix_m15_set(swigCPtr, this, value); 167 | } 168 | 169 | public float getM15() { 170 | return RaylibJNI.Matrix_m15_get(swigCPtr, this); 171 | } 172 | 173 | public Matrix() { 174 | this(RaylibJNI.new_Matrix(), true); 175 | } 176 | 177 | public void setToIdentity() { 178 | setRowMajor(new float[]{ 179 | 1, 0, 0, 0, 180 | 0, 1, 0, 0, 181 | 0, 0, 1, 0, 182 | 0, 0, 0, 1 183 | }); 184 | } 185 | 186 | // TODO: This is really messy. See about getting a contiguous array working with JNI. 187 | // TODO: Add algebraic operators and the ability to set/get specific places. 188 | 189 | public void setColumns(Vector4 c0, Vector4 c1, Vector4 c2, Vector4 c3) { 190 | setM0(c0.getX()); 191 | setM1(c0.getY()); 192 | setM2(c0.getZ()); 193 | setM3(c0.getW()); 194 | 195 | setM4(c1.getX()); 196 | setM5(c1.getY()); 197 | setM6(c1.getZ()); 198 | setM7(c1.getW()); 199 | 200 | setM8(c2.getX()); 201 | setM9(c2.getY()); 202 | setM10(c2.getZ()); 203 | setM11(c2.getW()); 204 | 205 | setM12(c3.getX()); 206 | setM13(c3.getY()); 207 | setM14(c3.getZ()); 208 | setM15(c3.getW()); 209 | } 210 | 211 | public void setRows(Vector4 r0, Vector4 r1, Vector4 r2, Vector4 r3) { 212 | setM0(r0.getX()); 213 | setM4(r0.getY()); 214 | setM8(r0.getZ()); 215 | setM12(r0.getW()); 216 | 217 | setM1(r1.getX()); 218 | setM5(r1.getY()); 219 | setM9(r1.getZ()); 220 | setM13(r1.getW()); 221 | 222 | setM2(r2.getX()); 223 | setM6(r2.getY()); 224 | setM10(r2.getZ()); 225 | setM14(r2.getW()); 226 | 227 | setM3(r3.getX()); 228 | setM7(r3.getY()); 229 | setM11(r3.getZ()); 230 | setM15(r3.getW()); 231 | } 232 | 233 | public void setRowMajor(float[] value) { 234 | setM0(value[0]); 235 | setM1(value[4]); 236 | setM2(value[8]); 237 | setM3(value[12]); 238 | 239 | setM4(value[1]); 240 | setM5(value[5]); 241 | setM6(value[9]); 242 | setM7(value[13]); 243 | 244 | setM8(value[2]); 245 | setM9(value[6]); 246 | setM10(value[10]); 247 | setM11(value[14]); 248 | 249 | setM12(value[3]); 250 | setM13(value[7]); 251 | setM14(value[11]); 252 | setM15(value[15]); 253 | } 254 | 255 | public void setColumnMajor(float[] value) { 256 | setM0(value[0]); 257 | setM1(value[1]); 258 | setM2(value[2]); 259 | setM3(value[3]); 260 | 261 | setM4(value[4]); 262 | setM5(value[5]); 263 | setM6(value[6]); 264 | setM7(value[7]); 265 | 266 | setM8(value[8]); 267 | setM9(value[9]); 268 | setM10(value[10]); 269 | setM11(value[11]); 270 | 271 | setM12(value[12]); 272 | setM13(value[13]); 273 | setM14(value[14]); 274 | setM15(value[15]); 275 | } 276 | } 277 | -------------------------------------------------------------------------------- /src/main/java/raylib/Mesh.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | import static raylib.RaylibConstants.NATIVE_INT_SIZE; 12 | 13 | public class Mesh { 14 | private transient long swigCPtr; 15 | protected transient boolean swigCMemOwn; 16 | 17 | protected Mesh(long cPtr, boolean cMemoryOwn) { 18 | swigCMemOwn = cMemoryOwn; 19 | swigCPtr = cPtr; 20 | } 21 | 22 | protected static long getCPtr(Mesh obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | 26 | protected void finalize() { 27 | delete(); 28 | } 29 | 30 | public synchronized void delete() { 31 | if (swigCPtr != 0) { 32 | if (swigCMemOwn) { 33 | swigCMemOwn = false; 34 | RaylibJNI.delete_Mesh(swigCPtr); 35 | } 36 | swigCPtr = 0; 37 | } 38 | } 39 | 40 | public void setVertexCount(int value) { 41 | RaylibJNI.Mesh_vertexCount_set(swigCPtr, this, value); 42 | } 43 | 44 | public int getVertexCount() { 45 | return RaylibJNI.Mesh_vertexCount_get(swigCPtr, this); 46 | } 47 | 48 | public void setTriangleCount(int value) { 49 | RaylibJNI.Mesh_triangleCount_set(swigCPtr, this, value); 50 | } 51 | 52 | public int getTriangleCount() { 53 | return RaylibJNI.Mesh_triangleCount_get(swigCPtr, this); 54 | } 55 | 56 | public void setVertices(SWIGTYPE_p_float value) { 57 | RaylibJNI.Mesh_vertices_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 58 | } 59 | 60 | public SWIGTYPE_p_float getVertices() { 61 | long cPtr = RaylibJNI.Mesh_vertices_get(swigCPtr, this); 62 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 63 | } 64 | 65 | public void setTexcoords(SWIGTYPE_p_float value) { 66 | RaylibJNI.Mesh_texcoords_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 67 | } 68 | 69 | public SWIGTYPE_p_float getTexcoords() { 70 | long cPtr = RaylibJNI.Mesh_texcoords_get(swigCPtr, this); 71 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 72 | } 73 | 74 | public void setTexcoords2(SWIGTYPE_p_float value) { 75 | RaylibJNI.Mesh_texcoords2_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 76 | } 77 | 78 | public SWIGTYPE_p_float getTexcoords2() { 79 | long cPtr = RaylibJNI.Mesh_texcoords2_get(swigCPtr, this); 80 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 81 | } 82 | 83 | public void setNormals(SWIGTYPE_p_float value) { 84 | RaylibJNI.Mesh_normals_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 85 | } 86 | 87 | public SWIGTYPE_p_float getNormals() { 88 | long cPtr = RaylibJNI.Mesh_normals_get(swigCPtr, this); 89 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 90 | } 91 | 92 | public void setTangents(SWIGTYPE_p_float value) { 93 | RaylibJNI.Mesh_tangents_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 94 | } 95 | 96 | public SWIGTYPE_p_float getTangents() { 97 | long cPtr = RaylibJNI.Mesh_tangents_get(swigCPtr, this); 98 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 99 | } 100 | 101 | public void setColors(SWIGTYPE_p_unsigned_char value) { 102 | RaylibJNI.Mesh_colors_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 103 | } 104 | 105 | public SWIGTYPE_p_unsigned_char getColors() { 106 | long cPtr = RaylibJNI.Mesh_colors_get(swigCPtr, this); 107 | return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); 108 | } 109 | 110 | public void setIndices(SWIGTYPE_p_unsigned_short value) { 111 | RaylibJNI.Mesh_indices_set(swigCPtr, this, SWIGTYPE_p_unsigned_short.getCPtr(value)); 112 | } 113 | 114 | public SWIGTYPE_p_unsigned_short getIndices() { 115 | long cPtr = RaylibJNI.Mesh_indices_get(swigCPtr, this); 116 | return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_short(cPtr, false); 117 | } 118 | 119 | public void setVaoId(long value) { 120 | RaylibJNI.Mesh_vaoId_set(swigCPtr, this, value); 121 | } 122 | 123 | public long getVaoId() { 124 | return RaylibJNI.Mesh_vaoId_get(swigCPtr, this); 125 | } 126 | 127 | public void setVboId(int index, int value) { 128 | //RaylibJNI.Mesh_vboId_set(swigCPtr, this, SWIGTYPE_p_unsigned_int.getCPtr(value)); 129 | RaylibJNI.Mesh_vboId_set(swigCPtr + (index*NATIVE_INT_SIZE), this, value); 130 | } 131 | 132 | public SWIGTYPE_p_unsigned_int getVboId(int index) { 133 | long cPtr = RaylibJNI.Mesh_vboId_get(swigCPtr + (index*NATIVE_INT_SIZE), this); 134 | return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_int(cPtr, false); 135 | } 136 | 137 | public Mesh() { 138 | this(RaylibJNI.new_Mesh(), true); 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /src/main/java/raylib/Model.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Model { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Model(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Model obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Model(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setMesh(Mesh value) { 39 | RaylibJNI.Model_mesh_set(swigCPtr, this, Mesh.getCPtr(value), value); 40 | } 41 | 42 | public Mesh getMesh() { 43 | long cPtr = RaylibJNI.Model_mesh_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new Mesh(cPtr, false); 45 | } 46 | 47 | public void setTransform(Matrix value) { 48 | RaylibJNI.Model_transform_set(swigCPtr, this, Matrix.getCPtr(value), value); 49 | } 50 | 51 | public Matrix getTransform() { 52 | long cPtr = RaylibJNI.Model_transform_get(swigCPtr, this); 53 | return (cPtr == 0) ? null : new Matrix(cPtr, false); 54 | } 55 | 56 | public void setMaterial(Material value) { 57 | RaylibJNI.Model_material_set(swigCPtr, this, Material.getCPtr(value), value); 58 | } 59 | 60 | public Material getMaterial() { 61 | long cPtr = RaylibJNI.Model_material_get(swigCPtr, this); 62 | return (cPtr == 0) ? null : new Material(cPtr, false); 63 | } 64 | 65 | public Model() { 66 | this(RaylibJNI.new_Model(), true); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/raylib/PixelFormat.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class PixelFormat { 12 | public final static PixelFormat UNCOMPRESSED_GRAYSCALE = new PixelFormat("UNCOMPRESSED_GRAYSCALE", RaylibJNI.UNCOMPRESSED_GRAYSCALE_get()); 13 | public final static PixelFormat UNCOMPRESSED_GRAY_ALPHA = new PixelFormat("UNCOMPRESSED_GRAY_ALPHA"); 14 | public final static PixelFormat UNCOMPRESSED_R5G6B5 = new PixelFormat("UNCOMPRESSED_R5G6B5"); 15 | public final static PixelFormat UNCOMPRESSED_R8G8B8 = new PixelFormat("UNCOMPRESSED_R8G8B8"); 16 | public final static PixelFormat UNCOMPRESSED_R5G5B5A1 = new PixelFormat("UNCOMPRESSED_R5G5B5A1"); 17 | public final static PixelFormat UNCOMPRESSED_R4G4B4A4 = new PixelFormat("UNCOMPRESSED_R4G4B4A4"); 18 | public final static PixelFormat UNCOMPRESSED_R8G8B8A8 = new PixelFormat("UNCOMPRESSED_R8G8B8A8"); 19 | public final static PixelFormat UNCOMPRESSED_R32 = new PixelFormat("UNCOMPRESSED_R32"); 20 | public final static PixelFormat UNCOMPRESSED_R32G32B32 = new PixelFormat("UNCOMPRESSED_R32G32B32"); 21 | public final static PixelFormat UNCOMPRESSED_R32G32B32A32 = new PixelFormat("UNCOMPRESSED_R32G32B32A32"); 22 | public final static PixelFormat COMPRESSED_DXT1_RGB = new PixelFormat("COMPRESSED_DXT1_RGB"); 23 | public final static PixelFormat COMPRESSED_DXT1_RGBA = new PixelFormat("COMPRESSED_DXT1_RGBA"); 24 | public final static PixelFormat COMPRESSED_DXT3_RGBA = new PixelFormat("COMPRESSED_DXT3_RGBA"); 25 | public final static PixelFormat COMPRESSED_DXT5_RGBA = new PixelFormat("COMPRESSED_DXT5_RGBA"); 26 | public final static PixelFormat COMPRESSED_ETC1_RGB = new PixelFormat("COMPRESSED_ETC1_RGB"); 27 | public final static PixelFormat COMPRESSED_ETC2_RGB = new PixelFormat("COMPRESSED_ETC2_RGB"); 28 | public final static PixelFormat COMPRESSED_ETC2_EAC_RGBA = new PixelFormat("COMPRESSED_ETC2_EAC_RGBA"); 29 | public final static PixelFormat COMPRESSED_PVRT_RGB = new PixelFormat("COMPRESSED_PVRT_RGB"); 30 | public final static PixelFormat COMPRESSED_PVRT_RGBA = new PixelFormat("COMPRESSED_PVRT_RGBA"); 31 | public final static PixelFormat COMPRESSED_ASTC_4x4_RGBA = new PixelFormat("COMPRESSED_ASTC_4x4_RGBA"); 32 | public final static PixelFormat COMPRESSED_ASTC_8x8_RGBA = new PixelFormat("COMPRESSED_ASTC_8x8_RGBA"); 33 | 34 | public final int swigValue() { 35 | return swigValue; 36 | } 37 | 38 | public String toString() { 39 | return swigName; 40 | } 41 | 42 | public static PixelFormat swigToEnum(int swigValue) { 43 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 44 | return swigValues[swigValue]; 45 | for (int i = 0; i < swigValues.length; i++) 46 | if (swigValues[i].swigValue == swigValue) 47 | return swigValues[i]; 48 | throw new IllegalArgumentException("No enum " + PixelFormat.class + " with value " + swigValue); 49 | } 50 | 51 | private PixelFormat(String swigName) { 52 | this.swigName = swigName; 53 | this.swigValue = swigNext++; 54 | } 55 | 56 | private PixelFormat(String swigName, int swigValue) { 57 | this.swigName = swigName; 58 | this.swigValue = swigValue; 59 | swigNext = swigValue+1; 60 | } 61 | 62 | private PixelFormat(String swigName, PixelFormat swigEnum) { 63 | this.swigName = swigName; 64 | this.swigValue = swigEnum.swigValue; 65 | swigNext = this.swigValue+1; 66 | } 67 | 68 | private static PixelFormat[] swigValues = { UNCOMPRESSED_GRAYSCALE, UNCOMPRESSED_GRAY_ALPHA, UNCOMPRESSED_R5G6B5, UNCOMPRESSED_R8G8B8, UNCOMPRESSED_R5G5B5A1, UNCOMPRESSED_R4G4B4A4, UNCOMPRESSED_R8G8B8A8, UNCOMPRESSED_R32, UNCOMPRESSED_R32G32B32, UNCOMPRESSED_R32G32B32A32, COMPRESSED_DXT1_RGB, COMPRESSED_DXT1_RGBA, COMPRESSED_DXT3_RGBA, COMPRESSED_DXT5_RGBA, COMPRESSED_ETC1_RGB, COMPRESSED_ETC2_RGB, COMPRESSED_ETC2_EAC_RGBA, COMPRESSED_PVRT_RGB, COMPRESSED_PVRT_RGBA, COMPRESSED_ASTC_4x4_RGBA, COMPRESSED_ASTC_8x8_RGBA }; 69 | private static int swigNext = 0; 70 | private final int swigValue; 71 | private final String swigName; 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/raylib/Ray.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Ray { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Ray(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Ray obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Ray(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setPosition(Vector3 value) { 39 | RaylibJNI.Ray_position_set(swigCPtr, this, Vector3.getCPtr(value), value); 40 | } 41 | 42 | public Vector3 getPosition() { 43 | long cPtr = RaylibJNI.Ray_position_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new Vector3(cPtr, false); 45 | } 46 | 47 | public void setDirection(Vector3 value) { 48 | RaylibJNI.Ray_direction_set(swigCPtr, this, Vector3.getCPtr(value), value); 49 | } 50 | 51 | public Vector3 getDirection() { 52 | long cPtr = RaylibJNI.Ray_direction_get(swigCPtr, this); 53 | return (cPtr == 0) ? null : new Vector3(cPtr, false); 54 | } 55 | 56 | public Ray() { 57 | this(RaylibJNI.new_Ray(), true); 58 | } 59 | 60 | public Ray(Vector3 position, Vector3 direction) { 61 | this(); 62 | this.setPosition(position); 63 | this.setDirection(direction); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/raylib/RayHitInfo.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class RayHitInfo { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected RayHitInfo(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(RayHitInfo obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_RayHitInfo(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setHit(boolean value) { 39 | RaylibJNI.RayHitInfo_hit_set(swigCPtr, this, value); 40 | } 41 | 42 | public boolean getHit() { 43 | return RaylibJNI.RayHitInfo_hit_get(swigCPtr, this); 44 | } 45 | 46 | public void setDistance(float value) { 47 | RaylibJNI.RayHitInfo_distance_set(swigCPtr, this, value); 48 | } 49 | 50 | public float getDistance() { 51 | return RaylibJNI.RayHitInfo_distance_get(swigCPtr, this); 52 | } 53 | 54 | public void setPosition(Vector3 value) { 55 | RaylibJNI.RayHitInfo_position_set(swigCPtr, this, Vector3.getCPtr(value), value); 56 | } 57 | 58 | public Vector3 getPosition() { 59 | long cPtr = RaylibJNI.RayHitInfo_position_get(swigCPtr, this); 60 | return (cPtr == 0) ? null : new Vector3(cPtr, false); 61 | } 62 | 63 | public void setNormal(Vector3 value) { 64 | RaylibJNI.RayHitInfo_normal_set(swigCPtr, this, Vector3.getCPtr(value), value); 65 | } 66 | 67 | public Vector3 getNormal() { 68 | long cPtr = RaylibJNI.RayHitInfo_normal_get(swigCPtr, this); 69 | return (cPtr == 0) ? null : new Vector3(cPtr, false); 70 | } 71 | 72 | public RayHitInfo() { 73 | this(RaylibJNI.new_RayHitInfo(), true); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/raylib/Raylib.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Raylib implements RaylibConstants { 12 | public static void InitWindow(int width, int height, String title) { 13 | RaylibJNI.InitWindow(width, height, title); 14 | } 15 | 16 | public static void CloseWindow() { 17 | RaylibJNI.CloseWindow(); 18 | } 19 | 20 | public static boolean IsWindowReady() { 21 | return RaylibJNI.IsWindowReady(); 22 | } 23 | 24 | public static boolean WindowShouldClose() { 25 | return RaylibJNI.WindowShouldClose(); 26 | } 27 | 28 | public static boolean IsWindowMinimized() { 29 | return RaylibJNI.IsWindowMinimized(); 30 | } 31 | 32 | public static void ToggleFullscreen() { 33 | RaylibJNI.ToggleFullscreen(); 34 | } 35 | 36 | public static void SetWindowIcon(Image image) { 37 | RaylibJNI.SetWindowIcon(Image.getCPtr(image), image); 38 | } 39 | 40 | public static void SetWindowTitle(String title) { 41 | RaylibJNI.SetWindowTitle(title); 42 | } 43 | 44 | public static void SetWindowPosition(int x, int y) { 45 | RaylibJNI.SetWindowPosition(x, y); 46 | } 47 | 48 | public static void SetWindowMonitor(int monitor) { 49 | RaylibJNI.SetWindowMonitor(monitor); 50 | } 51 | 52 | public static void SetWindowMinSize(int width, int height) { 53 | RaylibJNI.SetWindowMinSize(width, height); 54 | } 55 | 56 | public static void SetWindowSize(int width, int height) { 57 | RaylibJNI.SetWindowSize(width, height); 58 | } 59 | 60 | public static int GetScreenWidth() { 61 | return RaylibJNI.GetScreenWidth(); 62 | } 63 | 64 | public static int GetScreenHeight() { 65 | return RaylibJNI.GetScreenHeight(); 66 | } 67 | 68 | public static void ShowCursor() { 69 | RaylibJNI.ShowCursor(); 70 | } 71 | 72 | public static void HideCursor() { 73 | RaylibJNI.HideCursor(); 74 | } 75 | 76 | public static boolean IsCursorHidden() { 77 | return RaylibJNI.IsCursorHidden(); 78 | } 79 | 80 | public static void EnableCursor() { 81 | RaylibJNI.EnableCursor(); 82 | } 83 | 84 | public static void DisableCursor() { 85 | RaylibJNI.DisableCursor(); 86 | } 87 | 88 | public static void ClearBackground(Color color) { 89 | RaylibJNI.ClearBackground(Color.getCPtr(color), color); 90 | } 91 | 92 | public static void BeginDrawing() { 93 | RaylibJNI.BeginDrawing(); 94 | } 95 | 96 | public static void EndDrawing() { 97 | RaylibJNI.EndDrawing(); 98 | } 99 | 100 | public static void BeginMode2D(Camera2D camera) { 101 | RaylibJNI.BeginMode2D(Camera2D.getCPtr(camera), camera); 102 | } 103 | 104 | public static void EndMode2D() { 105 | RaylibJNI.EndMode2D(); 106 | } 107 | 108 | public static void BeginMode3D(Camera3D camera) { 109 | RaylibJNI.BeginMode3D(Camera3D.getCPtr(camera), camera); 110 | } 111 | 112 | public static void EndMode3D() { 113 | RaylibJNI.EndMode3D(); 114 | } 115 | 116 | public static void BeginTextureMode(RenderTexture2D target) { 117 | RaylibJNI.BeginTextureMode(RenderTexture2D.getCPtr(target), target); 118 | } 119 | 120 | public static void EndTextureMode() { 121 | RaylibJNI.EndTextureMode(); 122 | } 123 | 124 | public static Ray GetMouseRay(Vector2 mousePosition, Camera3D camera) { 125 | return new Ray(RaylibJNI.GetMouseRay(Vector2.getCPtr(mousePosition), mousePosition, Camera3D.getCPtr(camera), camera), true); 126 | } 127 | 128 | public static Vector2 GetWorldToScreen(Vector3 position, Camera3D camera) { 129 | return new Vector2(RaylibJNI.GetWorldToScreen(Vector3.getCPtr(position), position, Camera3D.getCPtr(camera), camera), true); 130 | } 131 | 132 | public static Matrix GetCameraMatrix(Camera3D camera) { 133 | return new Matrix(RaylibJNI.GetCameraMatrix(Camera3D.getCPtr(camera), camera), true); 134 | } 135 | 136 | public static void SetTargetFPS(int fps) { 137 | RaylibJNI.SetTargetFPS(fps); 138 | } 139 | 140 | public static int GetFPS() { 141 | return RaylibJNI.GetFPS(); 142 | } 143 | 144 | public static float GetFrameTime() { 145 | return RaylibJNI.GetFrameTime(); 146 | } 147 | 148 | public static double GetTime() { 149 | return RaylibJNI.GetTime(); 150 | } 151 | 152 | public static int ColorToInt(Color color) { 153 | return RaylibJNI.ColorToInt(Color.getCPtr(color), color); 154 | } 155 | 156 | public static Vector4 ColorNormalize(Color color) { 157 | return new Vector4(RaylibJNI.ColorNormalize(Color.getCPtr(color), color), true); 158 | } 159 | 160 | public static Vector3 ColorToHSV(Color color) { 161 | return new Vector3(RaylibJNI.ColorToHSV(Color.getCPtr(color), color), true); 162 | } 163 | 164 | public static Color GetColor(int hexValue) { 165 | return new Color(RaylibJNI.GetColor(hexValue), true); 166 | } 167 | 168 | public static Color Fade(Color color, float alpha) { 169 | return new Color(RaylibJNI.Fade(Color.getCPtr(color), color, alpha), true); 170 | } 171 | 172 | public static void ShowLogo() { 173 | RaylibJNI.ShowLogo(); 174 | } 175 | 176 | public static void SetConfigFlags(short flags) { 177 | RaylibJNI.SetConfigFlags(flags); 178 | } 179 | 180 | public static void SetTraceLog(short types) { 181 | RaylibJNI.SetTraceLog(types); 182 | } 183 | 184 | public static void TraceLog(int logType, String text) { 185 | RaylibJNI.TraceLog(logType, text); 186 | } 187 | 188 | public static void TakeScreenshot(String fileName) { 189 | RaylibJNI.TakeScreenshot(fileName); 190 | } 191 | 192 | public static int GetRandomValue(int min, int max) { 193 | return RaylibJNI.GetRandomValue(min, max); 194 | } 195 | 196 | public static boolean IsFileExtension(String fileName, String ext) { 197 | return RaylibJNI.IsFileExtension(fileName, ext); 198 | } 199 | 200 | public static String GetExtension(String fileName) { 201 | return RaylibJNI.GetExtension(fileName); 202 | } 203 | 204 | public static String GetFileName(String filePath) { 205 | return RaylibJNI.GetFileName(filePath); 206 | } 207 | 208 | public static String GetDirectoryPath(String fileName) { 209 | return RaylibJNI.GetDirectoryPath(fileName); 210 | } 211 | 212 | public static String GetWorkingDirectory() { 213 | return RaylibJNI.GetWorkingDirectory(); 214 | } 215 | 216 | public static boolean ChangeDirectory(String dir) { 217 | return RaylibJNI.ChangeDirectory(dir); 218 | } 219 | 220 | public static boolean IsFileDropped() { 221 | return RaylibJNI.IsFileDropped(); 222 | } 223 | 224 | public static SWIGTYPE_p_p_char GetDroppedFiles(SWIGTYPE_p_int count) { 225 | long cPtr = RaylibJNI.GetDroppedFiles(SWIGTYPE_p_int.getCPtr(count)); 226 | return (cPtr == 0) ? null : new SWIGTYPE_p_p_char(cPtr, false); 227 | } 228 | 229 | public static void ClearDroppedFiles() { 230 | RaylibJNI.ClearDroppedFiles(); 231 | } 232 | 233 | public static void StorageSaveValue(int position, int value) { 234 | RaylibJNI.StorageSaveValue(position, value); 235 | } 236 | 237 | public static int StorageLoadValue(int position) { 238 | return RaylibJNI.StorageLoadValue(position); 239 | } 240 | 241 | public static boolean IsKeyPressed(int key) { 242 | return RaylibJNI.IsKeyPressed(key); 243 | } 244 | 245 | public static boolean IsKeyDown(int key) { 246 | return RaylibJNI.IsKeyDown(key); 247 | } 248 | 249 | public static boolean IsKeyReleased(int key) { 250 | return RaylibJNI.IsKeyReleased(key); 251 | } 252 | 253 | public static boolean IsKeyUp(int key) { 254 | return RaylibJNI.IsKeyUp(key); 255 | } 256 | 257 | public static int GetKeyPressed() { 258 | return RaylibJNI.GetKeyPressed(); 259 | } 260 | 261 | public static void SetExitKey(int key) { 262 | RaylibJNI.SetExitKey(key); 263 | } 264 | 265 | public static boolean IsGamepadAvailable(int gamepad) { 266 | return RaylibJNI.IsGamepadAvailable(gamepad); 267 | } 268 | 269 | public static boolean IsGamepadName(int gamepad, String name) { 270 | return RaylibJNI.IsGamepadName(gamepad, name); 271 | } 272 | 273 | public static String GetGamepadName(int gamepad) { 274 | return RaylibJNI.GetGamepadName(gamepad); 275 | } 276 | 277 | public static boolean IsGamepadButtonPressed(int gamepad, int button) { 278 | return RaylibJNI.IsGamepadButtonPressed(gamepad, button); 279 | } 280 | 281 | public static boolean IsGamepadButtonDown(int gamepad, int button) { 282 | return RaylibJNI.IsGamepadButtonDown(gamepad, button); 283 | } 284 | 285 | public static boolean IsGamepadButtonReleased(int gamepad, int button) { 286 | return RaylibJNI.IsGamepadButtonReleased(gamepad, button); 287 | } 288 | 289 | public static boolean IsGamepadButtonUp(int gamepad, int button) { 290 | return RaylibJNI.IsGamepadButtonUp(gamepad, button); 291 | } 292 | 293 | public static int GetGamepadButtonPressed() { 294 | return RaylibJNI.GetGamepadButtonPressed(); 295 | } 296 | 297 | public static int GetGamepadAxisCount(int gamepad) { 298 | return RaylibJNI.GetGamepadAxisCount(gamepad); 299 | } 300 | 301 | public static float GetGamepadAxisMovement(int gamepad, int axis) { 302 | return RaylibJNI.GetGamepadAxisMovement(gamepad, axis); 303 | } 304 | 305 | public static boolean IsMouseButtonPressed(int button) { 306 | return RaylibJNI.IsMouseButtonPressed(button); 307 | } 308 | 309 | public static boolean IsMouseButtonDown(int button) { 310 | return RaylibJNI.IsMouseButtonDown(button); 311 | } 312 | 313 | public static boolean IsMouseButtonReleased(int button) { 314 | return RaylibJNI.IsMouseButtonReleased(button); 315 | } 316 | 317 | public static boolean IsMouseButtonUp(int button) { 318 | return RaylibJNI.IsMouseButtonUp(button); 319 | } 320 | 321 | public static int GetMouseX() { 322 | return RaylibJNI.GetMouseX(); 323 | } 324 | 325 | public static int GetMouseY() { 326 | return RaylibJNI.GetMouseY(); 327 | } 328 | 329 | public static Vector2 GetMousePosition() { 330 | return new Vector2(RaylibJNI.GetMousePosition(), true); 331 | } 332 | 333 | public static void SetMousePosition(Vector2 position) { 334 | RaylibJNI.SetMousePosition(Vector2.getCPtr(position), position); 335 | } 336 | 337 | public static void SetMouseScale(float scale) { 338 | RaylibJNI.SetMouseScale(scale); 339 | } 340 | 341 | public static int GetMouseWheelMove() { 342 | return RaylibJNI.GetMouseWheelMove(); 343 | } 344 | 345 | public static int GetTouchX() { 346 | return RaylibJNI.GetTouchX(); 347 | } 348 | 349 | public static int GetTouchY() { 350 | return RaylibJNI.GetTouchY(); 351 | } 352 | 353 | public static Vector2 GetTouchPosition(int index) { 354 | return new Vector2(RaylibJNI.GetTouchPosition(index), true); 355 | } 356 | 357 | public static void SetGesturesEnabled(long gestureFlags) { 358 | RaylibJNI.SetGesturesEnabled(gestureFlags); 359 | } 360 | 361 | public static boolean IsGestureDetected(int gesture) { 362 | return RaylibJNI.IsGestureDetected(gesture); 363 | } 364 | 365 | public static int GetGestureDetected() { 366 | return RaylibJNI.GetGestureDetected(); 367 | } 368 | 369 | public static int GetTouchPointsCount() { 370 | return RaylibJNI.GetTouchPointsCount(); 371 | } 372 | 373 | public static float GetGestureHoldDuration() { 374 | return RaylibJNI.GetGestureHoldDuration(); 375 | } 376 | 377 | public static Vector2 GetGestureDragVector() { 378 | return new Vector2(RaylibJNI.GetGestureDragVector(), true); 379 | } 380 | 381 | public static float GetGestureDragAngle() { 382 | return RaylibJNI.GetGestureDragAngle(); 383 | } 384 | 385 | public static Vector2 GetGesturePinchVector() { 386 | return new Vector2(RaylibJNI.GetGesturePinchVector(), true); 387 | } 388 | 389 | public static float GetGesturePinchAngle() { 390 | return RaylibJNI.GetGesturePinchAngle(); 391 | } 392 | 393 | public static void SetCameraMode(Camera3D camera, int mode) { 394 | RaylibJNI.SetCameraMode(Camera3D.getCPtr(camera), camera, mode); 395 | } 396 | 397 | public static void UpdateCamera(Camera3D camera) { 398 | RaylibJNI.UpdateCamera(Camera3D.getCPtr(camera), camera); 399 | } 400 | 401 | public static void SetCameraPanControl(int panKey) { 402 | RaylibJNI.SetCameraPanControl(panKey); 403 | } 404 | 405 | public static void SetCameraAltControl(int altKey) { 406 | RaylibJNI.SetCameraAltControl(altKey); 407 | } 408 | 409 | public static void SetCameraSmoothZoomControl(int szKey) { 410 | RaylibJNI.SetCameraSmoothZoomControl(szKey); 411 | } 412 | 413 | public static void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey) { 414 | RaylibJNI.SetCameraMoveControls(frontKey, backKey, rightKey, leftKey, upKey, downKey); 415 | } 416 | 417 | public static void DrawPixel(int posX, int posY, Color color) { 418 | RaylibJNI.DrawPixel(posX, posY, Color.getCPtr(color), color); 419 | } 420 | 421 | public static void DrawPixelV(Vector2 position, Color color) { 422 | RaylibJNI.DrawPixelV(Vector2.getCPtr(position), position, Color.getCPtr(color), color); 423 | } 424 | 425 | public static void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color) { 426 | RaylibJNI.DrawLine(startPosX, startPosY, endPosX, endPosY, Color.getCPtr(color), color); 427 | } 428 | 429 | public static void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) { 430 | RaylibJNI.DrawLineV(Vector2.getCPtr(startPos), startPos, Vector2.getCPtr(endPos), endPos, Color.getCPtr(color), color); 431 | } 432 | 433 | public static void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color) { 434 | RaylibJNI.DrawLineEx(Vector2.getCPtr(startPos), startPos, Vector2.getCPtr(endPos), endPos, thick, Color.getCPtr(color), color); 435 | } 436 | 437 | public static void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color) { 438 | RaylibJNI.DrawLineBezier(Vector2.getCPtr(startPos), startPos, Vector2.getCPtr(endPos), endPos, thick, Color.getCPtr(color), color); 439 | } 440 | 441 | public static void DrawCircle(int centerX, int centerY, float radius, Color color) { 442 | RaylibJNI.DrawCircle(centerX, centerY, radius, Color.getCPtr(color), color); 443 | } 444 | 445 | public static void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2) { 446 | RaylibJNI.DrawCircleGradient(centerX, centerY, radius, Color.getCPtr(color1), color1, Color.getCPtr(color2), color2); 447 | } 448 | 449 | public static void DrawCircleV(Vector2 center, float radius, Color color) { 450 | RaylibJNI.DrawCircleV(Vector2.getCPtr(center), center, radius, Color.getCPtr(color), color); 451 | } 452 | 453 | public static void DrawCircleLines(int centerX, int centerY, float radius, Color color) { 454 | RaylibJNI.DrawCircleLines(centerX, centerY, radius, Color.getCPtr(color), color); 455 | } 456 | 457 | public static void DrawRectangle(int posX, int posY, int width, int height, Color color) { 458 | RaylibJNI.DrawRectangle(posX, posY, width, height, Color.getCPtr(color), color); 459 | } 460 | 461 | public static void DrawRectangleV(Vector2 position, Vector2 size, Color color) { 462 | RaylibJNI.DrawRectangleV(Vector2.getCPtr(position), position, Vector2.getCPtr(size), size, Color.getCPtr(color), color); 463 | } 464 | 465 | public static void DrawRectangleRec(Rectangle rec, Color color) { 466 | RaylibJNI.DrawRectangleRec(Rectangle.getCPtr(rec), rec, Color.getCPtr(color), color); 467 | } 468 | 469 | public static void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color) { 470 | RaylibJNI.DrawRectanglePro(Rectangle.getCPtr(rec), rec, Vector2.getCPtr(origin), origin, rotation, Color.getCPtr(color), color); 471 | } 472 | 473 | public static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2) { 474 | RaylibJNI.DrawRectangleGradientV(posX, posY, width, height, Color.getCPtr(color1), color1, Color.getCPtr(color2), color2); 475 | } 476 | 477 | public static void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2) { 478 | RaylibJNI.DrawRectangleGradientH(posX, posY, width, height, Color.getCPtr(color1), color1, Color.getCPtr(color2), color2); 479 | } 480 | 481 | public static void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4) { 482 | RaylibJNI.DrawRectangleGradientEx(Rectangle.getCPtr(rec), rec, Color.getCPtr(col1), col1, Color.getCPtr(col2), col2, Color.getCPtr(col3), col3, Color.getCPtr(col4), col4); 483 | } 484 | 485 | public static void DrawRectangleLines(int posX, int posY, int width, int height, Color color) { 486 | RaylibJNI.DrawRectangleLines(posX, posY, width, height, Color.getCPtr(color), color); 487 | } 488 | 489 | public static void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color) { 490 | RaylibJNI.DrawRectangleLinesEx(Rectangle.getCPtr(rec), rec, lineThick, Color.getCPtr(color), color); 491 | } 492 | 493 | public static void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) { 494 | RaylibJNI.DrawTriangle(Vector2.getCPtr(v1), v1, Vector2.getCPtr(v2), v2, Vector2.getCPtr(v3), v3, Color.getCPtr(color), color); 495 | } 496 | 497 | public static void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color) { 498 | RaylibJNI.DrawTriangleLines(Vector2.getCPtr(v1), v1, Vector2.getCPtr(v2), v2, Vector2.getCPtr(v3), v3, Color.getCPtr(color), color); 499 | } 500 | 501 | public static void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color) { 502 | RaylibJNI.DrawPoly(Vector2.getCPtr(center), center, sides, radius, rotation, Color.getCPtr(color), color); 503 | } 504 | 505 | public static void DrawPolyEx(Vector2 points, int numPoints, Color color) { 506 | RaylibJNI.DrawPolyEx(Vector2.getCPtr(points), points, numPoints, Color.getCPtr(color), color); 507 | } 508 | 509 | public static void DrawPolyExLines(Vector2 points, int numPoints, Color color) { 510 | RaylibJNI.DrawPolyExLines(Vector2.getCPtr(points), points, numPoints, Color.getCPtr(color), color); 511 | } 512 | 513 | public static boolean CheckCollisionRecs(Rectangle rec1, Rectangle rec2) { 514 | return RaylibJNI.CheckCollisionRecs(Rectangle.getCPtr(rec1), rec1, Rectangle.getCPtr(rec2), rec2); 515 | } 516 | 517 | public static boolean CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2) { 518 | return RaylibJNI.CheckCollisionCircles(Vector2.getCPtr(center1), center1, radius1, Vector2.getCPtr(center2), center2, radius2); 519 | } 520 | 521 | public static boolean CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec) { 522 | return RaylibJNI.CheckCollisionCircleRec(Vector2.getCPtr(center), center, radius, Rectangle.getCPtr(rec), rec); 523 | } 524 | 525 | public static Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) { 526 | return new Rectangle(RaylibJNI.GetCollisionRec(Rectangle.getCPtr(rec1), rec1, Rectangle.getCPtr(rec2), rec2), true); 527 | } 528 | 529 | public static boolean CheckCollisionPointRec(Vector2 point, Rectangle rec) { 530 | return RaylibJNI.CheckCollisionPointRec(Vector2.getCPtr(point), point, Rectangle.getCPtr(rec), rec); 531 | } 532 | 533 | public static boolean CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius) { 534 | return RaylibJNI.CheckCollisionPointCircle(Vector2.getCPtr(point), point, Vector2.getCPtr(center), center, radius); 535 | } 536 | 537 | public static boolean CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3) { 538 | return RaylibJNI.CheckCollisionPointTriangle(Vector2.getCPtr(point), point, Vector2.getCPtr(p1), p1, Vector2.getCPtr(p2), p2, Vector2.getCPtr(p3), p3); 539 | } 540 | 541 | public static Image LoadImage(String fileName) { 542 | return new Image(RaylibJNI.LoadImage(fileName), true); 543 | } 544 | 545 | public static Image LoadImageEx(Color pixels, int width, int height) { 546 | return new Image(RaylibJNI.LoadImageEx(Color.getCPtr(pixels), pixels, width, height), true); 547 | } 548 | 549 | public static Image LoadImagePro(SWIGTYPE_p_void data, int width, int height, int format) { 550 | return new Image(RaylibJNI.LoadImagePro(SWIGTYPE_p_void.getCPtr(data), width, height, format), true); 551 | } 552 | 553 | public static Image LoadImageRaw(String fileName, int width, int height, int format, int headerSize) { 554 | return new Image(RaylibJNI.LoadImageRaw(fileName, width, height, format, headerSize), true); 555 | } 556 | 557 | public static void ExportImage(String fileName, Image image) { 558 | RaylibJNI.ExportImage(fileName, Image.getCPtr(image), image); 559 | } 560 | 561 | public static Texture2D LoadTexture(String fileName) { 562 | return new Texture2D(RaylibJNI.LoadTexture(fileName), true); 563 | } 564 | 565 | public static Texture2D LoadTextureFromImage(Image image) { 566 | return new Texture2D(RaylibJNI.LoadTextureFromImage(Image.getCPtr(image), image), true); 567 | } 568 | 569 | public static RenderTexture2D LoadRenderTexture(int width, int height) { 570 | return new RenderTexture2D(RaylibJNI.LoadRenderTexture(width, height), true); 571 | } 572 | 573 | public static void UnloadImage(Image image) { 574 | RaylibJNI.UnloadImage(Image.getCPtr(image), image); 575 | } 576 | 577 | public static void UnloadTexture(Texture2D texture) { 578 | RaylibJNI.UnloadTexture(Texture2D.getCPtr(texture), texture); 579 | } 580 | 581 | public static void UnloadRenderTexture(RenderTexture2D target) { 582 | RaylibJNI.UnloadRenderTexture(RenderTexture2D.getCPtr(target), target); 583 | } 584 | 585 | public static Color GetImageData(Image image) { 586 | long cPtr = RaylibJNI.GetImageData(Image.getCPtr(image), image); 587 | return (cPtr == 0) ? null : new Color(cPtr, false); 588 | } 589 | 590 | public static Vector4 GetImageDataNormalized(Image image) { 591 | long cPtr = RaylibJNI.GetImageDataNormalized(Image.getCPtr(image), image); 592 | return (cPtr == 0) ? null : new Vector4(cPtr, false); 593 | } 594 | 595 | public static int GetPixelDataSize(int width, int height, int format) { 596 | return RaylibJNI.GetPixelDataSize(width, height, format); 597 | } 598 | 599 | public static Image GetTextureData(Texture2D texture) { 600 | return new Image(RaylibJNI.GetTextureData(Texture2D.getCPtr(texture), texture), true); 601 | } 602 | 603 | public static void UpdateTexture(Texture2D texture, SWIGTYPE_p_void pixels) { 604 | RaylibJNI.UpdateTexture(Texture2D.getCPtr(texture), texture, SWIGTYPE_p_void.getCPtr(pixels)); 605 | } 606 | 607 | public static Image ImageCopy(Image image) { 608 | return new Image(RaylibJNI.ImageCopy(Image.getCPtr(image), image), true); 609 | } 610 | 611 | public static void ImageToPOT(Image image, Color fillColor) { 612 | RaylibJNI.ImageToPOT(Image.getCPtr(image), image, Color.getCPtr(fillColor), fillColor); 613 | } 614 | 615 | public static void ImageFormat(Image image, int newFormat) { 616 | RaylibJNI.ImageFormat(Image.getCPtr(image), image, newFormat); 617 | } 618 | 619 | public static void ImageAlphaMask(Image image, Image alphaMask) { 620 | RaylibJNI.ImageAlphaMask(Image.getCPtr(image), image, Image.getCPtr(alphaMask), alphaMask); 621 | } 622 | 623 | public static void ImageAlphaClear(Image image, Color color, float threshold) { 624 | RaylibJNI.ImageAlphaClear(Image.getCPtr(image), image, Color.getCPtr(color), color, threshold); 625 | } 626 | 627 | public static void ImageAlphaCrop(Image image, float threshold) { 628 | RaylibJNI.ImageAlphaCrop(Image.getCPtr(image), image, threshold); 629 | } 630 | 631 | public static void ImageAlphaPremultiply(Image image) { 632 | RaylibJNI.ImageAlphaPremultiply(Image.getCPtr(image), image); 633 | } 634 | 635 | public static void ImageCrop(Image image, Rectangle crop) { 636 | RaylibJNI.ImageCrop(Image.getCPtr(image), image, Rectangle.getCPtr(crop), crop); 637 | } 638 | 639 | public static void ImageResize(Image image, int newWidth, int newHeight) { 640 | RaylibJNI.ImageResize(Image.getCPtr(image), image, newWidth, newHeight); 641 | } 642 | 643 | public static void ImageResizeNN(Image image, int newWidth, int newHeight) { 644 | RaylibJNI.ImageResizeNN(Image.getCPtr(image), image, newWidth, newHeight); 645 | } 646 | 647 | public static void ImageResizeCanvas(Image image, int newWidth, int newHeight, int offsetX, int offsetY, Color color) { 648 | RaylibJNI.ImageResizeCanvas(Image.getCPtr(image), image, newWidth, newHeight, offsetX, offsetY, Color.getCPtr(color), color); 649 | } 650 | 651 | public static void ImageMipmaps(Image image) { 652 | RaylibJNI.ImageMipmaps(Image.getCPtr(image), image); 653 | } 654 | 655 | public static void ImageDither(Image image, int rBpp, int gBpp, int bBpp, int aBpp) { 656 | RaylibJNI.ImageDither(Image.getCPtr(image), image, rBpp, gBpp, bBpp, aBpp); 657 | } 658 | 659 | public static Image ImageText(String text, int fontSize, Color color) { 660 | return new Image(RaylibJNI.ImageText(text, fontSize, Color.getCPtr(color), color), true); 661 | } 662 | 663 | public static Image ImageTextEx(Font font, String text, float fontSize, float spacing, Color tint) { 664 | return new Image(RaylibJNI.ImageTextEx(Font.getCPtr(font), font, text, fontSize, spacing, Color.getCPtr(tint), tint), true); 665 | } 666 | 667 | public static void ImageDraw(Image dst, Image src, Rectangle srcRec, Rectangle dstRec) { 668 | RaylibJNI.ImageDraw(Image.getCPtr(dst), dst, Image.getCPtr(src), src, Rectangle.getCPtr(srcRec), srcRec, Rectangle.getCPtr(dstRec), dstRec); 669 | } 670 | 671 | public static void ImageDrawRectangle(Image dst, Vector2 position, Rectangle rec, Color color) { 672 | RaylibJNI.ImageDrawRectangle(Image.getCPtr(dst), dst, Vector2.getCPtr(position), position, Rectangle.getCPtr(rec), rec, Color.getCPtr(color), color); 673 | } 674 | 675 | public static void ImageDrawText(Image dst, Vector2 position, String text, int fontSize, Color color) { 676 | RaylibJNI.ImageDrawText(Image.getCPtr(dst), dst, Vector2.getCPtr(position), position, text, fontSize, Color.getCPtr(color), color); 677 | } 678 | 679 | public static void ImageDrawTextEx(Image dst, Vector2 position, Font font, String text, float fontSize, float spacing, Color color) { 680 | RaylibJNI.ImageDrawTextEx(Image.getCPtr(dst), dst, Vector2.getCPtr(position), position, Font.getCPtr(font), font, text, fontSize, spacing, Color.getCPtr(color), color); 681 | } 682 | 683 | public static void ImageFlipVertical(Image image) { 684 | RaylibJNI.ImageFlipVertical(Image.getCPtr(image), image); 685 | } 686 | 687 | public static void ImageFlipHorizontal(Image image) { 688 | RaylibJNI.ImageFlipHorizontal(Image.getCPtr(image), image); 689 | } 690 | 691 | public static void ImageRotateCW(Image image) { 692 | RaylibJNI.ImageRotateCW(Image.getCPtr(image), image); 693 | } 694 | 695 | public static void ImageRotateCCW(Image image) { 696 | RaylibJNI.ImageRotateCCW(Image.getCPtr(image), image); 697 | } 698 | 699 | public static void ImageColorTint(Image image, Color color) { 700 | RaylibJNI.ImageColorTint(Image.getCPtr(image), image, Color.getCPtr(color), color); 701 | } 702 | 703 | public static void ImageColorInvert(Image image) { 704 | RaylibJNI.ImageColorInvert(Image.getCPtr(image), image); 705 | } 706 | 707 | public static void ImageColorGrayscale(Image image) { 708 | RaylibJNI.ImageColorGrayscale(Image.getCPtr(image), image); 709 | } 710 | 711 | public static void ImageColorContrast(Image image, float contrast) { 712 | RaylibJNI.ImageColorContrast(Image.getCPtr(image), image, contrast); 713 | } 714 | 715 | public static void ImageColorBrightness(Image image, int brightness) { 716 | RaylibJNI.ImageColorBrightness(Image.getCPtr(image), image, brightness); 717 | } 718 | 719 | public static void ImageColorReplace(Image image, Color color, Color replace) { 720 | RaylibJNI.ImageColorReplace(Image.getCPtr(image), image, Color.getCPtr(color), color, Color.getCPtr(replace), replace); 721 | } 722 | 723 | public static Image GenImageColor(int width, int height, Color color) { 724 | return new Image(RaylibJNI.GenImageColor(width, height, Color.getCPtr(color), color), true); 725 | } 726 | 727 | public static Image GenImageGradientV(int width, int height, Color top, Color bottom) { 728 | return new Image(RaylibJNI.GenImageGradientV(width, height, Color.getCPtr(top), top, Color.getCPtr(bottom), bottom), true); 729 | } 730 | 731 | public static Image GenImageGradientH(int width, int height, Color left, Color right) { 732 | return new Image(RaylibJNI.GenImageGradientH(width, height, Color.getCPtr(left), left, Color.getCPtr(right), right), true); 733 | } 734 | 735 | public static Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer) { 736 | return new Image(RaylibJNI.GenImageGradientRadial(width, height, density, Color.getCPtr(inner), inner, Color.getCPtr(outer), outer), true); 737 | } 738 | 739 | public static Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2) { 740 | return new Image(RaylibJNI.GenImageChecked(width, height, checksX, checksY, Color.getCPtr(col1), col1, Color.getCPtr(col2), col2), true); 741 | } 742 | 743 | public static Image GenImageWhiteNoise(int width, int height, float factor) { 744 | return new Image(RaylibJNI.GenImageWhiteNoise(width, height, factor), true); 745 | } 746 | 747 | public static Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale) { 748 | return new Image(RaylibJNI.GenImagePerlinNoise(width, height, offsetX, offsetY, scale), true); 749 | } 750 | 751 | public static Image GenImageCellular(int width, int height, int tileSize) { 752 | return new Image(RaylibJNI.GenImageCellular(width, height, tileSize), true); 753 | } 754 | 755 | public static void GenTextureMipmaps(Texture2D texture) { 756 | RaylibJNI.GenTextureMipmaps(Texture2D.getCPtr(texture), texture); 757 | } 758 | 759 | public static void SetTextureFilter(Texture2D texture, int filterMode) { 760 | RaylibJNI.SetTextureFilter(Texture2D.getCPtr(texture), texture, filterMode); 761 | } 762 | 763 | public static void SetTextureWrap(Texture2D texture, int wrapMode) { 764 | RaylibJNI.SetTextureWrap(Texture2D.getCPtr(texture), texture, wrapMode); 765 | } 766 | 767 | public static void DrawTexture(Texture2D texture, int posX, int posY, Color tint) { 768 | RaylibJNI.DrawTexture(Texture2D.getCPtr(texture), texture, posX, posY, Color.getCPtr(tint), tint); 769 | } 770 | 771 | public static void DrawTextureV(Texture2D texture, Vector2 position, Color tint) { 772 | RaylibJNI.DrawTextureV(Texture2D.getCPtr(texture), texture, Vector2.getCPtr(position), position, Color.getCPtr(tint), tint); 773 | } 774 | 775 | public static void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint) { 776 | RaylibJNI.DrawTextureEx(Texture2D.getCPtr(texture), texture, Vector2.getCPtr(position), position, rotation, scale, Color.getCPtr(tint), tint); 777 | } 778 | 779 | public static void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint) { 780 | RaylibJNI.DrawTextureRec(Texture2D.getCPtr(texture), texture, Rectangle.getCPtr(sourceRec), sourceRec, Vector2.getCPtr(position), position, Color.getCPtr(tint), tint); 781 | } 782 | 783 | public static void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint) { 784 | RaylibJNI.DrawTexturePro(Texture2D.getCPtr(texture), texture, Rectangle.getCPtr(sourceRec), sourceRec, Rectangle.getCPtr(destRec), destRec, Vector2.getCPtr(origin), origin, rotation, Color.getCPtr(tint), tint); 785 | } 786 | 787 | public static Font GetFontDefault() { 788 | return new Font(RaylibJNI.GetFontDefault(), true); 789 | } 790 | 791 | public static Font LoadFont(String fileName) { 792 | return new Font(RaylibJNI.LoadFont(fileName), true); 793 | } 794 | 795 | public static Font LoadFontEx(String fileName, int fontSize, int charsCount, String fontChars) { 796 | // TODO: Convert each character in fontChars to a unicode code point of size int, then pass an array of ints. 797 | long fontCharsPtr = 0; 798 | return new Font(RaylibJNI.LoadFontEx(fileName, fontSize, charsCount, fontCharsPtr), true); 799 | } 800 | 801 | public static CharInfo LoadFontData(String fileName, int fontSize, SWIGTYPE_p_int fontChars, int charsCount, boolean sdf) { 802 | long cPtr = RaylibJNI.LoadFontData(fileName, fontSize, SWIGTYPE_p_int.getCPtr(fontChars), charsCount, sdf); 803 | return (cPtr == 0) ? null : new CharInfo(cPtr, false); 804 | } 805 | 806 | public static Image GenImageFontAtlas(CharInfo chars, int fontSize, int charsCount, int padding, int packMethod) { 807 | return new Image(RaylibJNI.GenImageFontAtlas(CharInfo.getCPtr(chars), chars, fontSize, charsCount, padding, packMethod), true); 808 | } 809 | 810 | public static void UnloadFont(Font font) { 811 | RaylibJNI.UnloadFont(Font.getCPtr(font), font); 812 | } 813 | 814 | public static void DrawFPS(int posX, int posY) { 815 | RaylibJNI.DrawFPS(posX, posY); 816 | } 817 | 818 | public static void DrawText(String text, int posX, int posY, int fontSize, Color color) { 819 | RaylibJNI.DrawText(text, posX, posY, fontSize, Color.getCPtr(color), color); 820 | } 821 | 822 | public static void DrawTextEx(Font font, String text, Vector2 position, float fontSize, float spacing, Color tint) { 823 | RaylibJNI.DrawTextEx(Font.getCPtr(font), font, text, Vector2.getCPtr(position), position, fontSize, spacing, Color.getCPtr(tint), tint); 824 | } 825 | 826 | public static int MeasureText(String text, int fontSize) { 827 | return RaylibJNI.MeasureText(text, fontSize); 828 | } 829 | 830 | public static Vector2 MeasureTextEx(Font font, String text, float fontSize, float spacing) { 831 | return new Vector2(RaylibJNI.MeasureTextEx(Font.getCPtr(font), font, text, fontSize, spacing), true); 832 | } 833 | 834 | public static String FormatText(String text) { 835 | return RaylibJNI.FormatText(text); 836 | } 837 | 838 | public static String SubText(String text, int position, int length) { 839 | return RaylibJNI.SubText(text, position, length); 840 | } 841 | 842 | public static int GetGlyphIndex(Font font, int character) { 843 | return RaylibJNI.GetGlyphIndex(Font.getCPtr(font), font, character); 844 | } 845 | 846 | public static void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color) { 847 | RaylibJNI.DrawLine3D(Vector3.getCPtr(startPos), startPos, Vector3.getCPtr(endPos), endPos, Color.getCPtr(color), color); 848 | } 849 | 850 | public static void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color) { 851 | RaylibJNI.DrawCircle3D(Vector3.getCPtr(center), center, radius, Vector3.getCPtr(rotationAxis), rotationAxis, rotationAngle, Color.getCPtr(color), color); 852 | } 853 | 854 | public static void DrawCube(Vector3 position, float width, float height, float length, Color color) { 855 | RaylibJNI.DrawCube(Vector3.getCPtr(position), position, width, height, length, Color.getCPtr(color), color); 856 | } 857 | 858 | public static void DrawCubeV(Vector3 position, Vector3 size, Color color) { 859 | RaylibJNI.DrawCubeV(Vector3.getCPtr(position), position, Vector3.getCPtr(size), size, Color.getCPtr(color), color); 860 | } 861 | 862 | public static void DrawCubeWires(Vector3 position, float width, float height, float length, Color color) { 863 | RaylibJNI.DrawCubeWires(Vector3.getCPtr(position), position, width, height, length, Color.getCPtr(color), color); 864 | } 865 | 866 | public static void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color) { 867 | RaylibJNI.DrawCubeTexture(Texture2D.getCPtr(texture), texture, Vector3.getCPtr(position), position, width, height, length, Color.getCPtr(color), color); 868 | } 869 | 870 | public static void DrawSphere(Vector3 centerPos, float radius, Color color) { 871 | RaylibJNI.DrawSphere(Vector3.getCPtr(centerPos), centerPos, radius, Color.getCPtr(color), color); 872 | } 873 | 874 | public static void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color) { 875 | RaylibJNI.DrawSphereEx(Vector3.getCPtr(centerPos), centerPos, radius, rings, slices, Color.getCPtr(color), color); 876 | } 877 | 878 | public static void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color) { 879 | RaylibJNI.DrawSphereWires(Vector3.getCPtr(centerPos), centerPos, radius, rings, slices, Color.getCPtr(color), color); 880 | } 881 | 882 | public static void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color) { 883 | RaylibJNI.DrawCylinder(Vector3.getCPtr(position), position, radiusTop, radiusBottom, height, slices, Color.getCPtr(color), color); 884 | } 885 | 886 | public static void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color) { 887 | RaylibJNI.DrawCylinderWires(Vector3.getCPtr(position), position, radiusTop, radiusBottom, height, slices, Color.getCPtr(color), color); 888 | } 889 | 890 | public static void DrawPlane(Vector3 centerPos, Vector2 size, Color color) { 891 | RaylibJNI.DrawPlane(Vector3.getCPtr(centerPos), centerPos, Vector2.getCPtr(size), size, Color.getCPtr(color), color); 892 | } 893 | 894 | public static void DrawRay(Ray ray, Color color) { 895 | RaylibJNI.DrawRay(Ray.getCPtr(ray), ray, Color.getCPtr(color), color); 896 | } 897 | 898 | public static void DrawGrid(int slices, float spacing) { 899 | RaylibJNI.DrawGrid(slices, spacing); 900 | } 901 | 902 | public static void DrawGizmo(Vector3 position) { 903 | RaylibJNI.DrawGizmo(Vector3.getCPtr(position), position); 904 | } 905 | 906 | public static Model LoadModel(String fileName) { 907 | return new Model(RaylibJNI.LoadModel(fileName), true); 908 | } 909 | 910 | public static Model LoadModelFromMesh(Mesh mesh) { 911 | return new Model(RaylibJNI.LoadModelFromMesh(Mesh.getCPtr(mesh), mesh), true); 912 | } 913 | 914 | public static void UnloadModel(Model model) { 915 | RaylibJNI.UnloadModel(Model.getCPtr(model), model); 916 | } 917 | 918 | public static Mesh LoadMesh(String fileName) { 919 | return new Mesh(RaylibJNI.LoadMesh(fileName), true); 920 | } 921 | 922 | public static void UnloadMesh(Mesh mesh) { 923 | RaylibJNI.UnloadMesh(Mesh.getCPtr(mesh), mesh); 924 | } 925 | 926 | public static void ExportMesh(String fileName, Mesh mesh) { 927 | RaylibJNI.ExportMesh(fileName, Mesh.getCPtr(mesh), mesh); 928 | } 929 | 930 | public static BoundingBox MeshBoundingBox(Mesh mesh) { 931 | return new BoundingBox(RaylibJNI.MeshBoundingBox(Mesh.getCPtr(mesh), mesh), true); 932 | } 933 | 934 | public static void MeshTangents(Mesh mesh) { 935 | RaylibJNI.MeshTangents(Mesh.getCPtr(mesh), mesh); 936 | } 937 | 938 | public static void MeshBinormals(Mesh mesh) { 939 | RaylibJNI.MeshBinormals(Mesh.getCPtr(mesh), mesh); 940 | } 941 | 942 | public static Mesh GenMeshPlane(float width, float length, int resX, int resZ) { 943 | return new Mesh(RaylibJNI.GenMeshPlane(width, length, resX, resZ), true); 944 | } 945 | 946 | public static Mesh GenMeshCube(float width, float height, float length) { 947 | return new Mesh(RaylibJNI.GenMeshCube(width, height, length), true); 948 | } 949 | 950 | public static Mesh GenMeshSphere(float radius, int rings, int slices) { 951 | return new Mesh(RaylibJNI.GenMeshSphere(radius, rings, slices), true); 952 | } 953 | 954 | public static Mesh GenMeshHemiSphere(float radius, int rings, int slices) { 955 | return new Mesh(RaylibJNI.GenMeshHemiSphere(radius, rings, slices), true); 956 | } 957 | 958 | public static Mesh GenMeshCylinder(float radius, float height, int slices) { 959 | return new Mesh(RaylibJNI.GenMeshCylinder(radius, height, slices), true); 960 | } 961 | 962 | public static Mesh GenMeshTorus(float radius, float size, int radSeg, int sides) { 963 | return new Mesh(RaylibJNI.GenMeshTorus(radius, size, radSeg, sides), true); 964 | } 965 | 966 | public static Mesh GenMeshKnot(float radius, float size, int radSeg, int sides) { 967 | return new Mesh(RaylibJNI.GenMeshKnot(radius, size, radSeg, sides), true); 968 | } 969 | 970 | public static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) { 971 | return new Mesh(RaylibJNI.GenMeshHeightmap(Image.getCPtr(heightmap), heightmap, Vector3.getCPtr(size), size), true); 972 | } 973 | 974 | public static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) { 975 | return new Mesh(RaylibJNI.GenMeshCubicmap(Image.getCPtr(cubicmap), cubicmap, Vector3.getCPtr(cubeSize), cubeSize), true); 976 | } 977 | 978 | public static Material LoadMaterial(String fileName) { 979 | return new Material(RaylibJNI.LoadMaterial(fileName), true); 980 | } 981 | 982 | public static Material LoadMaterialDefault() { 983 | return new Material(RaylibJNI.LoadMaterialDefault(), true); 984 | } 985 | 986 | public static void UnloadMaterial(Material material) { 987 | RaylibJNI.UnloadMaterial(Material.getCPtr(material), material); 988 | } 989 | 990 | public static void DrawModel(Model model, Vector3 position, float scale, Color tint) { 991 | RaylibJNI.DrawModel(Model.getCPtr(model), model, Vector3.getCPtr(position), position, scale, Color.getCPtr(tint), tint); 992 | } 993 | 994 | public static void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { 995 | RaylibJNI.DrawModelEx(Model.getCPtr(model), model, Vector3.getCPtr(position), position, Vector3.getCPtr(rotationAxis), rotationAxis, rotationAngle, Vector3.getCPtr(scale), scale, Color.getCPtr(tint), tint); 996 | } 997 | 998 | public static void DrawModelWires(Model model, Vector3 position, float scale, Color tint) { 999 | RaylibJNI.DrawModelWires(Model.getCPtr(model), model, Vector3.getCPtr(position), position, scale, Color.getCPtr(tint), tint); 1000 | } 1001 | 1002 | public static void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { 1003 | RaylibJNI.DrawModelWiresEx(Model.getCPtr(model), model, Vector3.getCPtr(position), position, Vector3.getCPtr(rotationAxis), rotationAxis, rotationAngle, Vector3.getCPtr(scale), scale, Color.getCPtr(tint), tint); 1004 | } 1005 | 1006 | public static void DrawBoundingBox(BoundingBox box, Color color) { 1007 | RaylibJNI.DrawBoundingBox(BoundingBox.getCPtr(box), box, Color.getCPtr(color), color); 1008 | } 1009 | 1010 | public static void DrawBillboard(Camera3D camera, Texture2D texture, Vector3 center, float size, Color tint) { 1011 | RaylibJNI.DrawBillboard(Camera3D.getCPtr(camera), camera, Texture2D.getCPtr(texture), texture, Vector3.getCPtr(center), center, size, Color.getCPtr(tint), tint); 1012 | } 1013 | 1014 | public static void DrawBillboardRec(Camera3D camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint) { 1015 | RaylibJNI.DrawBillboardRec(Camera3D.getCPtr(camera), camera, Texture2D.getCPtr(texture), texture, Rectangle.getCPtr(sourceRec), sourceRec, Vector3.getCPtr(center), center, size, Color.getCPtr(tint), tint); 1016 | } 1017 | 1018 | public static boolean CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB) { 1019 | return RaylibJNI.CheckCollisionSpheres(Vector3.getCPtr(centerA), centerA, radiusA, Vector3.getCPtr(centerB), centerB, radiusB); 1020 | } 1021 | 1022 | public static boolean CheckCollisionBoxes(BoundingBox box1, BoundingBox box2) { 1023 | return RaylibJNI.CheckCollisionBoxes(BoundingBox.getCPtr(box1), box1, BoundingBox.getCPtr(box2), box2); 1024 | } 1025 | 1026 | public static boolean CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere) { 1027 | return RaylibJNI.CheckCollisionBoxSphere(BoundingBox.getCPtr(box), box, Vector3.getCPtr(centerSphere), centerSphere, radiusSphere); 1028 | } 1029 | 1030 | public static boolean CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius) { 1031 | return RaylibJNI.CheckCollisionRaySphere(Ray.getCPtr(ray), ray, Vector3.getCPtr(spherePosition), spherePosition, sphereRadius); 1032 | } 1033 | 1034 | public static boolean CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 collisionPoint) { 1035 | return RaylibJNI.CheckCollisionRaySphereEx(Ray.getCPtr(ray), ray, Vector3.getCPtr(spherePosition), spherePosition, sphereRadius, Vector3.getCPtr(collisionPoint), collisionPoint); 1036 | } 1037 | 1038 | public static boolean CheckCollisionRayBox(Ray ray, BoundingBox box) { 1039 | return RaylibJNI.CheckCollisionRayBox(Ray.getCPtr(ray), ray, BoundingBox.getCPtr(box), box); 1040 | } 1041 | 1042 | public static RayHitInfo GetCollisionRayModel(Ray ray, Model model) { 1043 | return new RayHitInfo(RaylibJNI.GetCollisionRayModel(Ray.getCPtr(ray), ray, Model.getCPtr(model), model), true); 1044 | } 1045 | 1046 | public static RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) { 1047 | return new RayHitInfo(RaylibJNI.GetCollisionRayTriangle(Ray.getCPtr(ray), ray, Vector3.getCPtr(p1), p1, Vector3.getCPtr(p2), p2, Vector3.getCPtr(p3), p3), true); 1048 | } 1049 | 1050 | public static RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight) { 1051 | return new RayHitInfo(RaylibJNI.GetCollisionRayGround(Ray.getCPtr(ray), ray, groundHeight), true); 1052 | } 1053 | 1054 | public static String LoadText(String fileName) { 1055 | return RaylibJNI.LoadText(fileName); 1056 | } 1057 | 1058 | public static Shader LoadShader(String vsFileName, String fsFileName) { 1059 | return new Shader(RaylibJNI.LoadShader(vsFileName, fsFileName), true); 1060 | } 1061 | 1062 | public static Shader LoadShaderCode(String vsCode, String fsCode) { 1063 | return new Shader(RaylibJNI.LoadShaderCode(vsCode, fsCode), true); 1064 | } 1065 | 1066 | public static void UnloadShader(Shader shader) { 1067 | RaylibJNI.UnloadShader(Shader.getCPtr(shader), shader); 1068 | } 1069 | 1070 | public static Shader GetShaderDefault() { 1071 | return new Shader(RaylibJNI.GetShaderDefault(), true); 1072 | } 1073 | 1074 | public static Texture2D GetTextureDefault() { 1075 | return new Texture2D(RaylibJNI.GetTextureDefault(), true); 1076 | } 1077 | 1078 | public static int GetShaderLocation(Shader shader, String uniformName) { 1079 | return RaylibJNI.GetShaderLocation(Shader.getCPtr(shader), shader, uniformName); 1080 | } 1081 | 1082 | public static void SetShaderValue(Shader shader, int uniformLoc, SWIGTYPE_p_float value, int size) { 1083 | RaylibJNI.SetShaderValue(Shader.getCPtr(shader), shader, uniformLoc, SWIGTYPE_p_float.getCPtr(value), size); 1084 | } 1085 | 1086 | public static void SetShaderValuei(Shader shader, int uniformLoc, SWIGTYPE_p_int value, int size) { 1087 | RaylibJNI.SetShaderValuei(Shader.getCPtr(shader), shader, uniformLoc, SWIGTYPE_p_int.getCPtr(value), size); 1088 | } 1089 | 1090 | public static void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) { 1091 | RaylibJNI.SetShaderValueMatrix(Shader.getCPtr(shader), shader, uniformLoc, Matrix.getCPtr(mat), mat); 1092 | } 1093 | 1094 | public static void SetMatrixProjection(Matrix proj) { 1095 | RaylibJNI.SetMatrixProjection(Matrix.getCPtr(proj), proj); 1096 | } 1097 | 1098 | public static void SetMatrixModelview(Matrix view) { 1099 | RaylibJNI.SetMatrixModelview(Matrix.getCPtr(view), view); 1100 | } 1101 | 1102 | public static Matrix GetMatrixModelview() { 1103 | return new Matrix(RaylibJNI.GetMatrixModelview(), true); 1104 | } 1105 | 1106 | public static Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size) { 1107 | return new Texture2D(RaylibJNI.GenTextureCubemap(Shader.getCPtr(shader), shader, Texture2D.getCPtr(skyHDR), skyHDR, size), true); 1108 | } 1109 | 1110 | public static Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size) { 1111 | return new Texture2D(RaylibJNI.GenTextureIrradiance(Shader.getCPtr(shader), shader, Texture2D.getCPtr(cubemap), cubemap, size), true); 1112 | } 1113 | 1114 | public static Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size) { 1115 | return new Texture2D(RaylibJNI.GenTexturePrefilter(Shader.getCPtr(shader), shader, Texture2D.getCPtr(cubemap), cubemap, size), true); 1116 | } 1117 | 1118 | public static Texture2D GenTextureBRDF(Shader shader, Texture2D cubemap, int size) { 1119 | return new Texture2D(RaylibJNI.GenTextureBRDF(Shader.getCPtr(shader), shader, Texture2D.getCPtr(cubemap), cubemap, size), true); 1120 | } 1121 | 1122 | public static void BeginShaderMode(Shader shader) { 1123 | RaylibJNI.BeginShaderMode(Shader.getCPtr(shader), shader); 1124 | } 1125 | 1126 | public static void EndShaderMode() { 1127 | RaylibJNI.EndShaderMode(); 1128 | } 1129 | 1130 | public static void BeginBlendMode(int mode) { 1131 | RaylibJNI.BeginBlendMode(mode); 1132 | } 1133 | 1134 | public static void EndBlendMode() { 1135 | RaylibJNI.EndBlendMode(); 1136 | } 1137 | 1138 | public static VrDeviceInfo GetVrDeviceInfo(int vrDeviceType) { 1139 | return new VrDeviceInfo(RaylibJNI.GetVrDeviceInfo(vrDeviceType), true); 1140 | } 1141 | 1142 | public static void InitVrSimulator(VrDeviceInfo info) { 1143 | RaylibJNI.InitVrSimulator(VrDeviceInfo.getCPtr(info), info); 1144 | } 1145 | 1146 | public static void CloseVrSimulator() { 1147 | RaylibJNI.CloseVrSimulator(); 1148 | } 1149 | 1150 | public static boolean IsVrSimulatorReady() { 1151 | return RaylibJNI.IsVrSimulatorReady(); 1152 | } 1153 | 1154 | public static void SetVrDistortionShader(Shader shader) { 1155 | RaylibJNI.SetVrDistortionShader(Shader.getCPtr(shader), shader); 1156 | } 1157 | 1158 | public static void UpdateVrTracking(Camera3D camera) { 1159 | RaylibJNI.UpdateVrTracking(Camera3D.getCPtr(camera), camera); 1160 | } 1161 | 1162 | public static void ToggleVrMode() { 1163 | RaylibJNI.ToggleVrMode(); 1164 | } 1165 | 1166 | public static void BeginVrDrawing() { 1167 | RaylibJNI.BeginVrDrawing(); 1168 | } 1169 | 1170 | public static void EndVrDrawing() { 1171 | RaylibJNI.EndVrDrawing(); 1172 | } 1173 | 1174 | public static void InitAudioDevice() { 1175 | RaylibJNI.InitAudioDevice(); 1176 | } 1177 | 1178 | public static void CloseAudioDevice() { 1179 | RaylibJNI.CloseAudioDevice(); 1180 | } 1181 | 1182 | public static boolean IsAudioDeviceReady() { 1183 | return RaylibJNI.IsAudioDeviceReady(); 1184 | } 1185 | 1186 | public static void SetMasterVolume(float volume) { 1187 | RaylibJNI.SetMasterVolume(volume); 1188 | } 1189 | 1190 | public static Wave LoadWave(String fileName) { 1191 | return new Wave(RaylibJNI.LoadWave(fileName), true); 1192 | } 1193 | 1194 | public static Wave LoadWaveEx(SWIGTYPE_p_void data, int sampleCount, int sampleRate, int sampleSize, int channels) { 1195 | return new Wave(RaylibJNI.LoadWaveEx(SWIGTYPE_p_void.getCPtr(data), sampleCount, sampleRate, sampleSize, channels), true); 1196 | } 1197 | 1198 | public static Sound LoadSound(String fileName) { 1199 | return new Sound(RaylibJNI.LoadSound(fileName), true); 1200 | } 1201 | 1202 | public static Sound LoadSoundFromWave(Wave wave) { 1203 | return new Sound(RaylibJNI.LoadSoundFromWave(Wave.getCPtr(wave), wave), true); 1204 | } 1205 | 1206 | public static void UpdateSound(Sound sound, SWIGTYPE_p_void data, int samplesCount) { 1207 | RaylibJNI.UpdateSound(Sound.getCPtr(sound), sound, SWIGTYPE_p_void.getCPtr(data), samplesCount); 1208 | } 1209 | 1210 | public static void UnloadWave(Wave wave) { 1211 | RaylibJNI.UnloadWave(Wave.getCPtr(wave), wave); 1212 | } 1213 | 1214 | public static void UnloadSound(Sound sound) { 1215 | RaylibJNI.UnloadSound(Sound.getCPtr(sound), sound); 1216 | } 1217 | 1218 | public static void PlaySound(Sound sound) { 1219 | RaylibJNI.PlaySound(Sound.getCPtr(sound), sound); 1220 | } 1221 | 1222 | public static void PauseSound(Sound sound) { 1223 | RaylibJNI.PauseSound(Sound.getCPtr(sound), sound); 1224 | } 1225 | 1226 | public static void ResumeSound(Sound sound) { 1227 | RaylibJNI.ResumeSound(Sound.getCPtr(sound), sound); 1228 | } 1229 | 1230 | public static void StopSound(Sound sound) { 1231 | RaylibJNI.StopSound(Sound.getCPtr(sound), sound); 1232 | } 1233 | 1234 | public static boolean IsSoundPlaying(Sound sound) { 1235 | return RaylibJNI.IsSoundPlaying(Sound.getCPtr(sound), sound); 1236 | } 1237 | 1238 | public static void SetSoundVolume(Sound sound, float volume) { 1239 | RaylibJNI.SetSoundVolume(Sound.getCPtr(sound), sound, volume); 1240 | } 1241 | 1242 | public static void SetSoundPitch(Sound sound, float pitch) { 1243 | RaylibJNI.SetSoundPitch(Sound.getCPtr(sound), sound, pitch); 1244 | } 1245 | 1246 | public static void WaveFormat(Wave wave, int sampleRate, int sampleSize, int channels) { 1247 | RaylibJNI.WaveFormat(Wave.getCPtr(wave), wave, sampleRate, sampleSize, channels); 1248 | } 1249 | 1250 | public static Wave WaveCopy(Wave wave) { 1251 | return new Wave(RaylibJNI.WaveCopy(Wave.getCPtr(wave), wave), true); 1252 | } 1253 | 1254 | public static void WaveCrop(Wave wave, int initSample, int finalSample) { 1255 | RaylibJNI.WaveCrop(Wave.getCPtr(wave), wave, initSample, finalSample); 1256 | } 1257 | 1258 | public static SWIGTYPE_p_float GetWaveData(Wave wave) { 1259 | long cPtr = RaylibJNI.GetWaveData(Wave.getCPtr(wave), wave); 1260 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 1261 | } 1262 | 1263 | public static SWIGTYPE_p_MusicData LoadMusicStream(String fileName) { 1264 | long cPtr = RaylibJNI.LoadMusicStream(fileName); 1265 | return (cPtr == 0) ? null : new SWIGTYPE_p_MusicData(cPtr, false); 1266 | } 1267 | 1268 | public static void UnloadMusicStream(SWIGTYPE_p_MusicData music) { 1269 | RaylibJNI.UnloadMusicStream(SWIGTYPE_p_MusicData.getCPtr(music)); 1270 | } 1271 | 1272 | public static void PlayMusicStream(SWIGTYPE_p_MusicData music) { 1273 | RaylibJNI.PlayMusicStream(SWIGTYPE_p_MusicData.getCPtr(music)); 1274 | } 1275 | 1276 | public static void UpdateMusicStream(SWIGTYPE_p_MusicData music) { 1277 | RaylibJNI.UpdateMusicStream(SWIGTYPE_p_MusicData.getCPtr(music)); 1278 | } 1279 | 1280 | public static void StopMusicStream(SWIGTYPE_p_MusicData music) { 1281 | RaylibJNI.StopMusicStream(SWIGTYPE_p_MusicData.getCPtr(music)); 1282 | } 1283 | 1284 | public static void PauseMusicStream(SWIGTYPE_p_MusicData music) { 1285 | RaylibJNI.PauseMusicStream(SWIGTYPE_p_MusicData.getCPtr(music)); 1286 | } 1287 | 1288 | public static void ResumeMusicStream(SWIGTYPE_p_MusicData music) { 1289 | RaylibJNI.ResumeMusicStream(SWIGTYPE_p_MusicData.getCPtr(music)); 1290 | } 1291 | 1292 | public static boolean IsMusicPlaying(SWIGTYPE_p_MusicData music) { 1293 | return RaylibJNI.IsMusicPlaying(SWIGTYPE_p_MusicData.getCPtr(music)); 1294 | } 1295 | 1296 | public static void SetMusicVolume(SWIGTYPE_p_MusicData music, float volume) { 1297 | RaylibJNI.SetMusicVolume(SWIGTYPE_p_MusicData.getCPtr(music), volume); 1298 | } 1299 | 1300 | public static void SetMusicPitch(SWIGTYPE_p_MusicData music, float pitch) { 1301 | RaylibJNI.SetMusicPitch(SWIGTYPE_p_MusicData.getCPtr(music), pitch); 1302 | } 1303 | 1304 | public static void SetMusicLoopCount(SWIGTYPE_p_MusicData music, int count) { 1305 | RaylibJNI.SetMusicLoopCount(SWIGTYPE_p_MusicData.getCPtr(music), count); 1306 | } 1307 | 1308 | public static float GetMusicTimeLength(SWIGTYPE_p_MusicData music) { 1309 | return RaylibJNI.GetMusicTimeLength(SWIGTYPE_p_MusicData.getCPtr(music)); 1310 | } 1311 | 1312 | public static float GetMusicTimePlayed(SWIGTYPE_p_MusicData music) { 1313 | return RaylibJNI.GetMusicTimePlayed(SWIGTYPE_p_MusicData.getCPtr(music)); 1314 | } 1315 | 1316 | public static AudioStream InitAudioStream(long sampleRate, long sampleSize, long channels) { 1317 | return new AudioStream(RaylibJNI.InitAudioStream(sampleRate, sampleSize, channels), true); 1318 | } 1319 | 1320 | public static void UpdateAudioStream(AudioStream stream, SWIGTYPE_p_void data, int samplesCount) { 1321 | RaylibJNI.UpdateAudioStream(AudioStream.getCPtr(stream), stream, SWIGTYPE_p_void.getCPtr(data), samplesCount); 1322 | } 1323 | 1324 | public static void CloseAudioStream(AudioStream stream) { 1325 | RaylibJNI.CloseAudioStream(AudioStream.getCPtr(stream), stream); 1326 | } 1327 | 1328 | public static boolean IsAudioBufferProcessed(AudioStream stream) { 1329 | return RaylibJNI.IsAudioBufferProcessed(AudioStream.getCPtr(stream), stream); 1330 | } 1331 | 1332 | public static void PlayAudioStream(AudioStream stream) { 1333 | RaylibJNI.PlayAudioStream(AudioStream.getCPtr(stream), stream); 1334 | } 1335 | 1336 | public static void PauseAudioStream(AudioStream stream) { 1337 | RaylibJNI.PauseAudioStream(AudioStream.getCPtr(stream), stream); 1338 | } 1339 | 1340 | public static void ResumeAudioStream(AudioStream stream) { 1341 | RaylibJNI.ResumeAudioStream(AudioStream.getCPtr(stream), stream); 1342 | } 1343 | 1344 | public static boolean IsAudioStreamPlaying(AudioStream stream) { 1345 | return RaylibJNI.IsAudioStreamPlaying(AudioStream.getCPtr(stream), stream); 1346 | } 1347 | 1348 | public static void StopAudioStream(AudioStream stream) { 1349 | RaylibJNI.StopAudioStream(AudioStream.getCPtr(stream), stream); 1350 | } 1351 | 1352 | public static void SetAudioStreamVolume(AudioStream stream, float volume) { 1353 | RaylibJNI.SetAudioStreamVolume(AudioStream.getCPtr(stream), stream, volume); 1354 | } 1355 | 1356 | public static void SetAudioStreamPitch(AudioStream stream, float pitch) { 1357 | RaylibJNI.SetAudioStreamPitch(AudioStream.getCPtr(stream), stream, pitch); 1358 | } 1359 | 1360 | } 1361 | -------------------------------------------------------------------------------- /src/main/java/raylib/RaylibConstants.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public interface RaylibConstants { 12 | public final static int NATIVE_INT_SIZE = 4; 13 | public final static int NATIVE_FLOAT_SIZE = 4; 14 | public final static double PI = RaylibJNI.PI_get(); 15 | public final static double DEG2RAD = RaylibJNI.DEG2RAD_get(); 16 | public final static double RAD2DEG = RaylibJNI.RAD2DEG_get(); 17 | public final static int FLAG_SHOW_LOGO = RaylibJNI.FLAG_SHOW_LOGO_get(); 18 | public final static int FLAG_FULLSCREEN_MODE = RaylibJNI.FLAG_FULLSCREEN_MODE_get(); 19 | public final static int FLAG_WINDOW_RESIZABLE = RaylibJNI.FLAG_WINDOW_RESIZABLE_get(); 20 | public final static int FLAG_WINDOW_UNDECORATED = RaylibJNI.FLAG_WINDOW_UNDECORATED_get(); 21 | public final static int FLAG_WINDOW_TRANSPARENT = RaylibJNI.FLAG_WINDOW_TRANSPARENT_get(); 22 | public final static int FLAG_MSAA_4X_HINT = RaylibJNI.FLAG_MSAA_4X_HINT_get(); 23 | public final static int FLAG_VSYNC_HINT = RaylibJNI.FLAG_VSYNC_HINT_get(); 24 | public final static int KEY_SPACE = RaylibJNI.KEY_SPACE_get(); 25 | public final static int KEY_ESCAPE = RaylibJNI.KEY_ESCAPE_get(); 26 | public final static int KEY_ENTER = RaylibJNI.KEY_ENTER_get(); 27 | public final static int KEY_TAB = RaylibJNI.KEY_TAB_get(); 28 | public final static int KEY_BACKSPACE = RaylibJNI.KEY_BACKSPACE_get(); 29 | public final static int KEY_INSERT = RaylibJNI.KEY_INSERT_get(); 30 | public final static int KEY_DELETE = RaylibJNI.KEY_DELETE_get(); 31 | public final static int KEY_RIGHT = RaylibJNI.KEY_RIGHT_get(); 32 | public final static int KEY_LEFT = RaylibJNI.KEY_LEFT_get(); 33 | public final static int KEY_DOWN = RaylibJNI.KEY_DOWN_get(); 34 | public final static int KEY_UP = RaylibJNI.KEY_UP_get(); 35 | public final static int KEY_PAGE_UP = RaylibJNI.KEY_PAGE_UP_get(); 36 | public final static int KEY_PAGE_DOWN = RaylibJNI.KEY_PAGE_DOWN_get(); 37 | public final static int KEY_HOME = RaylibJNI.KEY_HOME_get(); 38 | public final static int KEY_END = RaylibJNI.KEY_END_get(); 39 | public final static int KEY_CAPS_LOCK = RaylibJNI.KEY_CAPS_LOCK_get(); 40 | public final static int KEY_SCROLL_LOCK = RaylibJNI.KEY_SCROLL_LOCK_get(); 41 | public final static int KEY_NUM_LOCK = RaylibJNI.KEY_NUM_LOCK_get(); 42 | public final static int KEY_PRINT_SCREEN = RaylibJNI.KEY_PRINT_SCREEN_get(); 43 | public final static int KEY_PAUSE = RaylibJNI.KEY_PAUSE_get(); 44 | public final static int KEY_F1 = RaylibJNI.KEY_F1_get(); 45 | public final static int KEY_F2 = RaylibJNI.KEY_F2_get(); 46 | public final static int KEY_F3 = RaylibJNI.KEY_F3_get(); 47 | public final static int KEY_F4 = RaylibJNI.KEY_F4_get(); 48 | public final static int KEY_F5 = RaylibJNI.KEY_F5_get(); 49 | public final static int KEY_F6 = RaylibJNI.KEY_F6_get(); 50 | public final static int KEY_F7 = RaylibJNI.KEY_F7_get(); 51 | public final static int KEY_F8 = RaylibJNI.KEY_F8_get(); 52 | public final static int KEY_F9 = RaylibJNI.KEY_F9_get(); 53 | public final static int KEY_F10 = RaylibJNI.KEY_F10_get(); 54 | public final static int KEY_F11 = RaylibJNI.KEY_F11_get(); 55 | public final static int KEY_F12 = RaylibJNI.KEY_F12_get(); 56 | public final static int KEY_LEFT_SHIFT = RaylibJNI.KEY_LEFT_SHIFT_get(); 57 | public final static int KEY_LEFT_CONTROL = RaylibJNI.KEY_LEFT_CONTROL_get(); 58 | public final static int KEY_LEFT_ALT = RaylibJNI.KEY_LEFT_ALT_get(); 59 | public final static int KEY_RIGHT_SHIFT = RaylibJNI.KEY_RIGHT_SHIFT_get(); 60 | public final static int KEY_RIGHT_CONTROL = RaylibJNI.KEY_RIGHT_CONTROL_get(); 61 | public final static int KEY_RIGHT_ALT = RaylibJNI.KEY_RIGHT_ALT_get(); 62 | public final static int KEY_GRAVE = RaylibJNI.KEY_GRAVE_get(); 63 | public final static int KEY_SLASH = RaylibJNI.KEY_SLASH_get(); 64 | public final static int KEY_BACKSLASH = RaylibJNI.KEY_BACKSLASH_get(); 65 | public final static int KEY_ZERO = RaylibJNI.KEY_ZERO_get(); 66 | public final static int KEY_ONE = RaylibJNI.KEY_ONE_get(); 67 | public final static int KEY_TWO = RaylibJNI.KEY_TWO_get(); 68 | public final static int KEY_THREE = RaylibJNI.KEY_THREE_get(); 69 | public final static int KEY_FOUR = RaylibJNI.KEY_FOUR_get(); 70 | public final static int KEY_FIVE = RaylibJNI.KEY_FIVE_get(); 71 | public final static int KEY_SIX = RaylibJNI.KEY_SIX_get(); 72 | public final static int KEY_SEVEN = RaylibJNI.KEY_SEVEN_get(); 73 | public final static int KEY_EIGHT = RaylibJNI.KEY_EIGHT_get(); 74 | public final static int KEY_NINE = RaylibJNI.KEY_NINE_get(); 75 | public final static int KEY_A = RaylibJNI.KEY_A_get(); 76 | public final static int KEY_B = RaylibJNI.KEY_B_get(); 77 | public final static int KEY_C = RaylibJNI.KEY_C_get(); 78 | public final static int KEY_D = RaylibJNI.KEY_D_get(); 79 | public final static int KEY_E = RaylibJNI.KEY_E_get(); 80 | public final static int KEY_F = RaylibJNI.KEY_F_get(); 81 | public final static int KEY_G = RaylibJNI.KEY_G_get(); 82 | public final static int KEY_H = RaylibJNI.KEY_H_get(); 83 | public final static int KEY_I = RaylibJNI.KEY_I_get(); 84 | public final static int KEY_J = RaylibJNI.KEY_J_get(); 85 | public final static int KEY_K = RaylibJNI.KEY_K_get(); 86 | public final static int KEY_L = RaylibJNI.KEY_L_get(); 87 | public final static int KEY_M = RaylibJNI.KEY_M_get(); 88 | public final static int KEY_N = RaylibJNI.KEY_N_get(); 89 | public final static int KEY_O = RaylibJNI.KEY_O_get(); 90 | public final static int KEY_P = RaylibJNI.KEY_P_get(); 91 | public final static int KEY_Q = RaylibJNI.KEY_Q_get(); 92 | public final static int KEY_R = RaylibJNI.KEY_R_get(); 93 | public final static int KEY_S = RaylibJNI.KEY_S_get(); 94 | public final static int KEY_T = RaylibJNI.KEY_T_get(); 95 | public final static int KEY_U = RaylibJNI.KEY_U_get(); 96 | public final static int KEY_V = RaylibJNI.KEY_V_get(); 97 | public final static int KEY_W = RaylibJNI.KEY_W_get(); 98 | public final static int KEY_X = RaylibJNI.KEY_X_get(); 99 | public final static int KEY_Y = RaylibJNI.KEY_Y_get(); 100 | public final static int KEY_Z = RaylibJNI.KEY_Z_get(); 101 | public final static int KEY_BACK = RaylibJNI.KEY_BACK_get(); 102 | public final static int KEY_MENU = RaylibJNI.KEY_MENU_get(); 103 | public final static int KEY_VOLUME_UP = RaylibJNI.KEY_VOLUME_UP_get(); 104 | public final static int KEY_VOLUME_DOWN = RaylibJNI.KEY_VOLUME_DOWN_get(); 105 | public final static int MOUSE_LEFT_BUTTON = RaylibJNI.MOUSE_LEFT_BUTTON_get(); 106 | public final static int MOUSE_RIGHT_BUTTON = RaylibJNI.MOUSE_RIGHT_BUTTON_get(); 107 | public final static int MOUSE_MIDDLE_BUTTON = RaylibJNI.MOUSE_MIDDLE_BUTTON_get(); 108 | public final static int MAX_TOUCH_POINTS = RaylibJNI.MAX_TOUCH_POINTS_get(); 109 | public final static int GAMEPAD_PLAYER1 = RaylibJNI.GAMEPAD_PLAYER1_get(); 110 | public final static int GAMEPAD_PLAYER2 = RaylibJNI.GAMEPAD_PLAYER2_get(); 111 | public final static int GAMEPAD_PLAYER3 = RaylibJNI.GAMEPAD_PLAYER3_get(); 112 | public final static int GAMEPAD_PLAYER4 = RaylibJNI.GAMEPAD_PLAYER4_get(); 113 | public final static int GAMEPAD_PS3_BUTTON_TRIANGLE = RaylibJNI.GAMEPAD_PS3_BUTTON_TRIANGLE_get(); 114 | public final static int GAMEPAD_PS3_BUTTON_CIRCLE = RaylibJNI.GAMEPAD_PS3_BUTTON_CIRCLE_get(); 115 | public final static int GAMEPAD_PS3_BUTTON_CROSS = RaylibJNI.GAMEPAD_PS3_BUTTON_CROSS_get(); 116 | public final static int GAMEPAD_PS3_BUTTON_SQUARE = RaylibJNI.GAMEPAD_PS3_BUTTON_SQUARE_get(); 117 | public final static int GAMEPAD_PS3_BUTTON_L1 = RaylibJNI.GAMEPAD_PS3_BUTTON_L1_get(); 118 | public final static int GAMEPAD_PS3_BUTTON_R1 = RaylibJNI.GAMEPAD_PS3_BUTTON_R1_get(); 119 | public final static int GAMEPAD_PS3_BUTTON_L2 = RaylibJNI.GAMEPAD_PS3_BUTTON_L2_get(); 120 | public final static int GAMEPAD_PS3_BUTTON_R2 = RaylibJNI.GAMEPAD_PS3_BUTTON_R2_get(); 121 | public final static int GAMEPAD_PS3_BUTTON_START = RaylibJNI.GAMEPAD_PS3_BUTTON_START_get(); 122 | public final static int GAMEPAD_PS3_BUTTON_SELECT = RaylibJNI.GAMEPAD_PS3_BUTTON_SELECT_get(); 123 | public final static int GAMEPAD_PS3_BUTTON_UP = RaylibJNI.GAMEPAD_PS3_BUTTON_UP_get(); 124 | public final static int GAMEPAD_PS3_BUTTON_RIGHT = RaylibJNI.GAMEPAD_PS3_BUTTON_RIGHT_get(); 125 | public final static int GAMEPAD_PS3_BUTTON_DOWN = RaylibJNI.GAMEPAD_PS3_BUTTON_DOWN_get(); 126 | public final static int GAMEPAD_PS3_BUTTON_LEFT = RaylibJNI.GAMEPAD_PS3_BUTTON_LEFT_get(); 127 | public final static int GAMEPAD_PS3_BUTTON_PS = RaylibJNI.GAMEPAD_PS3_BUTTON_PS_get(); 128 | public final static int GAMEPAD_PS3_AXIS_LEFT_X = RaylibJNI.GAMEPAD_PS3_AXIS_LEFT_X_get(); 129 | public final static int GAMEPAD_PS3_AXIS_LEFT_Y = RaylibJNI.GAMEPAD_PS3_AXIS_LEFT_Y_get(); 130 | public final static int GAMEPAD_PS3_AXIS_RIGHT_X = RaylibJNI.GAMEPAD_PS3_AXIS_RIGHT_X_get(); 131 | public final static int GAMEPAD_PS3_AXIS_RIGHT_Y = RaylibJNI.GAMEPAD_PS3_AXIS_RIGHT_Y_get(); 132 | public final static int GAMEPAD_PS3_AXIS_L2 = RaylibJNI.GAMEPAD_PS3_AXIS_L2_get(); 133 | public final static int GAMEPAD_PS3_AXIS_R2 = RaylibJNI.GAMEPAD_PS3_AXIS_R2_get(); 134 | public final static int GAMEPAD_XBOX_BUTTON_A = RaylibJNI.GAMEPAD_XBOX_BUTTON_A_get(); 135 | public final static int GAMEPAD_XBOX_BUTTON_B = RaylibJNI.GAMEPAD_XBOX_BUTTON_B_get(); 136 | public final static int GAMEPAD_XBOX_BUTTON_X = RaylibJNI.GAMEPAD_XBOX_BUTTON_X_get(); 137 | public final static int GAMEPAD_XBOX_BUTTON_Y = RaylibJNI.GAMEPAD_XBOX_BUTTON_Y_get(); 138 | public final static int GAMEPAD_XBOX_BUTTON_LB = RaylibJNI.GAMEPAD_XBOX_BUTTON_LB_get(); 139 | public final static int GAMEPAD_XBOX_BUTTON_RB = RaylibJNI.GAMEPAD_XBOX_BUTTON_RB_get(); 140 | public final static int GAMEPAD_XBOX_BUTTON_SELECT = RaylibJNI.GAMEPAD_XBOX_BUTTON_SELECT_get(); 141 | public final static int GAMEPAD_XBOX_BUTTON_START = RaylibJNI.GAMEPAD_XBOX_BUTTON_START_get(); 142 | public final static int GAMEPAD_XBOX_BUTTON_UP = RaylibJNI.GAMEPAD_XBOX_BUTTON_UP_get(); 143 | public final static int GAMEPAD_XBOX_BUTTON_RIGHT = RaylibJNI.GAMEPAD_XBOX_BUTTON_RIGHT_get(); 144 | public final static int GAMEPAD_XBOX_BUTTON_DOWN = RaylibJNI.GAMEPAD_XBOX_BUTTON_DOWN_get(); 145 | public final static int GAMEPAD_XBOX_BUTTON_LEFT = RaylibJNI.GAMEPAD_XBOX_BUTTON_LEFT_get(); 146 | public final static int GAMEPAD_XBOX_BUTTON_HOME = RaylibJNI.GAMEPAD_XBOX_BUTTON_HOME_get(); 147 | public final static int GAMEPAD_ANDROID_DPAD_UP = RaylibJNI.GAMEPAD_ANDROID_DPAD_UP_get(); 148 | public final static int GAMEPAD_ANDROID_DPAD_DOWN = RaylibJNI.GAMEPAD_ANDROID_DPAD_DOWN_get(); 149 | public final static int GAMEPAD_ANDROID_DPAD_LEFT = RaylibJNI.GAMEPAD_ANDROID_DPAD_LEFT_get(); 150 | public final static int GAMEPAD_ANDROID_DPAD_RIGHT = RaylibJNI.GAMEPAD_ANDROID_DPAD_RIGHT_get(); 151 | public final static int GAMEPAD_ANDROID_DPAD_CENTER = RaylibJNI.GAMEPAD_ANDROID_DPAD_CENTER_get(); 152 | public final static int GAMEPAD_ANDROID_BUTTON_A = RaylibJNI.GAMEPAD_ANDROID_BUTTON_A_get(); 153 | public final static int GAMEPAD_ANDROID_BUTTON_B = RaylibJNI.GAMEPAD_ANDROID_BUTTON_B_get(); 154 | public final static int GAMEPAD_ANDROID_BUTTON_C = RaylibJNI.GAMEPAD_ANDROID_BUTTON_C_get(); 155 | public final static int GAMEPAD_ANDROID_BUTTON_X = RaylibJNI.GAMEPAD_ANDROID_BUTTON_X_get(); 156 | public final static int GAMEPAD_ANDROID_BUTTON_Y = RaylibJNI.GAMEPAD_ANDROID_BUTTON_Y_get(); 157 | public final static int GAMEPAD_ANDROID_BUTTON_Z = RaylibJNI.GAMEPAD_ANDROID_BUTTON_Z_get(); 158 | public final static int GAMEPAD_ANDROID_BUTTON_L1 = RaylibJNI.GAMEPAD_ANDROID_BUTTON_L1_get(); 159 | public final static int GAMEPAD_ANDROID_BUTTON_R1 = RaylibJNI.GAMEPAD_ANDROID_BUTTON_R1_get(); 160 | public final static int GAMEPAD_ANDROID_BUTTON_L2 = RaylibJNI.GAMEPAD_ANDROID_BUTTON_L2_get(); 161 | public final static int GAMEPAD_ANDROID_BUTTON_R2 = RaylibJNI.GAMEPAD_ANDROID_BUTTON_R2_get(); 162 | public final static int GAMEPAD_XBOX_AXIS_LEFT_X = RaylibJNI.GAMEPAD_XBOX_AXIS_LEFT_X_get(); 163 | public final static int GAMEPAD_XBOX_AXIS_LEFT_Y = RaylibJNI.GAMEPAD_XBOX_AXIS_LEFT_Y_get(); 164 | public final static int GAMEPAD_XBOX_AXIS_RIGHT_X = RaylibJNI.GAMEPAD_XBOX_AXIS_RIGHT_X_get(); 165 | public final static int GAMEPAD_XBOX_AXIS_RIGHT_Y = RaylibJNI.GAMEPAD_XBOX_AXIS_RIGHT_Y_get(); 166 | public final static int GAMEPAD_XBOX_AXIS_LT = RaylibJNI.GAMEPAD_XBOX_AXIS_LT_get(); 167 | public final static int GAMEPAD_XBOX_AXIS_RT = RaylibJNI.GAMEPAD_XBOX_AXIS_RT_get(); 168 | public final static int MAX_SHADER_LOCATIONS = RaylibJNI.MAX_SHADER_LOCATIONS_get(); 169 | public final static int MAX_MATERIAL_MAPS = RaylibJNI.MAX_MATERIAL_MAPS_get(); 170 | } 171 | -------------------------------------------------------------------------------- /src/main/java/raylib/Rectangle.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Rectangle { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Rectangle(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Rectangle obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Rectangle(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setX(float value) { 39 | RaylibJNI.Rectangle_x_set(swigCPtr, this, value); 40 | } 41 | 42 | public float getX() { 43 | return RaylibJNI.Rectangle_x_get(swigCPtr, this); 44 | } 45 | 46 | public void setY(float value) { 47 | RaylibJNI.Rectangle_y_set(swigCPtr, this, value); 48 | } 49 | 50 | public float getY() { 51 | return RaylibJNI.Rectangle_y_get(swigCPtr, this); 52 | } 53 | 54 | public void setWidth(float value) { 55 | RaylibJNI.Rectangle_width_set(swigCPtr, this, value); 56 | } 57 | 58 | public float getWidth() { 59 | return RaylibJNI.Rectangle_width_get(swigCPtr, this); 60 | } 61 | 62 | public void setHeight(float value) { 63 | RaylibJNI.Rectangle_height_set(swigCPtr, this, value); 64 | } 65 | 66 | public float getHeight() { 67 | return RaylibJNI.Rectangle_height_get(swigCPtr, this); 68 | } 69 | 70 | public Rectangle() { 71 | this(RaylibJNI.new_Rectangle(), true); 72 | } 73 | 74 | public Rectangle(float x, float y, float width, float height) { 75 | this(); 76 | setX(x); 77 | setY(y); 78 | setWidth(width); 79 | setHeight(height); 80 | } 81 | 82 | public Rectangle(Vector2 min, Vector2 max) { 83 | this(); 84 | setX(min.getX()); 85 | setY(min.getY()); 86 | setWidth(max.getX()-min.getX()); 87 | setHeight(max.getY()-min.getY()); 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/raylib/RenderTexture2D.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class RenderTexture2D { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected RenderTexture2D(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(RenderTexture2D obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_RenderTexture2D(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setId(long value) { 39 | RaylibJNI.RenderTexture2D_id_set(swigCPtr, this, value); 40 | } 41 | 42 | public long getId() { 43 | return RaylibJNI.RenderTexture2D_id_get(swigCPtr, this); 44 | } 45 | 46 | public void setTexture(Texture2D value) { 47 | RaylibJNI.RenderTexture2D_texture_set(swigCPtr, this, Texture2D.getCPtr(value), value); 48 | } 49 | 50 | public Texture2D getTexture() { 51 | long cPtr = RaylibJNI.RenderTexture2D_texture_get(swigCPtr, this); 52 | return (cPtr == 0) ? null : new Texture2D(cPtr, false); 53 | } 54 | 55 | public void setDepth(Texture2D value) { 56 | RaylibJNI.RenderTexture2D_depth_set(swigCPtr, this, Texture2D.getCPtr(value), value); 57 | } 58 | 59 | public Texture2D getDepth() { 60 | long cPtr = RaylibJNI.RenderTexture2D_depth_get(swigCPtr, this); 61 | return (cPtr == 0) ? null : new Texture2D(cPtr, false); 62 | } 63 | 64 | public RenderTexture2D() { 65 | this(RaylibJNI.new_RenderTexture2D(), true); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/raylib/SWIGTYPE_p_MusicData.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class SWIGTYPE_p_MusicData { 12 | private transient long swigCPtr; 13 | 14 | protected SWIGTYPE_p_MusicData(long cPtr, @SuppressWarnings("unused") boolean futureUse) { 15 | swigCPtr = cPtr; 16 | } 17 | 18 | protected SWIGTYPE_p_MusicData() { 19 | swigCPtr = 0; 20 | } 21 | 22 | protected static long getCPtr(SWIGTYPE_p_MusicData obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/raylib/SWIGTYPE_p_float.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class SWIGTYPE_p_float { 12 | private transient long swigCPtr; 13 | 14 | protected SWIGTYPE_p_float(long cPtr, @SuppressWarnings("unused") boolean futureUse) { 15 | swigCPtr = cPtr; 16 | } 17 | 18 | protected SWIGTYPE_p_float() { 19 | swigCPtr = 0; 20 | } 21 | 22 | protected static long getCPtr(SWIGTYPE_p_float obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/raylib/SWIGTYPE_p_int.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class SWIGTYPE_p_int { 12 | private transient long swigCPtr; 13 | 14 | protected SWIGTYPE_p_int(long cPtr, @SuppressWarnings("unused") boolean futureUse) { 15 | swigCPtr = cPtr; 16 | } 17 | 18 | protected SWIGTYPE_p_int() { 19 | swigCPtr = 0; 20 | } 21 | 22 | protected static long getCPtr(SWIGTYPE_p_int obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/raylib/SWIGTYPE_p_p_char.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class SWIGTYPE_p_p_char { 12 | private transient long swigCPtr; 13 | 14 | protected SWIGTYPE_p_p_char(long cPtr, @SuppressWarnings("unused") boolean futureUse) { 15 | swigCPtr = cPtr; 16 | } 17 | 18 | protected SWIGTYPE_p_p_char() { 19 | swigCPtr = 0; 20 | } 21 | 22 | protected static long getCPtr(SWIGTYPE_p_p_char obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/raylib/SWIGTYPE_p_unsigned_char.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class SWIGTYPE_p_unsigned_char { 12 | private transient long swigCPtr; 13 | 14 | protected SWIGTYPE_p_unsigned_char(long cPtr, @SuppressWarnings("unused") boolean futureUse) { 15 | swigCPtr = cPtr; 16 | } 17 | 18 | protected SWIGTYPE_p_unsigned_char() { 19 | swigCPtr = 0; 20 | } 21 | 22 | protected static long getCPtr(SWIGTYPE_p_unsigned_char obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/raylib/SWIGTYPE_p_unsigned_int.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class SWIGTYPE_p_unsigned_int { 12 | private transient long swigCPtr; 13 | 14 | protected SWIGTYPE_p_unsigned_int(long cPtr, @SuppressWarnings("unused") boolean futureUse) { 15 | swigCPtr = cPtr; 16 | } 17 | 18 | protected SWIGTYPE_p_unsigned_int() { 19 | swigCPtr = 0; 20 | } 21 | 22 | protected static long getCPtr(SWIGTYPE_p_unsigned_int obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/raylib/SWIGTYPE_p_unsigned_short.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class SWIGTYPE_p_unsigned_short { 12 | private transient long swigCPtr; 13 | 14 | protected SWIGTYPE_p_unsigned_short(long cPtr, @SuppressWarnings("unused") boolean futureUse) { 15 | swigCPtr = cPtr; 16 | } 17 | 18 | protected SWIGTYPE_p_unsigned_short() { 19 | swigCPtr = 0; 20 | } 21 | 22 | protected static long getCPtr(SWIGTYPE_p_unsigned_short obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/raylib/SWIGTYPE_p_void.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class SWIGTYPE_p_void { 12 | private transient long swigCPtr; 13 | 14 | protected SWIGTYPE_p_void(long cPtr, @SuppressWarnings("unused") boolean futureUse) { 15 | swigCPtr = cPtr; 16 | } 17 | 18 | protected SWIGTYPE_p_void() { 19 | swigCPtr = 0; 20 | } 21 | 22 | protected static long getCPtr(SWIGTYPE_p_void obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/raylib/Shader.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | import static raylib.RaylibConstants.NATIVE_INT_SIZE; 12 | 13 | public class Shader { 14 | private transient long swigCPtr; 15 | protected transient boolean swigCMemOwn; 16 | 17 | protected Shader(long cPtr, boolean cMemoryOwn) { 18 | swigCMemOwn = cMemoryOwn; 19 | swigCPtr = cPtr; 20 | } 21 | 22 | protected static long getCPtr(Shader obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | 26 | protected void finalize() { 27 | delete(); 28 | } 29 | 30 | public synchronized void delete() { 31 | if (swigCPtr != 0) { 32 | if (swigCMemOwn) { 33 | swigCMemOwn = false; 34 | RaylibJNI.delete_Shader(swigCPtr); 35 | } 36 | swigCPtr = 0; 37 | } 38 | } 39 | 40 | public void setId(long value) { 41 | RaylibJNI.Shader_id_set(swigCPtr, this, value); 42 | } 43 | 44 | public long getId() { 45 | return RaylibJNI.Shader_id_get(swigCPtr, this); 46 | } 47 | 48 | public void setLoc(int index, SWIGTYPE_p_int value) { 49 | RaylibJNI.Shader_locs_set(swigCPtr + (NATIVE_INT_SIZE*index), this, SWIGTYPE_p_int.getCPtr(value)); 50 | } 51 | 52 | public SWIGTYPE_p_int getLoc(int index) { 53 | long cPtr = RaylibJNI.Shader_locs_get(swigCPtr + (NATIVE_INT_SIZE*index), this); 54 | return (cPtr == 0) ? null : new SWIGTYPE_p_int(cPtr, false); 55 | } 56 | 57 | public Shader() { 58 | this(RaylibJNI.new_Shader(), true); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/raylib/ShaderLocationIndex.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class ShaderLocationIndex { 12 | public final static ShaderLocationIndex LOC_VERTEX_POSITION = new ShaderLocationIndex("LOC_VERTEX_POSITION", RaylibJNI.LOC_VERTEX_POSITION_get()); 13 | public final static ShaderLocationIndex LOC_VERTEX_TEXCOORD01 = new ShaderLocationIndex("LOC_VERTEX_TEXCOORD01"); 14 | public final static ShaderLocationIndex LOC_VERTEX_TEXCOORD02 = new ShaderLocationIndex("LOC_VERTEX_TEXCOORD02"); 15 | public final static ShaderLocationIndex LOC_VERTEX_NORMAL = new ShaderLocationIndex("LOC_VERTEX_NORMAL"); 16 | public final static ShaderLocationIndex LOC_VERTEX_TANGENT = new ShaderLocationIndex("LOC_VERTEX_TANGENT"); 17 | public final static ShaderLocationIndex LOC_VERTEX_COLOR = new ShaderLocationIndex("LOC_VERTEX_COLOR"); 18 | public final static ShaderLocationIndex LOC_MATRIX_MVP = new ShaderLocationIndex("LOC_MATRIX_MVP"); 19 | public final static ShaderLocationIndex LOC_MATRIX_MODEL = new ShaderLocationIndex("LOC_MATRIX_MODEL"); 20 | public final static ShaderLocationIndex LOC_MATRIX_VIEW = new ShaderLocationIndex("LOC_MATRIX_VIEW"); 21 | public final static ShaderLocationIndex LOC_MATRIX_PROJECTION = new ShaderLocationIndex("LOC_MATRIX_PROJECTION"); 22 | public final static ShaderLocationIndex LOC_VECTOR_VIEW = new ShaderLocationIndex("LOC_VECTOR_VIEW"); 23 | public final static ShaderLocationIndex LOC_COLOR_DIFFUSE = new ShaderLocationIndex("LOC_COLOR_DIFFUSE"); 24 | public final static ShaderLocationIndex LOC_COLOR_SPECULAR = new ShaderLocationIndex("LOC_COLOR_SPECULAR"); 25 | public final static ShaderLocationIndex LOC_COLOR_AMBIENT = new ShaderLocationIndex("LOC_COLOR_AMBIENT"); 26 | public final static ShaderLocationIndex LOC_MAP_ALBEDO = new ShaderLocationIndex("LOC_MAP_ALBEDO"); 27 | public final static ShaderLocationIndex LOC_MAP_METALNESS = new ShaderLocationIndex("LOC_MAP_METALNESS"); 28 | public final static ShaderLocationIndex LOC_MAP_NORMAL = new ShaderLocationIndex("LOC_MAP_NORMAL"); 29 | public final static ShaderLocationIndex LOC_MAP_ROUGHNESS = new ShaderLocationIndex("LOC_MAP_ROUGHNESS"); 30 | public final static ShaderLocationIndex LOC_MAP_OCCLUSION = new ShaderLocationIndex("LOC_MAP_OCCLUSION"); 31 | public final static ShaderLocationIndex LOC_MAP_EMISSION = new ShaderLocationIndex("LOC_MAP_EMISSION"); 32 | public final static ShaderLocationIndex LOC_MAP_HEIGHT = new ShaderLocationIndex("LOC_MAP_HEIGHT"); 33 | public final static ShaderLocationIndex LOC_MAP_CUBEMAP = new ShaderLocationIndex("LOC_MAP_CUBEMAP"); 34 | public final static ShaderLocationIndex LOC_MAP_IRRADIANCE = new ShaderLocationIndex("LOC_MAP_IRRADIANCE"); 35 | public final static ShaderLocationIndex LOC_MAP_PREFILTER = new ShaderLocationIndex("LOC_MAP_PREFILTER"); 36 | public final static ShaderLocationIndex LOC_MAP_BRDF = new ShaderLocationIndex("LOC_MAP_BRDF"); 37 | 38 | public final int swigValue() { 39 | return swigValue; 40 | } 41 | 42 | public String toString() { 43 | return swigName; 44 | } 45 | 46 | public static ShaderLocationIndex swigToEnum(int swigValue) { 47 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 48 | return swigValues[swigValue]; 49 | for (int i = 0; i < swigValues.length; i++) 50 | if (swigValues[i].swigValue == swigValue) 51 | return swigValues[i]; 52 | throw new IllegalArgumentException("No enum " + ShaderLocationIndex.class + " with value " + swigValue); 53 | } 54 | 55 | private ShaderLocationIndex(String swigName) { 56 | this.swigName = swigName; 57 | this.swigValue = swigNext++; 58 | } 59 | 60 | private ShaderLocationIndex(String swigName, int swigValue) { 61 | this.swigName = swigName; 62 | this.swigValue = swigValue; 63 | swigNext = swigValue+1; 64 | } 65 | 66 | private ShaderLocationIndex(String swigName, ShaderLocationIndex swigEnum) { 67 | this.swigName = swigName; 68 | this.swigValue = swigEnum.swigValue; 69 | swigNext = this.swigValue+1; 70 | } 71 | 72 | private static ShaderLocationIndex[] swigValues = { LOC_VERTEX_POSITION, LOC_VERTEX_TEXCOORD01, LOC_VERTEX_TEXCOORD02, LOC_VERTEX_NORMAL, LOC_VERTEX_TANGENT, LOC_VERTEX_COLOR, LOC_MATRIX_MVP, LOC_MATRIX_MODEL, LOC_MATRIX_VIEW, LOC_MATRIX_PROJECTION, LOC_VECTOR_VIEW, LOC_COLOR_DIFFUSE, LOC_COLOR_SPECULAR, LOC_COLOR_AMBIENT, LOC_MAP_ALBEDO, LOC_MAP_METALNESS, LOC_MAP_NORMAL, LOC_MAP_ROUGHNESS, LOC_MAP_OCCLUSION, LOC_MAP_EMISSION, LOC_MAP_HEIGHT, LOC_MAP_CUBEMAP, LOC_MAP_IRRADIANCE, LOC_MAP_PREFILTER, LOC_MAP_BRDF }; 73 | private static int swigNext = 0; 74 | private final int swigValue; 75 | private final String swigName; 76 | } 77 | 78 | -------------------------------------------------------------------------------- /src/main/java/raylib/Sound.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Sound { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Sound(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Sound obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Sound(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setAudioBuffer(SWIGTYPE_p_void value) { 39 | RaylibJNI.Sound_audioBuffer_set(swigCPtr, this, SWIGTYPE_p_void.getCPtr(value)); 40 | } 41 | 42 | public SWIGTYPE_p_void getAudioBuffer() { 43 | long cPtr = RaylibJNI.Sound_audioBuffer_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false); 45 | } 46 | 47 | public void setSource(long value) { 48 | RaylibJNI.Sound_source_set(swigCPtr, this, value); 49 | } 50 | 51 | public long getSource() { 52 | return RaylibJNI.Sound_source_get(swigCPtr, this); 53 | } 54 | 55 | public void setBuffer(long value) { 56 | RaylibJNI.Sound_buffer_set(swigCPtr, this, value); 57 | } 58 | 59 | public long getBuffer() { 60 | return RaylibJNI.Sound_buffer_get(swigCPtr, this); 61 | } 62 | 63 | public void setFormat(int value) { 64 | RaylibJNI.Sound_format_set(swigCPtr, this, value); 65 | } 66 | 67 | public int getFormat() { 68 | return RaylibJNI.Sound_format_get(swigCPtr, this); 69 | } 70 | 71 | public Sound() { 72 | this(RaylibJNI.new_Sound(), true); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/raylib/TexmapIndex.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class TexmapIndex { 12 | public final static TexmapIndex MAP_ALBEDO = new TexmapIndex("MAP_ALBEDO", RaylibJNI.MAP_ALBEDO_get()); 13 | public final static TexmapIndex MAP_METALNESS = new TexmapIndex("MAP_METALNESS", RaylibJNI.MAP_METALNESS_get()); 14 | public final static TexmapIndex MAP_NORMAL = new TexmapIndex("MAP_NORMAL", RaylibJNI.MAP_NORMAL_get()); 15 | public final static TexmapIndex MAP_ROUGHNESS = new TexmapIndex("MAP_ROUGHNESS", RaylibJNI.MAP_ROUGHNESS_get()); 16 | public final static TexmapIndex MAP_OCCLUSION = new TexmapIndex("MAP_OCCLUSION"); 17 | public final static TexmapIndex MAP_EMISSION = new TexmapIndex("MAP_EMISSION"); 18 | public final static TexmapIndex MAP_HEIGHT = new TexmapIndex("MAP_HEIGHT"); 19 | public final static TexmapIndex MAP_CUBEMAP = new TexmapIndex("MAP_CUBEMAP"); 20 | public final static TexmapIndex MAP_IRRADIANCE = new TexmapIndex("MAP_IRRADIANCE"); 21 | public final static TexmapIndex MAP_PREFILTER = new TexmapIndex("MAP_PREFILTER"); 22 | public final static TexmapIndex MAP_BRDF = new TexmapIndex("MAP_BRDF"); 23 | 24 | public final int swigValue() { 25 | return swigValue; 26 | } 27 | 28 | public String toString() { 29 | return swigName; 30 | } 31 | 32 | public static TexmapIndex swigToEnum(int swigValue) { 33 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 34 | return swigValues[swigValue]; 35 | for (int i = 0; i < swigValues.length; i++) 36 | if (swigValues[i].swigValue == swigValue) 37 | return swigValues[i]; 38 | throw new IllegalArgumentException("No enum " + TexmapIndex.class + " with value " + swigValue); 39 | } 40 | 41 | private TexmapIndex(String swigName) { 42 | this.swigName = swigName; 43 | this.swigValue = swigNext++; 44 | } 45 | 46 | private TexmapIndex(String swigName, int swigValue) { 47 | this.swigName = swigName; 48 | this.swigValue = swigValue; 49 | swigNext = swigValue+1; 50 | } 51 | 52 | private TexmapIndex(String swigName, TexmapIndex swigEnum) { 53 | this.swigName = swigName; 54 | this.swigValue = swigEnum.swigValue; 55 | swigNext = this.swigValue+1; 56 | } 57 | 58 | private static TexmapIndex[] swigValues = { MAP_ALBEDO, MAP_METALNESS, MAP_NORMAL, MAP_ROUGHNESS, MAP_OCCLUSION, MAP_EMISSION, MAP_HEIGHT, MAP_CUBEMAP, MAP_IRRADIANCE, MAP_PREFILTER, MAP_BRDF }; 59 | private static int swigNext = 0; 60 | private final int swigValue; 61 | private final String swigName; 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/main/java/raylib/Texture2D.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Texture2D { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Texture2D(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Texture2D obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Texture2D(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setId(long value) { 39 | RaylibJNI.Texture2D_id_set(swigCPtr, this, value); 40 | } 41 | 42 | public long getId() { 43 | return RaylibJNI.Texture2D_id_get(swigCPtr, this); 44 | } 45 | 46 | public void setWidth(int value) { 47 | RaylibJNI.Texture2D_width_set(swigCPtr, this, value); 48 | } 49 | 50 | public int getWidth() { 51 | return RaylibJNI.Texture2D_width_get(swigCPtr, this); 52 | } 53 | 54 | public void setHeight(int value) { 55 | RaylibJNI.Texture2D_height_set(swigCPtr, this, value); 56 | } 57 | 58 | public int getHeight() { 59 | return RaylibJNI.Texture2D_height_get(swigCPtr, this); 60 | } 61 | 62 | public void setMipmaps(int value) { 63 | RaylibJNI.Texture2D_mipmaps_set(swigCPtr, this, value); 64 | } 65 | 66 | public int getMipmaps() { 67 | return RaylibJNI.Texture2D_mipmaps_get(swigCPtr, this); 68 | } 69 | 70 | public void setFormat(int value) { 71 | RaylibJNI.Texture2D_format_set(swigCPtr, this, value); 72 | } 73 | 74 | public int getFormat() { 75 | return RaylibJNI.Texture2D_format_get(swigCPtr, this); 76 | } 77 | 78 | public Texture2D() { 79 | this(RaylibJNI.new_Texture2D(), true); 80 | } 81 | 82 | public static final int FILTER_MODE_POINT = 0; 83 | public static final int FILTER_MODE_BILINEAR = 1; 84 | public static final int FILTER_MODE_TRILINEAR = 2; 85 | public static final int FILTER_MODE_ANISOTROPIC_4X = 3; 86 | public static final int FILTER_MODE_ANISOTROPIC_8X = 4; 87 | public static final int FILTER_MODE_ANISOTROPIC_16X = 5; 88 | 89 | public static final int WRAP_MODE_REPEAT = 0; 90 | public static final int WRAP_MODE_CLAMP = 1; 91 | public static final int WRAP_MODE_MIRROR = 2; 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/raylib/TextureFilterMode.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class TextureFilterMode { 12 | public final static TextureFilterMode FILTER_POINT = new TextureFilterMode("FILTER_POINT", RaylibJNI.FILTER_POINT_get()); 13 | public final static TextureFilterMode FILTER_BILINEAR = new TextureFilterMode("FILTER_BILINEAR"); 14 | public final static TextureFilterMode FILTER_TRILINEAR = new TextureFilterMode("FILTER_TRILINEAR"); 15 | public final static TextureFilterMode FILTER_ANISOTROPIC_4X = new TextureFilterMode("FILTER_ANISOTROPIC_4X"); 16 | public final static TextureFilterMode FILTER_ANISOTROPIC_8X = new TextureFilterMode("FILTER_ANISOTROPIC_8X"); 17 | public final static TextureFilterMode FILTER_ANISOTROPIC_16X = new TextureFilterMode("FILTER_ANISOTROPIC_16X"); 18 | 19 | public final int swigValue() { 20 | return swigValue; 21 | } 22 | 23 | public String toString() { 24 | return swigName; 25 | } 26 | 27 | public static TextureFilterMode swigToEnum(int swigValue) { 28 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 29 | return swigValues[swigValue]; 30 | for (int i = 0; i < swigValues.length; i++) 31 | if (swigValues[i].swigValue == swigValue) 32 | return swigValues[i]; 33 | throw new IllegalArgumentException("No enum " + TextureFilterMode.class + " with value " + swigValue); 34 | } 35 | 36 | private TextureFilterMode(String swigName) { 37 | this.swigName = swigName; 38 | this.swigValue = swigNext++; 39 | } 40 | 41 | private TextureFilterMode(String swigName, int swigValue) { 42 | this.swigName = swigName; 43 | this.swigValue = swigValue; 44 | swigNext = swigValue+1; 45 | } 46 | 47 | private TextureFilterMode(String swigName, TextureFilterMode swigEnum) { 48 | this.swigName = swigName; 49 | this.swigValue = swigEnum.swigValue; 50 | swigNext = this.swigValue+1; 51 | } 52 | 53 | private static TextureFilterMode[] swigValues = { FILTER_POINT, FILTER_BILINEAR, FILTER_TRILINEAR, FILTER_ANISOTROPIC_4X, FILTER_ANISOTROPIC_8X, FILTER_ANISOTROPIC_16X }; 54 | private static int swigNext = 0; 55 | private final int swigValue; 56 | private final String swigName; 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/main/java/raylib/TextureWrapMode.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class TextureWrapMode { 12 | public final static TextureWrapMode WRAP_REPEAT = new TextureWrapMode("WRAP_REPEAT", RaylibJNI.WRAP_REPEAT_get()); 13 | public final static TextureWrapMode WRAP_CLAMP = new TextureWrapMode("WRAP_CLAMP"); 14 | public final static TextureWrapMode WRAP_MIRROR = new TextureWrapMode("WRAP_MIRROR"); 15 | 16 | public final int swigValue() { 17 | return swigValue; 18 | } 19 | 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static TextureWrapMode swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 26 | return swigValues[swigValue]; 27 | for (int i = 0; i < swigValues.length; i++) 28 | if (swigValues[i].swigValue == swigValue) 29 | return swigValues[i]; 30 | throw new IllegalArgumentException("No enum " + TextureWrapMode.class + " with value " + swigValue); 31 | } 32 | 33 | private TextureWrapMode(String swigName) { 34 | this.swigName = swigName; 35 | this.swigValue = swigNext++; 36 | } 37 | 38 | private TextureWrapMode(String swigName, int swigValue) { 39 | this.swigName = swigName; 40 | this.swigValue = swigValue; 41 | swigNext = swigValue+1; 42 | } 43 | 44 | private TextureWrapMode(String swigName, TextureWrapMode swigEnum) { 45 | this.swigName = swigName; 46 | this.swigValue = swigEnum.swigValue; 47 | swigNext = this.swigValue+1; 48 | } 49 | 50 | private static TextureWrapMode[] swigValues = { WRAP_REPEAT, WRAP_CLAMP, WRAP_MIRROR }; 51 | private static int swigNext = 0; 52 | private final int swigValue; 53 | private final String swigName; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/main/java/raylib/Vector2.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Vector2 { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Vector2(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Vector2 obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Vector2(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setX(float value) { 39 | RaylibJNI.Vector2_x_set(swigCPtr, this, value); 40 | } 41 | 42 | public float getX() { 43 | return RaylibJNI.Vector2_x_get(swigCPtr, this); 44 | } 45 | 46 | public void setY(float value) { 47 | RaylibJNI.Vector2_y_set(swigCPtr, this, value); 48 | } 49 | 50 | public float getY() { 51 | return RaylibJNI.Vector2_y_get(swigCPtr, this); 52 | } 53 | 54 | public Vector2() { 55 | this(RaylibJNI.new_Vector2(), true); 56 | } 57 | 58 | public Vector2(float x, float y) { 59 | this(); 60 | this.setX(x); 61 | this.setY(y); 62 | } 63 | 64 | public void add_i(Vector2 other) { 65 | this.setX(this.getX()+other.getX()); 66 | this.setY(this.getY()+other.getY()); 67 | } 68 | 69 | public void add_i(float other) { 70 | this.setX(this.getX()+other); 71 | this.setY(this.getY()+other); 72 | } 73 | 74 | public void multiply_i(Vector2 other) { 75 | this.setX(this.getX()*other.getX()); 76 | this.setY(this.getY()*other.getY()); 77 | } 78 | 79 | public void multiply_i(float other) { 80 | this.setX(this.getX()*other); 81 | this.setY(this.getY()*other); 82 | } 83 | 84 | public void subtract_i(Vector2 other) { 85 | this.setX(this.getX()-other.getX()); 86 | this.setY(this.getY()-other.getY()); 87 | } 88 | 89 | public void subtract_i(float other) { 90 | this.setX(this.getX()-other); 91 | this.setY(this.getY()-other); 92 | } 93 | 94 | public Vector2 add(Vector2 other) { 95 | return new Vector2(this.getX()+other.getX(), this.getY()+other.getY()); 96 | } 97 | 98 | public Vector2 add(float other) { 99 | return new Vector2(this.getX()+other, this.getY()+other); 100 | } 101 | 102 | public Vector2 multiply(Vector2 other) { 103 | return new Vector2(this.getX()*other.getX(), this.getY()*other.getY()); 104 | } 105 | 106 | public Vector2 multiply(float other) { 107 | return new Vector2(this.getX()*other, this.getY()*other); 108 | } 109 | 110 | public Vector2 subtract(Vector2 other) { 111 | return new Vector2(this.getX()-other.getX(), this.getY()-other.getY()); 112 | } 113 | 114 | public Vector2 subtract(float other) { 115 | return new Vector2(this.getX()-other, this.getY()-other); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/main/java/raylib/Vector3.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Vector3 { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Vector3(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Vector3 obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Vector3(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setX(float value) { 39 | RaylibJNI.Vector3_x_set(swigCPtr, this, value); 40 | } 41 | 42 | public float getX() { 43 | return RaylibJNI.Vector3_x_get(swigCPtr, this); 44 | } 45 | 46 | public void setY(float value) { 47 | RaylibJNI.Vector3_y_set(swigCPtr, this, value); 48 | } 49 | 50 | public float getY() { 51 | return RaylibJNI.Vector3_y_get(swigCPtr, this); 52 | } 53 | 54 | public void setZ(float value) { 55 | RaylibJNI.Vector3_z_set(swigCPtr, this, value); 56 | } 57 | 58 | public float getZ() { 59 | return RaylibJNI.Vector3_z_get(swigCPtr, this); 60 | } 61 | 62 | public Vector3() { 63 | this(RaylibJNI.new_Vector3(), true); 64 | } 65 | 66 | public Vector3(float x, float y, float z) { 67 | this(); 68 | this.setX(x); 69 | this.setY(y); 70 | this.setZ(z); 71 | } 72 | 73 | public void add_i(Vector3 other) { 74 | this.setX(this.getX()+other.getX()); 75 | this.setY(this.getY()+other.getY()); 76 | this.setZ(this.getZ()+other.getZ()); 77 | } 78 | 79 | public void add_i(float other) { 80 | this.setX(this.getX()+other); 81 | this.setY(this.getY()+other); 82 | this.setZ(this.getZ()+other); 83 | } 84 | 85 | public void multiply_i(Vector3 other) { 86 | this.setX(this.getX()*other.getX()); 87 | this.setY(this.getY()*other.getY()); 88 | this.setZ(this.getZ()*other.getZ()); 89 | } 90 | 91 | public void multiply_i(float other) { 92 | this.setX(this.getX()*other); 93 | this.setY(this.getY()*other); 94 | this.setZ(this.getZ()*other); 95 | } 96 | 97 | public void subtract_i(Vector3 other) { 98 | this.setX(this.getX()-other.getX()); 99 | this.setY(this.getY()-other.getY()); 100 | this.setZ(this.getZ()-other.getZ()); 101 | } 102 | 103 | public void subtract_i(float other) { 104 | this.setX(this.getX()-other); 105 | this.setY(this.getY()-other); 106 | this.setZ(this.getZ()-other); 107 | } 108 | 109 | public Vector3 add(Vector3 other) { 110 | return new Vector3( 111 | this.getX()+other.getX(), 112 | this.getY()+other.getY(), 113 | this.getZ()+other.getZ() 114 | ); 115 | } 116 | 117 | public Vector3 add(float other) { 118 | return new Vector3( 119 | this.getX()+other, 120 | this.getY()+other, 121 | this.getZ()+other); 122 | } 123 | 124 | public Vector3 multiply(Vector3 other) { 125 | return new Vector3( 126 | this.getX()*other.getX(), 127 | this.getY()*other.getY(), 128 | this.getZ()*other.getZ()); 129 | } 130 | 131 | public Vector3 multiply(float other) { 132 | return new Vector3( 133 | this.getX()*other, 134 | this.getY()*other, 135 | this.getZ()*other); 136 | } 137 | 138 | public Vector3 subtract(Vector3 other) { 139 | return new Vector3( 140 | this.getX()-other.getX(), 141 | this.getY()-other.getY(), 142 | this.getZ()-other.getZ()); 143 | } 144 | 145 | public Vector3 subtract(float other) { 146 | return new Vector3( 147 | this.getX()-other, 148 | this.getY()-other, 149 | this.getZ()-other); 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /src/main/java/raylib/Vector4.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | import static java.lang.Math.acos; 12 | import static java.lang.Math.sqrt; 13 | 14 | public class Vector4 { 15 | private transient long swigCPtr; 16 | protected transient boolean swigCMemOwn; 17 | 18 | protected Vector4(long cPtr, boolean cMemoryOwn) { 19 | swigCMemOwn = cMemoryOwn; 20 | swigCPtr = cPtr; 21 | } 22 | 23 | protected static long getCPtr(Vector4 obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | 27 | protected void finalize() { 28 | delete(); 29 | } 30 | 31 | public synchronized void delete() { 32 | if (swigCPtr != 0) { 33 | if (swigCMemOwn) { 34 | swigCMemOwn = false; 35 | RaylibJNI.delete_Vector4(swigCPtr); 36 | } 37 | swigCPtr = 0; 38 | } 39 | } 40 | 41 | public void setX(float value) { 42 | RaylibJNI.Vector4_x_set(swigCPtr, this, value); 43 | } 44 | 45 | public float getX() { 46 | return RaylibJNI.Vector4_x_get(swigCPtr, this); 47 | } 48 | 49 | public void setY(float value) { 50 | RaylibJNI.Vector4_y_set(swigCPtr, this, value); 51 | } 52 | 53 | public float getY() { 54 | return RaylibJNI.Vector4_y_get(swigCPtr, this); 55 | } 56 | 57 | public void setZ(float value) { 58 | RaylibJNI.Vector4_z_set(swigCPtr, this, value); 59 | } 60 | 61 | public float getZ() { 62 | return RaylibJNI.Vector4_z_get(swigCPtr, this); 63 | } 64 | 65 | public void setW(float value) { 66 | RaylibJNI.Vector4_w_set(swigCPtr, this, value); 67 | } 68 | 69 | public float getW() { 70 | return RaylibJNI.Vector4_w_get(swigCPtr, this); 71 | } 72 | 73 | public Vector4() { 74 | this(RaylibJNI.new_Vector4(), true); 75 | } 76 | 77 | public Vector4(float x, float y, float z, float w) { 78 | this(); 79 | this.setX(x); 80 | this.setY(y); 81 | this.setZ(z); 82 | this.setW(w); 83 | } 84 | 85 | public void add_i(Vector4 other) { 86 | this.setX(this.getX()+other.getX()); 87 | this.setY(this.getY()+other.getY()); 88 | this.setZ(this.getZ()+other.getZ()); 89 | this.setW(this.getW()+other.getW()); 90 | } 91 | 92 | public void add_i(float other) { 93 | this.setX(this.getX()+other); 94 | this.setY(this.getY()+other); 95 | this.setZ(this.getZ()+other); 96 | this.setW(this.getW()+other); 97 | } 98 | 99 | public void multiply_i(Vector4 other) { 100 | this.setX(this.getX()*other.getX()); 101 | this.setY(this.getY()*other.getY()); 102 | this.setZ(this.getZ()*other.getZ()); 103 | this.setW(this.getW()*other.getW()); 104 | } 105 | 106 | public void multiply_i(float other) { 107 | this.setX(this.getX()*other); 108 | this.setY(this.getY()*other); 109 | this.setZ(this.getZ()*other); 110 | this.setW(this.getW()*other); 111 | } 112 | 113 | public void subtract_i(Vector4 other) { 114 | this.setX(this.getX()-other.getX()); 115 | this.setY(this.getY()-other.getY()); 116 | this.setZ(this.getZ()-other.getZ()); 117 | this.setW(this.getW()-other.getW()); 118 | } 119 | 120 | public void subtract_i(float other) { 121 | this.setX(this.getX()-other); 122 | this.setY(this.getY()-other); 123 | this.setZ(this.getZ()-other); 124 | this.setW(this.getW()-other); 125 | } 126 | 127 | public Vector4 add(Vector4 other) { 128 | return new Vector4( 129 | this.getX()+other.getX(), 130 | this.getY()+other.getY(), 131 | this.getZ()+other.getZ(), 132 | this.getW()+other.getW() 133 | ); 134 | } 135 | 136 | public Vector4 add(float other) { 137 | return new Vector4( 138 | this.getX()+other, 139 | this.getY()+other, 140 | this.getZ()+other, 141 | this.getW()+other); 142 | } 143 | 144 | public Vector4 multiply(Vector4 other) { 145 | return new Vector4( 146 | this.getX()*other.getX(), 147 | this.getY()*other.getY(), 148 | this.getZ()*other.getZ(), 149 | this.getW()*other.getW()); 150 | } 151 | 152 | public Vector4 multiply(float other) { 153 | return new Vector4( 154 | this.getX()*other, 155 | this.getY()*other, 156 | this.getZ()*other, 157 | this.getW()*other); 158 | } 159 | 160 | public Vector4 subtract(Vector4 other) { 161 | return new Vector4( 162 | this.getX()-other.getX(), 163 | this.getY()-other.getY(), 164 | this.getZ()-other.getZ(), 165 | this.getW()-other.getW()); 166 | } 167 | 168 | public Vector4 subtract(float other) { 169 | return new Vector4( 170 | this.getX()-other, 171 | this.getY()-other, 172 | this.getZ()-other, 173 | this.getW()-other); 174 | } 175 | 176 | /// Treat this Vector4 as a quaternion and extract the angle. 177 | public float getAngle() { 178 | return 2f * (float)acos(this.getW()); 179 | } 180 | 181 | /// Treat this Vector4 as a quaternion and extract the axis. 182 | public Vector3 getAxis(float angle) { 183 | /* 184 | angle = 2 * acos(qw) 185 | x = qx / sqrt(1-qw*qw) 186 | y = qy / sqrt(1-qw*qw) 187 | z = qz / sqrt(1-qw*qw) 188 | if(qw ~ 0) -> then x,y,z = qx,qy,qz. 189 | */ 190 | float root = (float)sqrt(1f - getW()*getW()); 191 | if(root < 0.0001f) { 192 | root = 1f; 193 | } 194 | float invRoot = 1.0f/root; 195 | return new Vector3(getX()*invRoot, getY()*invRoot, getZ()*invRoot); 196 | } 197 | 198 | /// Treat this Vector4 as a quaternion and extract the axis. 199 | public Vector3 getAxis() { 200 | return getAxis(getAngle()); 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /src/main/java/raylib/VrDeviceInfo.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class VrDeviceInfo { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected VrDeviceInfo(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(VrDeviceInfo obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_VrDeviceInfo(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setHResolution(int value) { 39 | RaylibJNI.VrDeviceInfo_hResolution_set(swigCPtr, this, value); 40 | } 41 | 42 | public int getHResolution() { 43 | return RaylibJNI.VrDeviceInfo_hResolution_get(swigCPtr, this); 44 | } 45 | 46 | public void setVResolution(int value) { 47 | RaylibJNI.VrDeviceInfo_vResolution_set(swigCPtr, this, value); 48 | } 49 | 50 | public int getVResolution() { 51 | return RaylibJNI.VrDeviceInfo_vResolution_get(swigCPtr, this); 52 | } 53 | 54 | public void setHScreenSize(float value) { 55 | RaylibJNI.VrDeviceInfo_hScreenSize_set(swigCPtr, this, value); 56 | } 57 | 58 | public float getHScreenSize() { 59 | return RaylibJNI.VrDeviceInfo_hScreenSize_get(swigCPtr, this); 60 | } 61 | 62 | public void setVScreenSize(float value) { 63 | RaylibJNI.VrDeviceInfo_vScreenSize_set(swigCPtr, this, value); 64 | } 65 | 66 | public float getVScreenSize() { 67 | return RaylibJNI.VrDeviceInfo_vScreenSize_get(swigCPtr, this); 68 | } 69 | 70 | public void setVScreenCenter(float value) { 71 | RaylibJNI.VrDeviceInfo_vScreenCenter_set(swigCPtr, this, value); 72 | } 73 | 74 | public float getVScreenCenter() { 75 | return RaylibJNI.VrDeviceInfo_vScreenCenter_get(swigCPtr, this); 76 | } 77 | 78 | public void setEyeToScreenDistance(float value) { 79 | RaylibJNI.VrDeviceInfo_eyeToScreenDistance_set(swigCPtr, this, value); 80 | } 81 | 82 | public float getEyeToScreenDistance() { 83 | return RaylibJNI.VrDeviceInfo_eyeToScreenDistance_get(swigCPtr, this); 84 | } 85 | 86 | public void setLensSeparationDistance(float value) { 87 | RaylibJNI.VrDeviceInfo_lensSeparationDistance_set(swigCPtr, this, value); 88 | } 89 | 90 | public float getLensSeparationDistance() { 91 | return RaylibJNI.VrDeviceInfo_lensSeparationDistance_get(swigCPtr, this); 92 | } 93 | 94 | public void setInterpupillaryDistance(float value) { 95 | RaylibJNI.VrDeviceInfo_interpupillaryDistance_set(swigCPtr, this, value); 96 | } 97 | 98 | public float getInterpupillaryDistance() { 99 | return RaylibJNI.VrDeviceInfo_interpupillaryDistance_get(swigCPtr, this); 100 | } 101 | 102 | public void setLensDistortionValues(SWIGTYPE_p_float value) { 103 | RaylibJNI.VrDeviceInfo_lensDistortionValues_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 104 | } 105 | 106 | public SWIGTYPE_p_float getLensDistortionValues() { 107 | long cPtr = RaylibJNI.VrDeviceInfo_lensDistortionValues_get(swigCPtr, this); 108 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 109 | } 110 | 111 | public void setChromaAbCorrection(SWIGTYPE_p_float value) { 112 | RaylibJNI.VrDeviceInfo_chromaAbCorrection_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 113 | } 114 | 115 | public SWIGTYPE_p_float getChromaAbCorrection() { 116 | long cPtr = RaylibJNI.VrDeviceInfo_chromaAbCorrection_get(swigCPtr, this); 117 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 118 | } 119 | 120 | public VrDeviceInfo() { 121 | this(RaylibJNI.new_VrDeviceInfo(), true); 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /src/main/java/raylib/VrDeviceType.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public final class VrDeviceType { 12 | public final static VrDeviceType HMD_DEFAULT_DEVICE = new VrDeviceType("HMD_DEFAULT_DEVICE", RaylibJNI.HMD_DEFAULT_DEVICE_get()); 13 | public final static VrDeviceType HMD_OCULUS_RIFT_DK2 = new VrDeviceType("HMD_OCULUS_RIFT_DK2"); 14 | public final static VrDeviceType HMD_OCULUS_RIFT_CV1 = new VrDeviceType("HMD_OCULUS_RIFT_CV1"); 15 | public final static VrDeviceType HMD_OCULUS_GO = new VrDeviceType("HMD_OCULUS_GO"); 16 | public final static VrDeviceType HMD_VALVE_HTC_VIVE = new VrDeviceType("HMD_VALVE_HTC_VIVE"); 17 | public final static VrDeviceType HMD_SONY_PSVR = new VrDeviceType("HMD_SONY_PSVR"); 18 | 19 | public final int swigValue() { 20 | return swigValue; 21 | } 22 | 23 | public String toString() { 24 | return swigName; 25 | } 26 | 27 | public static VrDeviceType swigToEnum(int swigValue) { 28 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 29 | return swigValues[swigValue]; 30 | for (int i = 0; i < swigValues.length; i++) 31 | if (swigValues[i].swigValue == swigValue) 32 | return swigValues[i]; 33 | throw new IllegalArgumentException("No enum " + VrDeviceType.class + " with value " + swigValue); 34 | } 35 | 36 | private VrDeviceType(String swigName) { 37 | this.swigName = swigName; 38 | this.swigValue = swigNext++; 39 | } 40 | 41 | private VrDeviceType(String swigName, int swigValue) { 42 | this.swigName = swigName; 43 | this.swigValue = swigValue; 44 | swigNext = swigValue+1; 45 | } 46 | 47 | private VrDeviceType(String swigName, VrDeviceType swigEnum) { 48 | this.swigName = swigName; 49 | this.swigValue = swigEnum.swigValue; 50 | swigNext = this.swigValue+1; 51 | } 52 | 53 | private static VrDeviceType[] swigValues = { HMD_DEFAULT_DEVICE, HMD_OCULUS_RIFT_DK2, HMD_OCULUS_RIFT_CV1, HMD_OCULUS_GO, HMD_VALVE_HTC_VIVE, HMD_SONY_PSVR }; 54 | private static int swigNext = 0; 55 | private final int swigValue; 56 | private final String swigName; 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/main/java/raylib/Wave.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.12 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package raylib; 10 | 11 | public class Wave { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected Wave(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(Wave obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RaylibJNI.delete_Wave(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setSampleCount(long value) { 39 | RaylibJNI.Wave_sampleCount_set(swigCPtr, this, value); 40 | } 41 | 42 | public long getSampleCount() { 43 | return RaylibJNI.Wave_sampleCount_get(swigCPtr, this); 44 | } 45 | 46 | public void setSampleRate(long value) { 47 | RaylibJNI.Wave_sampleRate_set(swigCPtr, this, value); 48 | } 49 | 50 | public long getSampleRate() { 51 | return RaylibJNI.Wave_sampleRate_get(swigCPtr, this); 52 | } 53 | 54 | public void setSampleSize(long value) { 55 | RaylibJNI.Wave_sampleSize_set(swigCPtr, this, value); 56 | } 57 | 58 | public long getSampleSize() { 59 | return RaylibJNI.Wave_sampleSize_get(swigCPtr, this); 60 | } 61 | 62 | public void setChannels(long value) { 63 | RaylibJNI.Wave_channels_set(swigCPtr, this, value); 64 | } 65 | 66 | public long getChannels() { 67 | return RaylibJNI.Wave_channels_get(swigCPtr, this); 68 | } 69 | 70 | public void setData(SWIGTYPE_p_void value) { 71 | RaylibJNI.Wave_data_set(swigCPtr, this, SWIGTYPE_p_void.getCPtr(value)); 72 | } 73 | 74 | public SWIGTYPE_p_void getData() { 75 | long cPtr = RaylibJNI.Wave_data_get(swigCPtr, this); 76 | return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false); 77 | } 78 | 79 | public Wave() { 80 | this(RaylibJNI.new_Wave(), true); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/resources/lib/win64/raylib.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e8247eac05120fca3c7d4340b3f32c56b6e1844ad443824354149e9bf38adb3c 3 | size 2941059 4 | -------------------------------------------------------------------------------- /src/test/java/MainTest.java: -------------------------------------------------------------------------------- 1 | import org.junit.Test; 2 | import raylib.*; 3 | 4 | import static raylib.Color.*; 5 | import static raylib.Raylib.*; 6 | import static raylib.TextureFilterMode.*; 7 | 8 | public class MainTest { 9 | /*** runMain 10 | * Open and close a window just to be sure that our library is sane. 11 | */ 12 | @Test 13 | public void runMain() { 14 | InitWindow(640, 480, "Test"); 15 | CloseWindow(); 16 | } 17 | 18 | //@Test 19 | public void pickingExample() { 20 | // Initialization 21 | //-------------------------------------------------------------------------------------- 22 | int screenWidth = 800; 23 | int screenHeight = 450; 24 | 25 | InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d picking"); 26 | 27 | // Define the camera to look into our 3d world 28 | Camera3D camera = new Camera3D(); 29 | camera.setPosition(new Vector3(10.0f, 10.0f, 10.0f)); // Camera position 30 | camera.setTarget(new Vector3(0.0f, 0.0f, 0.0f)); // Camera looking at point 31 | camera.setUp(new Vector3(0f, 1f, 0f)); // Camera up vector (rotation towards target) 32 | camera.setFovy(45.0f); // Camera field-of-view Y 33 | //camera.setType(CameraType.CAMERA_PERSPECTIVE); // Camera mode type 34 | camera.setType(0); // Perspective 35 | 36 | Vector3 cubePosition = new Vector3(0.0f, 1.0f, 0.0f); 37 | Vector3 cubeSize = new Vector3(2.0f, 2.0f, 2.0f); 38 | 39 | Ray ray = new Ray(); // Picking line ray 40 | 41 | boolean collision = false; 42 | 43 | //SetCameraMode(camera, CAMERA_FREE); // Set a free camera mode 44 | SetCameraMode(camera, 1); 45 | 46 | SetTargetFPS(60); // Set our game to run at 60 frames-per-second 47 | //-------------------------------------------------------------------------------------- 48 | 49 | // Main game loop 50 | while (!WindowShouldClose()) // Detect window close button or ESC key 51 | { 52 | // Update 53 | //---------------------------------------------------------------------------------- 54 | UpdateCamera(camera); // Update camera 55 | 56 | if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) 57 | { 58 | ray = GetMouseRay(GetMousePosition(), camera); 59 | 60 | // Check collision between ray and box 61 | collision = CheckCollisionRayBox(ray, 62 | new BoundingBox( 63 | cubePosition.getX() - cubeSize.getX()/2, cubePosition.getY() - cubeSize.getY()/2, cubePosition.getZ() - cubeSize.getZ()/2, 64 | cubePosition.getX() + cubeSize.getX()/2, cubePosition.getY() + cubeSize.getY()/2, cubePosition.getZ() + cubeSize.getZ()/2 65 | ) 66 | ); 67 | } 68 | //---------------------------------------------------------------------------------- 69 | 70 | // Draw 71 | //---------------------------------------------------------------------------------- 72 | BeginDrawing(); 73 | 74 | ClearBackground(new Color(255, 255, 255)); 75 | 76 | BeginMode3D(camera); 77 | 78 | if (collision) 79 | { 80 | DrawCube(cubePosition, cubeSize.getX(), cubeSize.getY(), cubeSize.getZ(), new Color(255, 0, 0)); 81 | DrawCubeWires(cubePosition, cubeSize.getX(), cubeSize.getY(), cubeSize.getZ(), new Color(200, 0, 50)); 82 | 83 | DrawCubeWires(cubePosition, cubeSize.getX() + 0.2f, cubeSize.getY() + 0.2f, cubeSize.getZ() + 0.2f, new Color(0, 255, 0)); 84 | } 85 | else 86 | { 87 | DrawCube(cubePosition, cubeSize.getX(), cubeSize.getY(), cubeSize.getZ(), new Color(128, 128, 128)); 88 | DrawCubeWires(cubePosition, cubeSize.getX(), cubeSize.getY(), cubeSize.getZ(), new Color(50, 50, 50)); 89 | } 90 | 91 | DrawRay(ray, new Color(200, 0, 50)); 92 | DrawGrid(10, 1.0f); 93 | 94 | EndMode3D(); 95 | 96 | DrawText("Try selecting the box with mouse!", 240, 10, 20, new Color(50, 50, 50)); 97 | 98 | if(collision) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, (int)(screenHeight * 0.1f), 30, new Color(0, 255, 0)); 99 | 100 | DrawFPS(10, 10); 101 | 102 | EndDrawing(); 103 | //---------------------------------------------------------------------------------- 104 | Thread.yield(); 105 | } 106 | 107 | // De-Initialization 108 | //-------------------------------------------------------------------------------------- 109 | CloseWindow(); // Close window and OpenGL context 110 | //-------------------------------------------------------------------------------------- 111 | 112 | } 113 | 114 | //@Test 115 | public void modelLoadTest() { 116 | // Initialization 117 | //-------------------------------------------------------------------------------------- 118 | int screenWidth = 800; 119 | int screenHeight = 450; 120 | 121 | InitWindow(screenWidth, screenHeight, "raylib [models] example - obj model loading"); 122 | 123 | // Define the camera to look into our 3d world 124 | Camera3D camera = new Camera3D(); 125 | camera.setPosition(new Vector3(3.0f, 3.0f, 3.0f)); 126 | camera.setTarget(new Vector3(0.0f, 1.5f, 0.0f)); 127 | camera.setUp(new Vector3(0.0f, 1.0f, 0.0f)); 128 | camera.setFovy(45f); 129 | 130 | // NOTE: LoadModel is relative to the running path, NOT the JAR. 131 | Model dwarf = LoadModel("src/test/resources/bridge.obj"); // Load OBJ model 132 | Texture2D texture = LoadTexture("src/test/resources/bridge_diffuse.png"); // Load model texture 133 | dwarf.getMaterial().getMap(Material.MAP_DIFFUSE).setTexture(texture); 134 | //dwarf.material.maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture 135 | Vector3 position = new Vector3(0.0f, 0.0f, 0.0f); // Set model position 136 | 137 | SetTargetFPS(60); // Set our game to run at 60 frames-per-second 138 | //-------------------------------------------------------------------------------------- 139 | 140 | // Main game loop 141 | while (!WindowShouldClose()) // Detect window close button or ESC key 142 | { 143 | // Update 144 | //---------------------------------------------------------------------------------- 145 | //... 146 | //---------------------------------------------------------------------------------- 147 | 148 | // Draw 149 | //---------------------------------------------------------------------------------- 150 | BeginDrawing(); 151 | 152 | ClearBackground(RAYWHITE); 153 | 154 | BeginMode3D(camera); 155 | 156 | DrawModel(dwarf, position, 0.5f, Color.WHITE); // Draw 3d model with texture 157 | 158 | DrawGrid(10, 1.0f); // Draw a grid 159 | 160 | DrawGizmo(position); // Draw gizmo 161 | 162 | EndMode3D(); 163 | 164 | DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, Color.GRAY); 165 | 166 | DrawFPS(10, 10); 167 | 168 | EndDrawing(); 169 | //---------------------------------------------------------------------------------- 170 | } 171 | 172 | // De-Initialization 173 | //-------------------------------------------------------------------------------------- 174 | UnloadTexture(texture); // Unload texture 175 | UnloadModel(dwarf); // Unload model 176 | 177 | CloseWindow(); // Close window and OpenGL context 178 | //-------------------------------------------------------------------------------------- 179 | } 180 | 181 | //@Test 182 | public void testTTF() { 183 | // Initialization 184 | //-------------------------------------------------------------------------------------- 185 | int screenWidth = 800; 186 | int screenHeight = 450; 187 | 188 | InitWindow(screenWidth, screenHeight, "raylib [text] example - ttf loading"); 189 | 190 | String msg = "TTF Font"; 191 | 192 | // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required) 193 | 194 | // TTF Font loading with custom generation parameters 195 | Font font = LoadFontEx("src/test/resources/KAISG.ttf", 96, 0, null); 196 | 197 | // Generate mipmap levels to use trilinear filtering 198 | // NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR 199 | GenTextureMipmaps(font.getTexture()); 200 | 201 | float fontSize = font.getBaseSize(); 202 | Vector2 fontPosition = new Vector2( 40, screenHeight/2 - 80); 203 | Vector2 textSize; 204 | 205 | SetTextureFilter(font.getTexture(), Texture2D.FILTER_MODE_POINT); 206 | int currentFontFilter = 0; 207 | 208 | SetTargetFPS(60); 209 | //-------------------------------------------------------------------------------------- 210 | 211 | // Main game loop 212 | while (!WindowShouldClose()) // Detect window close button or ESC key 213 | { 214 | // Update 215 | //---------------------------------------------------------------------------------- 216 | fontSize += GetMouseWheelMove()*4.0f; 217 | 218 | // Choose font texture filter method 219 | if (IsKeyPressed(KEY_ONE)) 220 | { 221 | SetTextureFilter(font.getTexture(), Texture2D.FILTER_MODE_POINT); 222 | currentFontFilter = 0; 223 | } 224 | else if (IsKeyPressed(KEY_TWO)) 225 | { 226 | SetTextureFilter(font.getTexture(), Texture2D.FILTER_MODE_BILINEAR); 227 | currentFontFilter = 1; 228 | } 229 | else if (IsKeyPressed(KEY_THREE)) 230 | { 231 | // NOTE: Trilinear filter won't be noticed on 2D drawing 232 | SetTextureFilter(font.getTexture(), Texture2D.FILTER_MODE_TRILINEAR); 233 | currentFontFilter = 2; 234 | } 235 | 236 | textSize = MeasureTextEx(font, msg, fontSize, 0); 237 | 238 | if (IsKeyDown(KEY_LEFT)) fontPosition.setX(fontPosition.getX() - 10); 239 | else if (IsKeyDown(KEY_RIGHT)) fontPosition.setX(fontPosition.getX() + 10); 240 | 241 | //---------------------------------------------------------------------------------- 242 | 243 | // Draw 244 | //---------------------------------------------------------------------------------- 245 | BeginDrawing(); 246 | 247 | ClearBackground(RAYWHITE); 248 | 249 | DrawText("Use mouse wheel to change font size", 20, 20, 10, GRAY); 250 | DrawText("Use KEY_RIGHT and KEY_LEFT to move text", 20, 40, 10, GRAY); 251 | DrawText("Use 1, 2, 3 to change texture filter", 20, 60, 10, GRAY); 252 | DrawText("Drop a new TTF font for dynamic loading", 20, 80, 10, DARKGRAY); 253 | 254 | DrawTextEx(font, msg, fontPosition, fontSize, 0, BLACK); 255 | 256 | // TODO: It seems texSize measurement is not accurate due to chars offsets... 257 | //DrawRectangleLines(fontPosition.x, fontPosition.y, textSize.x, textSize.y, RED); 258 | 259 | DrawRectangle(0, screenHeight - 80, screenWidth, 80, LIGHTGRAY); 260 | DrawText("Font size: "+ fontSize, 20, screenHeight - 50, 10, DARKGRAY); 261 | DrawText("Text size: " + textSize.getX() + ", " + textSize.getY(), 20, screenHeight - 30, 10, DARKGRAY); 262 | DrawText("CURRENT TEXTURE FILTER:", 250, 400, 20, GRAY); 263 | 264 | if (currentFontFilter == 0) DrawText("POINT", 570, 400, 20, BLACK); 265 | else if (currentFontFilter == 1) DrawText("BILINEAR", 570, 400, 20, BLACK); 266 | else if (currentFontFilter == 2) DrawText("TRILINEAR", 570, 400, 20, BLACK); 267 | 268 | EndDrawing(); 269 | //---------------------------------------------------------------------------------- 270 | } 271 | 272 | // De-Initialization 273 | //-------------------------------------------------------------------------------------- 274 | UnloadFont(font); // Font unloading 275 | 276 | CloseWindow(); // Close window and OpenGL context 277 | //-------------------------------------------------------------------------------------- 278 | } 279 | } 280 | --------------------------------------------------------------------------------