Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.opengl;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* Native bindings to the ARB_draw_elements_base_vertex extension.
*
*
This extension provides a method to specify a "base vertex offset" value which is effectively added to every vertex index that is transferred through
* {@link GL11#glDrawElements DrawElements}.
*
*
This mechanism can be used to decouple a set of indices from the actual vertex array that it is referencing. This is useful if an application stores
* multiple indexed models in a single vertex array. The same index array can be used to draw the model no matter where it ends up in a larger vertex array
* simply by changing the base vertex value. Without this functionality, it would be necessary to rebind all the vertex attributes every time geometry is
* switched and this can have larger performance penalty.
*
*
For example consider the (very contrived and simple) example of drawing two triangles to form a quad. In the typical example you have the following
* setup:
Now consider the case where the vertices you want to draw are not at the start of a vertex array but are instead located at offset 100 into a larger
* array:
The typical choices for rendering this are to rebind your vertex attributes with an additional offset of 100*stride, or to create an new array of
* indices (as indices2 in the example). However both rebinding vertex attributes and rebuilding index arrays can be quite costly activities.
*
*
With the new drawing commands introduced by this extension you can instead draw using vertices2 and the new draw call:
*/
public class ARBDrawElementsBaseVertex {
static { GL.initialize(); }
protected ARBDrawElementsBaseVertex() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(GLCapabilities caps) {
return checkFunctions(
caps.glDrawElementsBaseVertex, caps.glDrawRangeElementsBaseVertex, caps.glDrawElementsInstancedBaseVertex, caps.glMultiDrawElementsBaseVertex
);
}
// --- [ glDrawElementsBaseVertex ] ---
/**
* Unsafe version of: {@link #glDrawElementsBaseVertex DrawElementsBaseVertex}
*
* @param count the number of elements to be rendered
* @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}
{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
*/
public static native void nglDrawElementsBaseVertex(int mode, int count, int type, long indices, int basevertex);
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param count the number of elements to be rendered
* @param type the type of the values in {@code indices}. One of:
{@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
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("const void *") long indices, @NativeType("GLint") int basevertex) {
nglDrawElementsBaseVertex(mode, count, type, indices, basevertex);
}
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param type the type of the values in {@code indices}. One of:
{@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
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("const void *") ByteBuffer indices, @NativeType("GLint") int basevertex) {
nglDrawElementsBaseVertex(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), basevertex);
}
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param indices a pointer to the location where the indices are stored
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("const void *") ByteBuffer indices, @NativeType("GLint") int basevertex) {
nglDrawElementsBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), basevertex);
}
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param indices a pointer to the location where the indices are stored
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("const void *") ShortBuffer indices, @NativeType("GLint") int basevertex) {
nglDrawElementsBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), basevertex);
}
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param indices a pointer to the location where the indices are stored
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("const void *") IntBuffer indices, @NativeType("GLint") int basevertex) {
nglDrawElementsBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), basevertex);
}
// --- [ glDrawRangeElementsBaseVertex ] ---
/**
* Unsafe version of: {@link #glDrawRangeElementsBaseVertex DrawRangeElementsBaseVertex}
*
* @param count the number of elements to be rendered
* @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}
{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
*/
public static native void nglDrawRangeElementsBaseVertex(int mode, int start, int end, int count, int type, long indices, int basevertex);
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @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:
{@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
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("const void *") long indices, @NativeType("GLint") int basevertex) {
nglDrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex);
}
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param start the minimum array index contained in {@code indices}
* @param end the maximum array index contained in {@code indices}
* @param type the type of the values in {@code indices}. One of:
{@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
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLenum") int type, @NativeType("const void *") ByteBuffer indices, @NativeType("GLint") int basevertex) {
nglDrawRangeElementsBaseVertex(mode, start, end, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), basevertex);
}
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param start the minimum array index contained in {@code indices}
* @param end the maximum array index contained in {@code indices}
* @param indices a pointer to the location where the indices are stored
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("const void *") ByteBuffer indices, @NativeType("GLint") int basevertex) {
nglDrawRangeElementsBaseVertex(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), basevertex);
}
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param start the minimum array index contained in {@code indices}
* @param end the maximum array index contained in {@code indices}
* @param indices a pointer to the location where the indices are stored
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("const void *") ShortBuffer indices, @NativeType("GLint") int basevertex) {
nglDrawRangeElementsBaseVertex(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), basevertex);
}
/**
* Renders primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param start the minimum array index contained in {@code indices}
* @param end the maximum array index contained in {@code indices}
* @param indices a pointer to the location where the indices are stored
* @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays
*/
public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("const void *") IntBuffer indices, @NativeType("GLint") int basevertex) {
nglDrawRangeElementsBaseVertex(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), basevertex);
}
// --- [ glDrawElementsInstancedBaseVertex ] ---
/**
* Unsafe version of: {@link #glDrawElementsInstancedBaseVertex DrawElementsInstancedBaseVertex}
*
* @param count the number of elements to be rendered
* @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}
{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
*/
public static native void nglDrawElementsInstancedBaseVertex(int mode, int count, int type, long indices, int primcount, int basevertex);
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param count the number of elements to be rendered
* @param type the type of the values in {@code indices}. One of:
{@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
* @param primcount the number of instances of the indexed geometry that should be drawn
* @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays
*/
public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("const void *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) {
nglDrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex);
}
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param type the type of the values in {@code indices}. One of:
{@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
* @param primcount the number of instances of the indexed geometry that should be drawn
* @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays
*/
public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("const void *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) {
nglDrawElementsInstancedBaseVertex(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount, basevertex);
}
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param indices a pointer to the location where the indices are stored
* @param primcount the number of instances of the indexed geometry that should be drawn
* @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays
*/
public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("const void *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) {
nglDrawElementsInstancedBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount, basevertex);
}
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param indices a pointer to the location where the indices are stored
* @param primcount the number of instances of the indexed geometry that should be drawn
* @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays
*/
public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("const void *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) {
nglDrawElementsInstancedBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount, basevertex);
}
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode the kind of primitives to render. One of:
* @param indices a pointer to the location where the indices are stored
* @param primcount the number of instances of the indexed geometry that should be drawn
* @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays
*/
public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("const void *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) {
nglDrawElementsInstancedBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount, basevertex);
}
// --- [ glMultiDrawElementsBaseVertex ] ---
/**
* Unsafe version of: {@link #glMultiDrawElementsBaseVertex MultiDrawElementsBaseVertex}
*
* @param primcount the size of the {@code count} array
*/
public static native void nglMultiDrawElementsBaseVertex(int mode, long count, int type, long indices, int primcount, long basevertex);
/**
* Renders multiple sets of primitives by specifying indices of array data elements and an offset to apply to each index.
*
*
LWJGL note: Use {@link org.lwjgl.system.MemoryUtil#memAddress} to retrieve pointers to the index buffers.
*
* @param mode the kind of primitives to render. One of:
* @param count an array of the elements counts
* @param type the type of the values in {@code indices}. One of:
{@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
* @param basevertex a pointer to the location where the base vertices are stored
*/
public static void glMultiDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("const GLsizei *") IntBuffer count, @NativeType("GLenum") int type, @NativeType("const void **") PointerBuffer indices, @NativeType("GLint *") IntBuffer basevertex) {
if (CHECKS) {
check(indices, count.remaining());
check(basevertex, count.remaining());
}
nglMultiDrawElementsBaseVertex(mode, memAddress(count), type, memAddress(indices), count.remaining(), memAddress(basevertex));
}
/** Array version of: {@link #glMultiDrawElementsBaseVertex MultiDrawElementsBaseVertex} */
public static void glMultiDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("const GLsizei *") int[] count, @NativeType("GLenum") int type, @NativeType("const void **") PointerBuffer indices, @NativeType("GLint *") int[] basevertex) {
long __functionAddress = GL.getICD().glMultiDrawElementsBaseVertex;
if (CHECKS) {
check(__functionAddress);
check(indices, count.length);
check(basevertex, count.length);
}
callPPPV(__functionAddress, mode, count, type, memAddress(indices), count.length, basevertex);
}
}