Last active
February 27, 2016 05:44
-
-
Save saudet/a6a1264f6df639688d5a to your computer and use it in GitHub Desktop.
Using JavaCPP without user-defined native libraries (bytedeco/javacpp@485081f)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build and execute normally: | |
// $ javac -cp javacpp.jar HelloPointer.java | |
// $ java -jar javacpp.jar HelloPointer | |
// $ java -cp javacpp.jar HelloPointer | |
import org.bytedeco.javacpp.*; | |
import org.bytedeco.javacpp.annotation.*; | |
@Platform | |
public class HelloPointer { | |
static { Loader.load(); } | |
public static void main(String[] args) { | |
FloatPointer p = new FloatPointer(100); | |
float[] a = new float[p.capacity()]; | |
p.put(0, 42); | |
p.get(a); | |
System.out.println(a.length + " " + a[0]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment