From ec14381e0bd681c354de1a002894a628f8bf69e5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 12 Oct 2013 23:36:51 +0200 Subject: Bug 579: Use result value in checkForError(..) for CLGLTexture2d.createFromGL*, CLGLTexture3d.createFromGL*, CLGLImage2d.createFromGL* and CLGLBuffer.createFromGL* - instead of returned 'id' Thank you Johan & Daniel ! Using your original patch, I went through the other CLGL[Texture*|Image2d|Buffer] classes and ensured all are handled the same. Reported and 1st patch provided by: Johan Confirmed by: Daniel Balog --- src/com/jogamp/opencl/gl/CLGLBuffer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/com/jogamp/opencl/gl/CLGLBuffer.java') diff --git a/src/com/jogamp/opencl/gl/CLGLBuffer.java b/src/com/jogamp/opencl/gl/CLGLBuffer.java index 7d41b0eb..a9fc49cd 100644 --- a/src/com/jogamp/opencl/gl/CLGLBuffer.java +++ b/src/com/jogamp/opencl/gl/CLGLBuffer.java @@ -40,7 +40,7 @@ import javax.media.opengl.GLContext; /** * Shared buffer between OpenGL and OpenCL contexts. - * @author Michael Bien + * @author Michael Bien, et.al. */ public final class CLGLBuffer extends CLBuffer implements CLGLObject { @@ -56,16 +56,16 @@ public final class CLGLBuffer extends CLBuffer implements C } - static CLGLBuffer create(CLContext context, B directBuffer, long size, int flags, int glObject) { + static CLGLBuffer create(CLContext context, B directBuffer, long size, int flags, int glBuffer) { checkBuffer(directBuffer, flags); CLGL clgli = (CLGL)getCL(context); int[] result = new int[1]; - long id = clgli.clCreateFromGLBuffer(context.ID, flags, glObject, result, 0); - CLException.checkForError(result[0], "can not create CLGLObject from #"+glObject); + long id = clgli.clCreateFromGLBuffer(context.ID, flags, glBuffer, result, 0); + CLException.checkForError(result[0], "can not create CLGLObject from glBuffer #"+glBuffer); - return new CLGLBuffer(context, directBuffer, id, glObject, size, flags); + return new CLGLBuffer(context, directBuffer, id, glBuffer, size, flags); } static void checkBuffer(B directBuffer, int flags) throws IllegalArgumentException { -- cgit v1.2.3