Beispiel #1
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));
 }
Beispiel #2
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));
 }
Beispiel #3
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));
 }
 public static void glGetCompressedTexImageARB(int target, int lod, long pImg_buffer_offset) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glGetCompressedTexImageARB;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensurePackPBOenabled(caps);
   nglGetCompressedTexImageARBBO(target, lod, pImg_buffer_offset, function_pointer);
 }
 public static void glCompressedTexSubImage3DARB(
     int target,
     int level,
     int xoffset,
     int yoffset,
     int zoffset,
     int width,
     int height,
     int depth,
     int format,
     int pData_imageSize,
     long pData_buffer_offset) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glCompressedTexSubImage3DARB;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureUnpackPBOenabled(caps);
   nglCompressedTexSubImage3DARBBO(
       target,
       level,
       xoffset,
       yoffset,
       zoffset,
       width,
       height,
       depth,
       format,
       pData_imageSize,
       pData_buffer_offset,
       function_pointer);
 }
 public static void glCompressedTexSubImage3DARB(
     int target,
     int level,
     int xoffset,
     int yoffset,
     int zoffset,
     int width,
     int height,
     int depth,
     int format,
     ByteBuffer pData) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glCompressedTexSubImage3DARB;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureUnpackPBOdisabled(caps);
   BufferChecks.checkDirect(pData);
   nglCompressedTexSubImage3DARB(
       target,
       level,
       xoffset,
       yoffset,
       zoffset,
       width,
       height,
       depth,
       format,
       pData.remaining(),
       MemoryUtil.getAddress(pData),
       function_pointer);
 }
 /** Alternative version of: {@link #wglGetGPUInfoAMD GetGPUInfoAMD} */
 public static int wglGetGPUInfoAMD(int id, int property, int dataType, ByteBuffer data) {
   return nwglGetGPUInfoAMD(
       id,
       property,
       dataType,
       data.remaining() * GLChecks.typeToBytes(dataType),
       memAddress(data));
 }
 public static void glVertexAttribIPointerEXT(
     int index, int size, int type, int stride, long buffer_buffer_offset) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glVertexAttribIPointerEXT;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureArrayVBOenabled(caps);
   nglVertexAttribIPointerEXTBO(index, size, type, stride, buffer_buffer_offset, function_pointer);
 }
 public static void glGetCompressedTexImageARB(int target, int lod, ByteBuffer pImg) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glGetCompressedTexImageARB;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensurePackPBOdisabled(caps);
   BufferChecks.checkDirect(pImg);
   nglGetCompressedTexImageARB(target, lod, MemoryUtil.getAddress(pImg), function_pointer);
 }
Beispiel #10
0
 public static void glWeightPointerARB(
     int size, int type, int stride, long pPointer_buffer_offset) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glWeightPointerARB;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureArrayVBOenabled(caps);
   nglWeightPointerARBBO(size, type, stride, pPointer_buffer_offset, function_pointer);
 }
 public static void glColorSubTableEXT(
     int target, int start, int count, int format, int type, ByteBuffer data) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glColorSubTableEXT;
   BufferChecks.checkFunctionAddress(function_pointer);
   BufferChecks.checkBuffer(data, GLChecks.calculateImageStorage(data, format, type, count, 1, 1));
   nglColorSubTableEXT(
       target, start, count, format, type, MemoryUtil.getAddress(data), function_pointer);
 }
 public static void glColorTableEXT(
     int target, int internalFormat, int width, int format, int type, ShortBuffer data) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glColorTableEXT;
   BufferChecks.checkFunctionAddress(function_pointer);
   BufferChecks.checkBuffer(data, GLChecks.calculateImageStorage(data, format, type, width, 1, 1));
   nglColorTableEXT(
       target, internalFormat, width, format, type, MemoryUtil.getAddress(data), function_pointer);
 }
 public static void glDrawElementsBaseVertex(
     int mode, int count, int type, long indices_buffer_offset, int basevertex) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.ARB_draw_elements_base_vertex_glDrawElementsBaseVertex_pointer;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureElementVBOenabled(caps);
   nglDrawElementsBaseVertexBO(
       mode, count, type, indices_buffer_offset, basevertex, function_pointer);
 }
Beispiel #14
0
 public static void glWeightPointerARB(int size, int stride, FloatBuffer pPointer) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glWeightPointerARB;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureArrayVBOdisabled(caps);
   BufferChecks.checkDirect(pPointer);
   if (LWJGLUtil.CHECKS)
     StateTracker.getReferences(caps).ARB_vertex_blend_glWeightPointerARB_pPointer = pPointer;
   nglWeightPointerARB(
       size, GL11.GL_FLOAT, stride, MemoryUtil.getAddress(pPointer), function_pointer);
 }
 public static void glVertexAttribIPointerEXT(
     int index, int size, int type, int stride, ShortBuffer buffer) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glVertexAttribIPointerEXT;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureArrayVBOdisabled(caps);
   BufferChecks.checkDirect(buffer);
   if (LWJGLUtil.CHECKS)
     StateTracker.getReferences(caps).EXT_gpu_shader4_glVertexAttribIPointerEXT_buffer = buffer;
   nglVertexAttribIPointerEXT(
       index, size, type, stride, buffer, buffer.position() << 1, function_pointer);
 }
 public static void glDrawElementsBaseVertex(int mode, ShortBuffer indices, int basevertex) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.ARB_draw_elements_base_vertex_glDrawElementsBaseVertex_pointer;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureElementVBOdisabled(caps);
   BufferChecks.checkDirect(indices);
   nglDrawElementsBaseVertex(
       mode,
       (indices.remaining()),
       GL11.GL_UNSIGNED_SHORT,
       indices,
       indices.position() << 1,
       basevertex,
       function_pointer);
 }
