All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.opengl.ARBDrawInstanced Maven / Gradle / Ivy

Go to download

The most widely adopted 2D and 3D graphics API in the industry, bringing thousands of applications to a wide variety of computer platforms.

There is a newer version: 3.3.4
Show newest version
/*
 * 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_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.

* *

Requires {@link GL30 OpenGL 3.0} or {@link EXTGPUShader4 EXT_gpu_shader4} or NV_vertex_program4. Promoted to core in {@link GL31 OpenGL 3.1}.

*/ 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:
{@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_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@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}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
* @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(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count, @NativeType("GLsizei") 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:
{@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_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@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}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
* @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(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") 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:
{@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_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@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}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
* @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(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") 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:
{@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_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@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}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
* @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(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") 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:
{@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_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@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}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
* @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(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") 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:
{@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_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@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}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
* @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(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount) { nglDrawElementsInstancedARB(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy