summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/NativeLibLoader.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-04-24 02:41:52 +0200
committerMichael Bien <[email protected]>2010-04-24 02:41:52 +0200
commitb0f4d671bcf799884a3d3f31fbfee47f7fc6e5cb (patch)
treedeca75214756762e5be05fa8e54c0a5413eb0015 /src/com/jogamp/opencl/NativeLibLoader.java
parent2fc985f0cdc373cb3c78cc198e21dcc1ce5d961f (diff)
dynamic binding for OpenGL specific functionality.
Diffstat (limited to 'src/com/jogamp/opencl/NativeLibLoader.java')
-rw-r--r--src/com/jogamp/opencl/NativeLibLoader.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/com/jogamp/opencl/NativeLibLoader.java b/src/com/jogamp/opencl/NativeLibLoader.java
index 2761cb3c..5cce1a36 100644
--- a/src/com/jogamp/opencl/NativeLibLoader.java
+++ b/src/com/jogamp/opencl/NativeLibLoader.java
@@ -1,20 +1,26 @@
package com.jogamp.opencl;
-import java.security.AccessController;
import java.security.PrivilegedAction;
import com.jogamp.common.jvm.JNILibLoaderBase;
+import com.jogamp.common.os.NativeLibrary;
+
+import static java.security.AccessController.*;
/**
- *
+ * Responsible for JOCL lib loading.
* @author Michael Bien
*/
class NativeLibLoader extends JNILibLoaderBase {
- public static void loadJOCL() {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
+ /**
+ * Loads the native binding and returns the OpenCL library for dynamic linking.
+ */
+ static NativeLibrary loadJOCL() {
+
+ return doPrivileged(new PrivilegedAction<NativeLibrary>() {
+ public NativeLibrary run() {
loadLibrary("jocl", null, true);
- return null;
+ return NativeLibrary.open("OpenCL", NativeLibLoader.class.getClassLoader());
}
});
}