Beispiel #17
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);
 }
Beispiel #18
0
 public static void glDrawElementsInstancedBaseInstance(
     int mode, ShortBuffer indices, int primcount, int baseinstance) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glDrawElementsInstancedBaseInstance;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureElementVBOdisabled(caps);
   BufferChecks.checkDirect(indices);
   nglDrawElementsInstancedBaseInstance(
       mode,
       indices.remaining(),
       GL11.GL_UNSIGNED_SHORT,
       MemoryUtil.getAddress(indices),
       primcount,
       baseinstance,
       function_pointer);
 }
 public static void glCompressedTexImage1DARB(
     int target, int level, int internalformat, int width, int border, ByteBuffer pData) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glCompressedTexImage1DARB;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureUnpackPBOdisabled(caps);
   BufferChecks.checkDirect(pData);
   nglCompressedTexImage1DARB(
       target,
       level,
       internalformat,
       width,
       border,
       pData.remaining(),
       MemoryUtil.getAddress(pData),
       function_pointer);
 }
Beispiel #20
0
 public static void glDrawElementsInstancedBaseInstance(
     int mode,
     int indices_count,
     int type,
     long indices_buffer_offset,
     int primcount,
     int baseinstance) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glDrawElementsInstancedBaseInstance;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureElementVBOenabled(caps);
   nglDrawElementsInstancedBaseInstanceBO(
       mode,
       indices_count,
       type,
       indices_buffer_offset,
       primcount,
       baseinstance,
       function_pointer);
 }
 public static void glCompressedTexImage1DARB(
     int target,
     int level,
     int internalformat,
     int width,
     int border,
     int pData_imageSize,
     long pData_buffer_offset) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glCompressedTexImage1DARB;
   BufferChecks.checkFunctionAddress(function_pointer);
   GLChecks.ensureUnpackPBOenabled(caps);
   nglCompressedTexImage1DARBBO(
       target,
       level,
       internalformat,
       width,
       border,
       pData_imageSize,
       pData_buffer_offset,
       function_pointer);
 }
Beispiel #22
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));
 }
Beispiel #23
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));
 }
Beispiel #24
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);
 }
 /**
  * Each GPU in a system may have different properties, performance characteristics and different
  * supported OpenGL versions. Use this function to determine which GPU is best suited for a
  * specific task.
  *
  * <p>For a string, {@code size} will be the number of characters allocated and will include NULL
  * termination. For arrays of type GL_UNSIGNED_INT, GL_INT, and GL_FLOAT {@code size} will be the
  * array depth. If the function succeeds, the number of values written will be returned. If the
  * number of values written is equal to {@code size}, the query should be repeated with a larger
  * {@code data} buffer. Strings should be queried using the GL_UNSIGNED_BYTE type, are UTF-8
  * encoded and will be NULL terminated. If the function fails, -1 will be returned.
  *
  * @param id a GPU id obtained from calling {@link #wglGetGPUIDsAMD GetGPUIDsAMD}
  * @param property the information being queried. One of:<br>
  *     {@link #WGL_GPU_VENDOR_AMD GPU_VENDOR_AMD}, {@link #WGL_GPU_RENDERER_STRING_AMD
  *     GPU_RENDERER_STRING_AMD}, {@link #WGL_GPU_OPENGL_VERSION_STRING_AMD
  *     GPU_OPENGL_VERSION_STRING_AMD}, {@link #WGL_GPU_FASTEST_TARGET_GPUS_AMD
  *     GPU_FASTEST_TARGET_GPUS_AMD}, {@link #WGL_GPU_RAM_AMD GPU_RAM_AMD}, {@link
  *     #WGL_GPU_CLOCK_AMD GPU_CLOCK_AMD}, {@link #WGL_GPU_NUM_PIPES_AMD GPU_NUM_PIPES_AMD}, {@link
  *     #WGL_GPU_NUM_SIMD_AMD GPU_NUM_SIMD_AMD}, {@link #WGL_GPU_NUM_RB_AMD GPU_NUM_RB_AMD}, {@link
  *     #WGL_GPU_NUM_SPI_AMD GPU_NUM_SPI_AMD}
  * @param dataType the data type to be returned. One of:<br>
  *     {@link GL11#GL_UNSIGNED_INT}, {@link GL11#GL_INT}, {@link GL11#GL_FLOAT}, {@link
  *     GL11#GL_UNSIGNED_BYTE}
  * @param size the size of the {@code data} buffer
  * @param data the buffer which will be filled with the requested information
  */
 public static int wglGetGPUInfoAMD(
     int id, int property, int dataType, int size, ByteBuffer data) {
   if (LWJGLUtil.CHECKS) checkBuffer(data, size / GLChecks.typeToBytes(dataType));
   return nwglGetGPUInfoAMD(id, property, dataType, size, memAddress(data));
 }