com.jogamp.common.nio.Buffers.rangeCheck()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(20.2k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中com.jogamp.common.nio.Buffers.rangeCheck()方法的一些代码示例,展示了Buffers.rangeCheck()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffers.rangeCheck()方法的具体详情如下:
包路径:com.jogamp.common.nio.Buffers
类名称:Buffers
方法名:rangeCheck

Buffers.rangeCheck介绍

暂无

代码示例

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glGenBuffers}(GLsizei n, GLuint *  buffers) </code> <br>Part of <code>GL_VERSION_1_5</code>, <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>, <code>GL_ARB_vertex_buffer_object</code><br>Alias for: <code>glGenBuffersARB</code>   */
public void glGenBuffers(int n, int[] buffers, int buffers_offset)  {
 Buffers.rangeCheck(buffers, buffers_offset, n);
 if(buffers != null && buffers.length <= buffers_offset)
  throw new GLException("array offset argument \"buffers_offset\" (" + buffers_offset + ") equals or exceeds array length (" + buffers.length + ")");
 final long __addr_ = _pat._addressof_glGenBuffers;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glGenBuffers"));
 }
   dispatch_glGenBuffers1(n, buffers, Buffers.SIZEOF_INT * buffers_offset, false, __addr_);
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glDeleteTextures}(GLsizei n, const GLuint *  textures) </code> <br>Part of <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>, <code>GL_VERSION_1_1</code>, <code>GL_EXT_texture_object</code><br>Alias for: <code>glDeleteTexturesEXT</code>   */
public void glDeleteTextures(int n, int[] textures, int textures_offset)  {
 Buffers.rangeCheck(textures, textures_offset, n);
 if(textures != null && textures.length <= textures_offset)
  throw new GLException("array offset argument \"textures_offset\" (" + textures_offset + ") equals or exceeds array length (" + textures.length + ")");
 final long __addr_ = _pat._addressof_glDeleteTextures;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDeleteTextures"));
 }
   dispatch_glDeleteTextures1(n, textures, Buffers.SIZEOF_INT * textures_offset, false, __addr_);
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glGenQueries}(GLsizei n, GLuint *  ids) </code> <br>Part of <code>GL_VERSION_1_5</code>, <code>GL_ES_VERSION_3_0</code>, <code>GL_EXT_disjoint_timer_query</code>, <code>GL_ARB_occlusion_query</code><br>Alias for: <code>glGenQueriesEXT</code>, <code>glGenQueriesARB</code>   */
public void glGenQueries(int n, int[] ids, int ids_offset)  {
 Buffers.rangeCheck(ids, ids_offset, n);
 if(ids != null && ids.length <= ids_offset)
  throw new GLException("array offset argument \"ids_offset\" (" + ids_offset + ") equals or exceeds array length (" + ids.length + ")");
 final long __addr_ = _pat._addressof_glGenQueries;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glGenQueries"));
 }
   dispatch_glGenQueries1(n, ids, Buffers.SIZEOF_INT * ids_offset, false, __addr_);
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glDeleteQueries}(GLsizei n, const GLuint *  ids) </code> <br>Part of <code>GL_VERSION_1_5</code>, <code>GL_ES_VERSION_3_0</code>, <code>GL_EXT_disjoint_timer_query</code>, <code>GL_ARB_occlusion_query</code><br>Alias for: <code>glDeleteQueriesEXT</code>, <code>glDeleteQueriesARB</code>   */
public void glDeleteQueries(int n, int[] ids, int ids_offset)  {
 Buffers.rangeCheck(ids, ids_offset, n);
 if(ids != null && ids.length <= ids_offset)
  throw new GLException("array offset argument \"ids_offset\" (" + ids_offset + ") equals or exceeds array length (" + ids.length + ")");
 final long __addr_ = _pat._addressof_glDeleteQueries;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDeleteQueries"));
 }
   dispatch_glDeleteQueries1(n, ids, Buffers.SIZEOF_INT * ids_offset, false, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glGenFencesNV}(GLsizei, GLuint * ) </code> <br>Part of <code>GL_NV_fence</code>   */
public void glGenFencesNV(int arg0, int[] arg1, int arg1_offset)  {
 Buffers.rangeCheck(arg1, arg1_offset, arg0);
 if(arg1 != null && arg1.length <= arg1_offset)
  throw new GLException("array offset argument \"arg1_offset\" (" + arg1_offset + ") equals or exceeds array length (" + arg1.length + ")");
 final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glGenFencesNV;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glGenFencesNV"));
 }
   dispatch_glGenFencesNV1(arg0, arg1, Buffers.SIZEOF_INT * arg1_offset, false, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glGenFencesNV}(GLsizei, GLuint * ) </code> <br>Part of <code>GL_NV_fence</code>   */
public void glGenFencesNV(int arg0, int[] arg1, int arg1_offset)  {
 Buffers.rangeCheck(arg1, arg1_offset, arg0);
 if(arg1 != null && arg1.length <= arg1_offset)
  throw new GLException("array offset argument \"arg1_offset\" (" + arg1_offset + ") equals or exceeds array length (" + arg1.length + ")");
 final long __addr_ = ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glGenFencesNV;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glGenFencesNV"));
 }
   dispatch_glGenFencesNV1(arg0, arg1, Buffers.SIZEOF_INT * arg1_offset, false, __addr_);
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glDeleteBuffers}(GLsizei n, const GLuint *  buffers) </code> <br>Part of <code>GL_VERSION_1_5</code>, <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>, <code>GL_ARB_vertex_buffer_object</code><br>Alias for: <code>glDeleteBuffersARB</code>   */
public void glDeleteBuffers(int n, int[] buffers, int buffers_offset)  {
 bufferObjectTracker.notifyBuffersDeleted(n, buffers, buffers_offset);
 Buffers.rangeCheck(buffers, buffers_offset, n);
 if(buffers != null && buffers.length <= buffers_offset)
  throw new GLException("array offset argument \"buffers_offset\" (" + buffers_offset + ") equals or exceeds array length (" + buffers.length + ")");
 final long __addr_ = _pat._addressof_glDeleteBuffers;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDeleteBuffers"));
 }
   dispatch_glDeleteBuffers1(n, buffers, Buffers.SIZEOF_INT * buffers_offset, false, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glGenTextures}(GLsizei n, GLuint *  textures) </code> <br>Part of <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>, <code>GL_VERSION_1_1</code>   */
public void glGenTextures(int n, int[] textures, int textures_offset)  {
 Buffers.rangeCheck(textures, textures_offset, n);
 if(textures != null && textures.length <= textures_offset)
  throw new GLException("array offset argument \"textures_offset\" (" + textures_offset + ") equals or exceeds array length (" + textures.length + ")");
 final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glGenTextures;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glGenTextures"));
 }
   dispatch_glGenTextures1(n, textures, Buffers.SIZEOF_INT * textures_offset, false, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glGenBuffers}(GLsizei n, GLuint *  buffers) </code> <br>Part of <code>GL_VERSION_1_5</code>, <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>   */
public void glGenBuffers(int n, int[] buffers, int buffers_offset)  {
 Buffers.rangeCheck(buffers, buffers_offset, n);
 if(buffers != null && buffers.length <= buffers_offset)
  throw new GLException("array offset argument \"buffers_offset\" (" + buffers_offset + ") equals or exceeds array length (" + buffers.length + ")");
 final long __addr_ = ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glGenBuffers;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glGenBuffers"));
 }
   dispatch_glGenBuffers1(n, buffers, Buffers.SIZEOF_INT * buffers_offset, false, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glDeleteTextures}(GLsizei n, const GLuint *  textures) </code> <br>Part of <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>, <code>GL_VERSION_1_1</code>
  @param textures a direct or array-backed {@link java.nio.IntBuffer}   */
public void glDeleteTextures(int n, IntBuffer textures)  {
 Buffers.rangeCheck(textures, n);
 final boolean textures_is_direct = Buffers.isDirect(textures);
 final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glDeleteTextures;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDeleteTextures"));
 }
   dispatch_glDeleteTextures1(n, textures_is_direct ? textures : Buffers.getArray(textures), textures_is_direct ? Buffers.getDirectBufferByteOffset(textures) : Buffers.getIndirectBufferByteOffset(textures), textures_is_direct, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glGenBuffers}(GLsizei n, GLuint *  buffers) </code> <br>Part of <code>GL_VERSION_1_5</code>, <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>
  @param buffers a direct or array-backed {@link java.nio.IntBuffer}   */
