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 static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* Native bindings to the ARB_draw_instanced extension.
*
*
A common use case in GL for some applications is to be able to draw the same object, or groups of similar objects that share vertex data, primitive
* count and type, multiple times. This extension provides a means of accelerating such use cases while restricting the number of API calls, and keeping
* the amount of duplicate data to a minimum.
*
*
This extension introduces two draw calls which are conceptually equivalent to a series of draw calls. Each conceptual call in this series is considered
* an "instance" of the actual draw call.
*
*
This extension also introduces a read-only built-in variable to GLSL which contains the "instance ID." This variable initially contains 0, but increases
* by one after each conceptual draw call.
*
*
By using the instance ID or multiples thereof as an index into a uniform array containing transform data, vertex shaders can draw multiple instances of
* an object with a single draw call.
*/
public class ARBDrawInstanced {
static { GL.initialize(); }
protected ARBDrawInstanced() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(GLCapabilities caps) {
return checkFunctions(
caps.glDrawArraysInstancedARB, caps.glDrawElementsInstancedARB
);
}
// --- [ glDrawArraysInstancedARB ] ---
/**
* Draw multiple instances of a range of elements.
*
* @param mode the 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
*/
public static native void glDrawArraysInstancedARB(int mode, int first, int count, int primcount);
// --- [ glDrawElementsInstancedARB ] ---
/**
* Unsafe version of: {@link #glDrawElementsInstancedARB DrawElementsInstancedARB}
*
* @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 nglDrawElementsInstancedARB(int mode, int count, int type, long indices, int primcount);
/**
* Draws multiple instances of a set of elements.
*
* @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 specified range of indices to be rendered
*/
public static void glDrawElementsInstancedARB(int mode, int count, int type, long indices, int primcount) {
nglDrawElementsInstancedARB(mode, count, type, indices, primcount);
}
/**
* Draws multiple instances of a set of elements.
*
* @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 specified range of indices to be rendered
*/
public static void glDrawElementsInstancedARB(int mode, int type, ByteBuffer indices, int primcount) {
nglDrawElementsInstancedARB(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount);
}
/**
* Draws multiple instances of a set of elements.
*
* @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 specified range of indices to be rendered
*/
public static void glDrawElementsInstancedARB(int mode, ByteBuffer indices, int primcount) {
nglDrawElementsInstancedARB(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount);
}
/**
* Draws multiple instances of a set of elements.
*
* @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 specified range of indices to be rendered
*/
public static void glDrawElementsInstancedARB(int mode, ShortBuffer indices, int primcount) {
nglDrawElementsInstancedARB(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount);
}
/**
* Draws multiple instances of a set of elements.
*
* @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 specified range of indices to be rendered
*/
public static void glDrawElementsInstancedARB(int mode, IntBuffer indices, int primcount) {
nglDrawElementsInstancedARB(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount);
}
}