diff options
author | Sven Gothel <[email protected]> | 2013-10-12 23:36:51 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-10-12 23:36:51 +0200 |
commit | ec14381e0bd681c354de1a002894a628f8bf69e5 (patch) | |
tree | c7c057b10538345fbd85e446ff7ef23ed2f4b57b /src/com/jogamp/opencl/gl/CLGLBuffer.java | |
parent | 8fefade93b3b48d5d6d3233af48c483e335203f3 (diff) |
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 <[email protected]>
Confirmed by: Daniel Balog <[email protected]>
Diffstat (limited to 'src/com/jogamp/opencl/gl/CLGLBuffer.java')
-rw-r--r-- | src/com/jogamp/opencl/gl/CLGLBuffer.java | 10 |
1 files changed, 5 insertions, 5 deletions
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<B extends Buffer> extends CLBuffer<B> implements CLGLObject { @@ -56,16 +56,16 @@ public final class CLGLBuffer<B extends Buffer> extends CLBuffer<B> implements C } - static <B extends Buffer> CLGLBuffer<B> create(CLContext context, B directBuffer, long size, int flags, int glObject) { + static <B extends Buffer> CLGLBuffer<B> 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<B>(context, directBuffer, id, glObject, size, flags); + return new CLGLBuffer<B>(context, directBuffer, id, glBuffer, size, flags); } static <B extends Buffer> void checkBuffer(B directBuffer, int flags) throws IllegalArgumentException { |