code: public static int cuGraphicsGLRegisterBuffer(CUgraphicsResource pCudaResource, int buffer, int Flags)
      {
          return checkResult(cuGraphicsGLRegisterBufferNative(pCudaResource, buffer, Flags));
      }
docs: Registers an OpenGL buffer object.
  
  <pre>
  CUresult cuGraphicsGLRegisterBuffer (
  CUgraphicsResource* pCudaResource,
  GLuint buffer,
  unsigned int  Flags )
  </pre>
  <div>
  <p>Registers an OpenGL buffer object.
  Registers the buffer object specified by <tt>buffer</tt> for access
  by CUDA. A handle to the registered object is returned as <tt>pCudaResource</tt>. The register flags <tt>Flags</tt> specify the
  intended usage, as follows:
  </p>
  <ul>
  <li>
  <p>CU_GRAPHICS_REGISTER_FLAGS_NONE:
  Specifies no hints about how this resource will be used. It is therefore
  assumed that this
  resource will be read from and
  written to by CUDA. This is the default value.
  </p>
  </li>
  <li>
  <p>CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY:
  Specifies that CUDA will not write to this resource.
  </p>
  </li>
  <li>
  <p>CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD: Specifies that CUDA will
  not read from this resource and will write over the entire
  contents of the resource, so
  none of the data previously stored in the resource will be preserved.
  </p>
  </li>
  </ul>
  </p>
  <div>
  <span>Note:</span>
  <p>Note that this
  function may also return error codes from previous, asynchronous
  launches.
  </p>
  </div>
  </p>
  </div>
  
  @param pCudaResource Pointer to the returned object handle
  @param buffer name of buffer object to be registered
  @param Flags Register flags
  
  @return CUDA_SUCCESS, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_ALREADY_MAPPED,
  CUDA_ERROR_INVALID_CONTEXT,
  
  @see JCudaDriver#cuGraphicsUnregisterResource
  @see JCudaDriver#cuGraphicsMapResources
  @see JCudaDriver#cuGraphicsResourceGetMappedPointer