public void glGenBuffers(int n, IntBuffer buffers)  {
 Buffers.rangeCheck(buffers, n);
 final boolean buffers_is_direct = Buffers.isDirect(buffers);
 final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glGenBuffers;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glGenBuffers"));
 }
   dispatch_glGenBuffers1(n, buffers_is_direct ? buffers : Buffers.getArray(buffers), buffers_is_direct ? Buffers.getDirectBufferByteOffset(buffers) : Buffers.getIndirectBufferByteOffset(buffers), buffers_is_direct, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glDeleteTextures}(GLsizei n, const GLuint *  textures) </code> <br>Part of <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>, <code>GL_VERSION_1_1</code>
  @param textures a direct or array-backed {@link java.nio.IntBuffer}   */
public void glDeleteTextures(int n, IntBuffer textures)  {
 Buffers.rangeCheck(textures, n);
 final boolean textures_is_direct = Buffers.isDirect(textures);
 final long __addr_ = ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glDeleteTextures;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDeleteTextures"));
 }
   dispatch_glDeleteTextures1(n, textures_is_direct ? textures : Buffers.getArray(textures), textures_is_direct ? Buffers.getDirectBufferByteOffset(textures) : Buffers.getIndirectBufferByteOffset(textures), textures_is_direct, __addr_);
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glDrawElements}(GLenum mode, GLsizei count, GLenum type, const void *  indices) </code> <br>Part of <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>, <code>GL_VERSION_1_1</code><br>
  @param indices a direct or array-backed {@link java.nio.Buffer}   */
public void glDrawElements(int mode, int count, int type, Buffer indices)  {
 checkElementVBOUnbound(true);
 Buffers.rangeCheck(indices, count);
 final boolean indices_is_direct = Buffers.isDirect(indices);
 final long __addr_ = _pat._addressof_glDrawElements;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDrawElements"));
 }
   dispatch_glDrawElements1(mode, count, type, indices_is_direct ? indices : Buffers.getArray(indices), indices_is_direct ? Buffers.getDirectBufferByteOffset(indices) : Buffers.getIndirectBufferByteOffset(indices), indices_is_direct, __addr_);
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glDrawElementsInstancedBaseInstance}(GLenum mode, GLsizei count, GLenum type, const void *  indices, GLsizei instancecount, GLuint baseinstance) </code> <br>Part of <code>GL_ARB_base_instance</code>, <code>GL_VERSION_4_2</code>, <code>GL_EXT_base_instance</code><br>Alias for: <code>glDrawElementsInstancedBaseInstanceEXT</code>
  @param indices a direct or array-backed {@link java.nio.Buffer}   */
public void glDrawElementsInstancedBaseInstance(int mode, int count, int type, Buffer indices, int instancecount, int baseinstance)  {
 checkElementVBOUnbound(true);
 Buffers.rangeCheck(indices, count);
 final boolean indices_is_direct = Buffers.isDirect(indices);
 final long __addr_ = _pat._addressof_glDrawElementsInstancedBaseInstance;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDrawElementsInstancedBaseInstance"));
 }
   dispatch_glDrawElementsInstancedBaseInstance1(mode, count, type, indices_is_direct ? indices : Buffers.getArray(indices), indices_is_direct ? Buffers.getDirectBufferByteOffset(indices) : Buffers.getIndirectBufferByteOffset(indices), indices_is_direct, instancecount, baseinstance, __addr_);
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glDeleteBuffers}(GLsizei n, const GLuint *  buffers) </code> <br>Part of <code>GL_VERSION_1_5</code>, <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>, <code>GL_ARB_vertex_buffer_object</code><br>Alias for: <code>glDeleteBuffersARB</code>
  @param buffers a direct or array-backed {@link java.nio.IntBuffer}   */
public void glDeleteBuffers(int n, IntBuffer buffers)  {
 bufferObjectTracker.notifyBuffersDeleted(n, buffers);
 Buffers.rangeCheck(buffers, n);
 final boolean buffers_is_direct = Buffers.isDirect(buffers);
 final long __addr_ = _pat._addressof_glDeleteBuffers;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDeleteBuffers"));
 }
   dispatch_glDeleteBuffers1(n, buffers_is_direct ? buffers : Buffers.getArray(buffers), buffers_is_direct ? Buffers.getDirectBufferByteOffset(buffers) : Buffers.getIndirectBufferByteOffset(buffers), buffers_is_direct, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glGenFencesNV}(GLsizei, GLuint * ) </code> <br>Part of <code>GL_NV_fence</code>
  @param arg1 a direct or array-backed {@link java.nio.IntBuffer}   */
