Exemplo n.º 1
0
 /** DoubleBuffer version of: {@link #glTexSubImage3D TexSubImage3D} */
 public static void glTexSubImage3D(
     int target,
     int level,
     int xoffset,
     int yoffset,
     int zoffset,
     int width,
     int height,
     int depth,
     int format,
     int type,
     DoubleBuffer pixels) {
   if (LWJGLUtil.CHECKS) GLChecks.ensureBufferObject(GL21.GL_PIXEL_UNPACK_BUFFER_BINDING, false);
   nglTexSubImage3D(
       target,
       level,
       xoffset,
       yoffset,
       zoffset,
       width,
       height,
       depth,
       format,
       type,
       memAddress(pixels));
 }
Exemplo n.º 2
0
 /**
  * <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawRangeElements.xml">OpenGL SDK
  * Reference</a>
  *
  * <p>A restricted form of {@link GL11#glDrawElements DrawElements}. mode, start, end, and count
  * match the corresponding arguments to glDrawElements, with the additional constraint that all
  * values in the arrays count must lie between start and end, inclusive.
  *
  * <p>Implementations denote recommended maximum amounts of vertex and index data, which may be
  * queried by calling glGet with argument {@link #GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES}
  * and {@link #GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than
  * the value of GL_MAX_ELEMENTS_VERTICES, or if count is greater than the value of
  * GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no
  * requirement that all vertices in the range start end be referenced. However, the implementation
  * may partially process unused vertices, reducing performance from what could be achieved with an
  * optimal index set.
  *
  * <p>When glDrawRangeElements is called, it uses count sequential elements from an enabled array,
  * starting at start to construct a sequence of geometric primitives. mode specifies what kind of
  * primitives are constructed, and how the array elements construct these primitives. If more than
  * one array is enabled, each is used.
  *
  * <p>Vertex attributes that are modified by glDrawRangeElements have an unspecified value after
  * glDrawRangeElements returns. Attributes that aren't modified maintain their previous values.
  *
  * <h3>Errors</h3>
  *
  * It is an error for indices to lie outside the range start end, but implementations may not
  * check for this situation. Such indices cause implementation-dependent behavior.
  *
  * <ul>
  *   <li>GL_INVALID_ENUM is generated if mode is not an accepted value.
  *   <li>GL_INVALID_VALUE is generated if count is negative.
  *   <li>GL_INVALID_VALUE is generated if end &lt; start.
  *   <li>GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible
  *       with the input primitive type of the geometry shader in the currently installed program
  *       object.
  *   <li>GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled
  *       array or the element array and the buffer object's data store is currently mapped.
  * </ul>
  *
  * @param mode the kind of primitives to render. One of:
  *     <p>{@link GL11#GL_POINTS POINTS}, {@link GL11#GL_LINE_STRIP LINE_STRIP}, {@link
  *     GL11#GL_LINE_LOOP LINE_LOOP}, {@link GL11#GL_LINES LINES}, {@link GL11#GL_POLYGON POLYGON},
  *     {@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}, {@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN},
  *     {@link GL11#GL_TRIANGLES TRIANGLES}, {@link GL11#GL_QUAD_STRIP QUAD_STRIP}, {@link
  *     GL11#GL_QUADS QUADS}, {@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}, {@link
  *     GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}, {@link GL32#GL_TRIANGLES_ADJACENCY
  *     TRIANGLES_ADJACENCY}, {@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY},
  *     {@link GL40#GL_PATCHES PATCHES}
  * @param start the minimum array index contained in {@code indices}
  * @param end the maximum array index contained in {@code indices}
  * @param count the number of elements to be rendered
  * @param type the type of the values in {@code indices}. One of:
  *     <p>{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}, {@link GL11#GL_UNSIGNED_SHORT
  *     UNSIGNED_SHORT}, {@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
  * @param indices a pointer to the location where the indices are stored
  */
 public static void glDrawRangeElements(
     int mode, int start, int end, int count, int type, ByteBuffer indices) {
   if (LWJGLUtil.CHECKS) {
     checkBuffer(indices, count / GLChecks.typeToBytes(type));
     GLChecks.ensureBufferObject(GL15.GL_ELEMENT_ARRAY_BUFFER_BINDING, false);
   }
   nglDrawRangeElements(mode, start, end, count, type, memAddress(indices));
 }
Exemplo n.º 3
0
 /** Alternative version of: {@link #glDrawRangeElements DrawRangeElements} */
 public static void glDrawRangeElements(
     int mode, int start, int end, int type, ByteBuffer indices) {
   if (LWJGLUtil.CHECKS) GLChecks.ensureBufferObject(GL15.GL_ELEMENT_ARRAY_BUFFER_BINDING, true);
   nglDrawRangeElements(
       mode,
       start,
       end,
       indices.remaining() * GLChecks.typeToBytes(type),
       type,
       memAddress(indices));
 }
Exemplo n.º 4
0
 /** Buffer object offset version of: {@link #glTexImage3D TexImage3D} */
 public static void glTexImage3D(
     int target,
     int level,
     int internalformat,
     int width,
     int height,
     int depth,
     int border,
     int format,
     int type,
     long pixelsOffset) {
   if (LWJGLUtil.CHECKS) GLChecks.ensureBufferObject(GL21.GL_PIXEL_UNPACK_BUFFER_BINDING, true);
   nglTexImage3D(
       target, level, internalformat, width, height, depth, border, format, type, pixelsOffset);
 }
Exemplo n.º 5
0
 /** DoubleBuffer version of: {@link #glTexImage3D TexImage3D} */
 public static void glTexImage3D(
     int target,
     int level,
     int internalformat,
     int width,
     int height,
     int depth,
     int border,
     int format,
     int type,
     DoubleBuffer pixels) {
   if (LWJGLUtil.CHECKS) GLChecks.ensureBufferObject(GL21.GL_PIXEL_UNPACK_BUFFER_BINDING, false);
   nglTexImage3D(
       target,
       level,
       internalformat,
       width,
       height,
       depth,
       border,
       format,
       type,
       memAddressSafe(pixels));
 }
Exemplo n.º 6
0
 /** GL_UNSIGNED_INT version of: {@link #glDrawRangeElements DrawRangeElements} */
 public static void glDrawRangeElements(int mode, int start, int end, IntBuffer indices) {
   if (LWJGLUtil.CHECKS) GLChecks.ensureBufferObject(GL15.GL_ELEMENT_ARRAY_BUFFER_BINDING, false);
   nglDrawRangeElements(
       mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices));
 }
Exemplo n.º 7
0
 /** Buffer object offset version of: {@link #glDrawRangeElements DrawRangeElements} */
 public static void glDrawRangeElements(
     int mode, int start, int end, int count, int type, long indicesOffset) {
   if (LWJGLUtil.CHECKS) GLChecks.ensureBufferObject(GL15.GL_ELEMENT_ARRAY_BUFFER_BINDING, true);
   nglDrawRangeElements(mode, start, end, count, type, indicesOffset);
 }