summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/gl/CLGLContext.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-05-04 02:22:19 +0200
committerMichael Bien <[email protected]>2010-05-04 02:22:19 +0200
commit9125a275449cb533798357914945de1f742a91f9 (patch)
treec25d5357ac99ec24bee4e7f2c95775362877db0b /src/com/jogamp/opencl/gl/CLGLContext.java
parentea95ca1b96300fc9b2ec937759663eb0ed1406bf (diff)
finished main functionality of ErrorHandler impl.
- using event listener add/remove pattern instead add on context creation - context -> error handler object global reference mapping(TM) using LongLongMap in CLImpl - global ref is deleted on context release
Diffstat (limited to 'src/com/jogamp/opencl/gl/CLGLContext.java')
-rw-r--r--src/com/jogamp/opencl/gl/CLGLContext.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/com/jogamp/opencl/gl/CLGLContext.java b/src/com/jogamp/opencl/gl/CLGLContext.java
index 7b574664..dde05e75 100644
--- a/src/com/jogamp/opencl/gl/CLGLContext.java
+++ b/src/com/jogamp/opencl/gl/CLGLContext.java
@@ -23,8 +23,8 @@ public final class CLGLContext extends CLContext {
final long glID;
private final GLContext glContext;
- private CLGLContext(CLPlatform platform, GLContext glContext, long clContextID, long glContextID) {
- super(platform, clContextID);
+ private CLGLContext(CLPlatform platform, GLContext glContext, long clContextID, long glContextID, ErrorDispatcher dispatcher) {
+ super(platform, clContextID, dispatcher);
this.glID = glContextID;
this.glContext = glContext;
}
@@ -81,9 +81,10 @@ public final class CLGLContext extends CLContext {
long[] glID = new long[1];
PointerBuffer properties = setupContextProperties(platform, glContext, glID);
- long clID = createContextFromType(properties, toDeviceBitmap(deviceTypes));
+ ErrorDispatcher dispatcher = createErrorHandler();
+ long clID = createContextFromType(dispatcher, properties, toDeviceBitmap(deviceTypes));
- return new CLGLContext(platform, glContext, clID, glID[0]);
+ return new CLGLContext(platform, glContext, clID, glID[0], dispatcher);
}
@@ -101,9 +102,10 @@ public final class CLGLContext extends CLContext {
long[] glID = new long[1];
PointerBuffer properties = setupContextProperties(platform, glContext, glID);
- long clID = createContext(properties, devices);
+ ErrorDispatcher dispatcher = createErrorHandler();
+ long clID = createContext(dispatcher, properties, devices);
- CLGLContext context = new CLGLContext(platform, glContext, clID, glID[0]);
+ CLGLContext context = new CLGLContext(platform, glContext, clID, glID[0], dispatcher);
if(devices != null) {
for (int i = 0; i < devices.length; i++) {
context.overrideContext(devices[i]);