summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLPlatform.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/CLPlatform.java
parent2fc985f0cdc373cb3c78cc198e21dcc1ce5d961f (diff)
dynamic binding for OpenGL specific functionality.
Diffstat (limited to 'src/com/jogamp/opencl/CLPlatform.java')
-rw-r--r--src/com/jogamp/opencl/CLPlatform.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java
index f3c00926..aa162d0c 100644
--- a/src/com/jogamp/opencl/CLPlatform.java
+++ b/src/com/jogamp/opencl/CLPlatform.java
@@ -1,9 +1,14 @@
package com.jogamp.opencl;
+import com.jogamp.common.JogampRuntimeException;
import com.jogamp.common.nio.Int64Buffer;
+import com.jogamp.common.os.NativeLibrary;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.util.CLUtil;
import com.jogamp.opencl.impl.CLImpl;
-import com.jogamp.common.nio.PointerBuffer;
+import com.jogamp.opencl.impl.CLProcAddressTable;
+import com.jogamp.gluegen.runtime.ProcAddressHelper;
+
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
@@ -34,10 +39,16 @@ public final class CLPlatform {
private Set<String> extensions;
static{
- NativeLibLoader.loadJOCL();
-// System.loadLibrary("gluegen-rt");
-// ProcAddressHelper.resetProcAddressTable(table, null);
- cl = new CLImpl();
+ try {
+ NativeLibrary lib = NativeLibLoader.loadJOCL();
+
+ CLProcAddressTable table = new CLProcAddressTable();
+ ProcAddressHelper.resetProcAddressTable(table, lib);
+
+ cl = new CLImpl(table);
+ }catch(Exception ex) {
+ throw new JogampRuntimeException("JOCL initialization error.", ex);
+ }
}
private CLPlatform(long id) {