public void glGenFencesNV(int arg0, IntBuffer arg1)  {
 Buffers.rangeCheck(arg1, arg0);
 final boolean arg1_is_direct = Buffers.isDirect(arg1);
 final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glGenFencesNV;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glGenFencesNV"));
 }
   dispatch_glGenFencesNV1(arg0, arg1_is_direct ? arg1 : Buffers.getArray(arg1), arg1_is_direct ? Buffers.getDirectBufferByteOffset(arg1) : Buffers.getIndirectBufferByteOffset(arg1), arg1_is_direct, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glGenFencesNV}(GLsizei, GLuint * ) </code> <br>Part of <code>GL_NV_fence</code>
  @param arg1 a direct or array-backed {@link java.nio.IntBuffer}   */
public void glGenFencesNV(int arg0, IntBuffer arg1)  {
 Buffers.rangeCheck(arg1, arg0);
 final boolean arg1_is_direct = Buffers.isDirect(arg1);
 final long __addr_ = ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glGenFencesNV;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glGenFencesNV"));
 }
   dispatch_glGenFencesNV1(arg0, arg1_is_direct ? arg1 : Buffers.getArray(arg1), arg1_is_direct ? Buffers.getDirectBufferByteOffset(arg1) : Buffers.getIndirectBufferByteOffset(arg1), arg1_is_direct, __addr_);
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glDrawElementsInstanced}(GLenum mode, GLsizei count, GLenum type, const void *  indices, GLsizei instancecount) </code> <br>Part of <code>GL_ES_VERSION_3_0</code>, <code>GL_VERSION_3_1</code>, <code>GL_ARB_draw_instanced</code>, <code>GL_EXT_draw_instanced</code>, <code>GL_ANGLE_instanced_arrays</code>, <code>GL_NV_draw_instanced</code><br>Alias for: <code>glDrawElementsInstancedARB</code>, <code>glDrawElementsInstancedEXT</code>, <code>glDrawElementsInstancedANGLE</code>, <code>glDrawElementsInstancedNV</code>
  @param indices a direct or array-backed {@link java.nio.Buffer}   */
public void glDrawElementsInstanced(int mode, int count, int type, Buffer indices, int instancecount)  {
 checkElementVBOUnbound(true);
 Buffers.rangeCheck(indices, count);
 final boolean indices_is_direct = Buffers.isDirect(indices);
 final long __addr_ = _pat._addressof_glDrawElementsInstanced;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDrawElementsInstanced"));
 }
   dispatch_glDrawElementsInstanced1(mode, count, type, indices_is_direct ? indices : Buffers.getArray(indices), indices_is_direct ? Buffers.getDirectBufferByteOffset(indices) : Buffers.getIndirectBufferByteOffset(indices), indices_is_direct, instancecount, __addr_);
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

/** Entry point to C language function: <code> void {@native glDrawElements}(GLenum mode, GLsizei count, GLenum type, const GLvoid *  indices) </code> <br>Part of <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>, <code>GL_VERSION_1_1</code><br>
  @param indices a direct or array-backed {@link java.nio.Buffer}   */
public void glDrawElements(int mode, int count, int type, Buffer indices)  {
 checkElementVBOUnbound(true);
 Buffers.rangeCheck(indices, count);
 final boolean indices_is_direct = Buffers.isDirect(indices);
 final long __addr_ = _pat._addressof_glDrawElements;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDrawElements"));
 }
   dispatch_glDrawElements1(mode, count, type, indices_is_direct ? indices : Buffers.getArray(indices), indices_is_direct ? Buffers.getDirectBufferByteOffset(indices) : Buffers.getIndirectBufferByteOffset(indices), indices_is_direct, __addr_);
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

/** Entry point to C language function: <code> void {@native glDeleteBuffers}(GLsizei n, const GLuint *  buffers) </code> <br>Part of <code>GL_VERSION_1_5</code>, <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>
  @param buffers a direct or array-backed {@link java.nio.IntBuffer}   */
public void glDeleteBuffers(int n, IntBuffer buffers)  {
 bufferObjectTracker.notifyBuffersDeleted(n, buffers);
 Buffers.rangeCheck(buffers, n);
 final boolean buffers_is_direct = Buffers.isDirect(buffers);
 final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glDeleteBuffers;
 if (__addr_ == 0) {
  throw new GLException(String.format("Method \"%s\" not available", "glDeleteBuffers"));
 }
   dispatch_glDeleteBuffers1(n, buffers_is_direct ? buffers : Buffers.getArray(buffers), buffers_is_direct ? Buffers.getDirectBufferByteOffset(buffers) : Buffers.getIndirectBufferByteOffset(buffers), buffers_is_direct, __addr_);
}

相关文章