Top Description Constructors Methods
org.lwjgl.opengles

public Class NVDrawInstanced

extends Object
Class Inheritance
Imports
java.nio.*, org.lwjgl.system.*

Native bindings to the NV_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 limiting the number of required 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 GLES 2.0.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static native void
glDrawArraysInstancedNV(int mode, int first, int count, int primcount)

public static void
glDrawElementsInstancedNV(int mode, int count, int type, long indices, int primcount)

public static void
public static void
glDrawElementsInstancedNV(int mode, ByteBuffer indices, int primcount)

public static void
glDrawElementsInstancedNV(int mode, ShortBuffer indices, int primcount)

public static void
glDrawElementsInstancedNV(int mode, IntBuffer indices, int primcount)

public static native void
nglDrawElementsInstancedNV(int mode, int count, int type, long indices, int primcount)

Unsafe version of: DrawElementsInstancedNV

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NVDrawInstancedback to summary
protected NVDrawInstanced()

Method Detail

glDrawArraysInstancedNVback to summary
public static native void glDrawArraysInstancedNV(int mode, int first, int count, int primcount)
glDrawElementsInstancedNVback to summary
public static void glDrawElementsInstancedNV(int mode, int count, int type, long indices, int primcount)
Parameters
type:int

UNSIGNED_BYTE UNSIGNED_SHORT UNSIGNED_INT

glDrawElementsInstancedNVback to summary
public static void glDrawElementsInstancedNV(int mode, int type, ByteBuffer indices, int primcount)
Parameters
type:int

UNSIGNED_BYTE UNSIGNED_SHORT UNSIGNED_INT

glDrawElementsInstancedNVback to summary
public static void glDrawElementsInstancedNV(int mode, ByteBuffer indices, int primcount)
glDrawElementsInstancedNVback to summary
public static void glDrawElementsInstancedNV(int mode, ShortBuffer indices, int primcount)
glDrawElementsInstancedNVback to summary
public static void glDrawElementsInstancedNV(int mode, IntBuffer indices, int primcount)
nglDrawElementsInstancedNVback to summary
public static native void nglDrawElementsInstancedNV(int mode, int count, int type, long indices, int primcount)

Unsafe version of: DrawElementsInstancedNV

Parameters
type:int

UNSIGNED_BYTE UNSIGNED_SHORT UNSIGNED_INT