From 9125a275449cb533798357914945de1f742a91f9 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Tue, 4 May 2010 02:22:19 +0200 Subject: 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 --- src/com/jogamp/opencl/gl/CLGLContext.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/com/jogamp/opencl/gl/CLGLContext.java') 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]); -- cgit v1.2.3