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.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* Native bindings to the ARB_base_instance extension.
*
*
This extension allows the offset within buffer objects used for instanced rendering to be specified. This is congruent with the {@code first} parameter
* in {@link GL11#glDrawArrays DrawArrays} and the {@code basevertex} parameter in {@link GL11#glDrawElements DrawElements}. When instanced rendering is performed (for example, through
* {@link GL31#glDrawArraysInstanced DrawArraysInstanced}), instanced vertex attributes whose vertex attribute divisors are non-zero are fetched from enabled vertex arrays
* per-instance rather than per-vertex. However, in unextended OpenGL, there is no way to define the offset into those arrays from which the attributes are
* fetched. This extension adds that offset in the form of a {@code } parameter to several new procedures.
*
*
The {@code baseinstance} parameter is added to the index of the array element, after division by the vertex attribute divisor. This allows several sets
* of instanced vertex attribute data to be stored in a single vertex array, and the base offset of that data to be specified for each draw. Further, this
* extension exposes the {@code } parameter as the final and previously undefined structure member of the draw-indirect data structure.
*
*
Requires {@link GL31 OpenGL 3.1} or {@link ARBDrawInstanced ARB_draw_instanced}. Promoted to core in {@link GL42 OpenGL 4.2}.
*/
public class ARBBaseInstance {
static { GL.initialize(); }
protected ARBBaseInstance() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(GLCapabilities caps) {
return checkFunctions(
caps.glDrawArraysInstancedBaseInstance, caps.glDrawElementsInstancedBaseInstance, caps.glDrawElementsInstancedBaseVertexBaseInstance
);
}
// --- [ glDrawArraysInstancedBaseInstance ] ---
/**
* Draws multiple instances of a range of elements with an offset applied to instanced attributes.
*
* @param mode what kind of primitives to render. One of:
* @param first the starting index in the enabled arrays
* @param count the number of indices to be rendered
* @param primcount the number of instances of the specified range of indices to be rendered
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static native void glDrawArraysInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance);
// --- [ glDrawElementsInstancedBaseInstance ] ---
/**
* Unsafe version of: {@link #glDrawElementsInstancedBaseInstance DrawElementsInstancedBaseInstance}
*
* @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 nglDrawElementsInstancedBaseInstance(int mode, int count, int type, long indices, int primcount, int baseinstance);
/**
* Draws multiple instances of a set of elements with an offset applied to instanced attributes
*
* @param mode what 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 specified range of indices to be rendered
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("const void *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseInstance(mode, count, type, indices, primcount, baseinstance);
}
/**
* Draws multiple instances of a set of elements with an offset applied to instanced attributes
*
* @param mode what 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 specified range of indices to be rendered
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("const void *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseInstance(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount, baseinstance);
}
/**
* Draws multiple instances of a set of elements with an offset applied to instanced attributes
*
* @param mode what 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 specified range of indices to be rendered
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("const void *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount, baseinstance);
}
/**
* Draws multiple instances of a set of elements with an offset applied to instanced attributes
*
* @param mode what 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 specified range of indices to be rendered
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("const void *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount, baseinstance);
}
/**
* Draws multiple instances of a set of elements with an offset applied to instanced attributes
*
* @param mode what 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 specified range of indices to be rendered
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("const void *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount, baseinstance);
}
// --- [ glDrawElementsInstancedBaseVertexBaseInstance ] ---
/**
* Unsafe version of: {@link #glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}
*
* @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 nglDrawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, long indices, int primcount, int basevertex, int baseinstance);
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode what 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 {@code indices} when choosing elements from the enabled vertex arrays
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseVertexBaseInstance(@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, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseVertexBaseInstance(mode, count, type, indices, primcount, basevertex, baseinstance);
}
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode what 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 {@code indices} when choosing elements from the enabled vertex arrays
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("const void *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseVertexBaseInstance(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount, basevertex, baseinstance);
}
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode what 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 {@code indices} when choosing elements from the enabled vertex arrays
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("const void *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseVertexBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount, basevertex, baseinstance);
}
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode what 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 {@code indices} when choosing elements from the enabled vertex arrays
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("const void *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseVertexBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount, basevertex, baseinstance);
}
/**
* Renders multiple instances of a set of primitives from array data with a per-element offset.
*
* @param mode what 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 {@code indices} when choosing elements from the enabled vertex arrays
* @param baseinstance the base instance for use in fetching instanced vertex attributes
*/
public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("const void *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) {
nglDrawElementsInstancedBaseVertexBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount, basevertex, baseinstance);
}
}