static <B extends Buffer> CLGLBuffer<B> create(CLContext context, B directBuffer, long size, int flags, int glObject) {
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);
return new CLGLBuffer<B>(context, directBuffer, id, glObject, size, flags);
}