Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class ARBViewportArray

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

Native bindings to the ARB_viewport_array extension.

OpenGL is modeled on a pipeline of operations. The final stage in this pipeline before rasterization is the viewport transformation. This stage transforms vertices from view space into window coordinates and allows the application to specify a rectangular region of screen space into which OpenGL should draw primitives. Unextended OpenGL implementations provide a single viewport per context. In order to draw primitives into multiple viewports, the OpenGL viewport may be changed between several draw calls. With the advent of Geometry Shaders, it has become possible for an application to amplify geometry and produce multiple output primitives for each primitive input to the Geometry Shader. It is possible to direct these primitives to render into a selected render target. However, all render targets share the same, global OpenGL viewport.

This extension enhances OpenGL by providing a mechanism to expose multiple viewports. Each viewport is specified as a rectangle. The destination viewport may be selected per-primitive by the geometry shader. This allows the Geometry Shader to produce different versions of primitives destined for separate viewport rectangles on the same surface. Additionally, when combined with multiple framebuffer attachments, it allows a different viewport rectangle to be selected for each. This extension also exposes a separate scissor rectangle for each viewport. Finally, the viewport bounds are now floating point quantities allowing fractional pixel offsets to be applied during the viewport transform.

Requires OpenGL 3.2 or EXT_geometry_shader4 or ARB_geometry_shader4. Promoted to core in OpenGL 4.1.

Field Summary

Modifier and TypeField and Description
public static final int
GL_LAYER_PROVOKING_VERTEX

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_MAX_VIEWPORTS

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_UNDEFINED_VERTEX

Returned in the data parameter from a Get query with a pname of LAYER_PROVOKING_VERTEX or VIEWPORT_INDEX_PROVOKING_VERTEX.

public static final int
GL_VIEWPORT_BOUNDS_RANGE

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_VIEWPORT_INDEX_PROVOKING_VERTEX

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_VIEWPORT_SUBPIXEL_BITS

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
glDepthRangeArrayv(int
the index of the first viewport whose depth range to update
first
,
DoubleBuffer
n array containing the near and far values for the depth range of each modified viewport
v
)

Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports.

public static void
glDepthRangeArrayv(int first, double[] v)

Array version of: DepthRangeArrayv

public static void
glDepthRangeIndexed(int
the index of the viewport whose depth range to update
index
,
double
the mapping of the near clipping plane to window coordinates. The initial value is 0.
zNear
,
double
the mapping of the far clipping plane to window coordinates. The initial value is 1.
zFar
)

Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified viewport.

public static double
glGetDoublei(int
the indexed state to query
target
,
int
the index of the element being queried
index
)

Queries the double value of an indexed state variable.

public static void
glGetDoublei_v(int
the indexed state to query
target
,
int
the index of the element being queried
index
,
DoubleBuffer
a scalar or buffer in which to place the returned data
data
)

Queries the double value of an indexed state variable.

public static void
glGetDoublei_v(int target, int index, double[] data)

Array version of: GetDoublei_v

public static float
glGetFloati(int
the indexed state to query
target
,
int
the index of the element being queried
index
)

Queries the float value of an indexed state variable.

public static void
glGetFloati_v(int
the indexed state to query
target
,
int
the index of the element being queried
index
,
FloatBuffer
a scalar or buffer in which to place the returned data
data
)

Queries the float value of an indexed state variable.

public static void
glGetFloati_v(int target, int index, float[] data)

Array version of: GetFloati_v

public static void
glScissorArrayv(int
the index of the first viewport whose scissor box to modify
first
,
IntBuffer
an array containing the left, bottom, width and height of each scissor box, in that order
v
)

Defines the scissor box for multiple viewports.

public static void
glScissorArrayv(int first, int[] v)

Array version of: ScissorArrayv

public static void
glScissorIndexed(int
the index of the viewport whose scissor box to modify
index
,
int
the left scissor box coordinate
left
,
int
the bottom scissor box coordinate
bottom
,
int
the scissor box width
width
,
int
the scissor box height
height
)

Defines the scissor box for a specific viewport.

public static void
glScissorIndexedv(int
the index of the viewport whose scissor box to modify
index
,
IntBuffer
an array containing the left, bottom, width and height of each scissor box, in that order
v
)

Pointer version of ScissorIndexed.

public static void
glScissorIndexedv(int index, int[] v)

Array version of: ScissorIndexedv

public static void
glViewportArrayv(int
the first viewport to set
first
,
FloatBuffer
an array containing the viewport parameters
v
)

Sets multiple viewports.

public static void
glViewportArrayv(int first, float[] v)

Array version of: ViewportArrayv

public static void
glViewportIndexedf(int
the viewport to set
index
,
float
the left viewport coordinate
x
,
float
the bottom viewport coordinate
y
,
float
the viewport width
w
,
float
the viewport height
h
)

Sets a specified viewport.

public static void
glViewportIndexedfv(int
the viewport to set
index
,
FloatBuffer
the viewport parameters
v
)

Pointer version of ViewportIndexedf.

public static void
glViewportIndexedfv(int index, float[] v)

Array version of: ViewportIndexedfv

public static void
nglDepthRangeArrayv(int first, int
the number of viewports whose depth range to update
count
,
long v)

Unsafe version of: DepthRangeArrayv

public static void
nglGetDoublei_v(int target, int index, long data)

Unsafe version of: GetDoublei_v

public static void
nglGetFloati_v(int target, int index, long data)

Unsafe version of: GetFloati_v

public static void
nglScissorArrayv(int first, int
the number of scissor boxes to modify
count
,
long v)

Unsafe version of: ScissorArrayv

public static void
nglScissorIndexedv(int index, long v)

Unsafe version of: ScissorIndexedv

public static void
nglViewportArrayv(int first, int
the number of viewports to set
count
,
long v)

Unsafe version of: ViewportArrayv

public static void
nglViewportIndexedfv(int index, long v)

Unsafe version of: ViewportIndexedfv

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GL_LAYER_PROVOKING_VERTEXback to summary
public static final int GL_LAYER_PROVOKING_VERTEX

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

GL_MAX_VIEWPORTSback to summary
public static final int GL_MAX_VIEWPORTS

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

GL_UNDEFINED_VERTEXback to summary
public static final int GL_UNDEFINED_VERTEX

Returned in the data parameter from a Get query with a pname of LAYER_PROVOKING_VERTEX or VIEWPORT_INDEX_PROVOKING_VERTEX.

GL_VIEWPORT_BOUNDS_RANGEback to summary
public static final int GL_VIEWPORT_BOUNDS_RANGE

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

GL_VIEWPORT_INDEX_PROVOKING_VERTEXback to summary
public static final int GL_VIEWPORT_INDEX_PROVOKING_VERTEX

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

GL_VIEWPORT_SUBPIXEL_BITSback to summary
public static final int GL_VIEWPORT_SUBPIXEL_BITS

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

Constructor Detail

ARBViewportArrayback to summary
protected ARBViewportArray()

Method Detail

glDepthRangeArrayvback to summary
public static void glDepthRangeArrayv(int first, DoubleBuffer v)

Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports.

Parameters
first:int

the index of the first viewport whose depth range to update

v:DoubleBuffer

n array containing the near and far values for the depth range of each modified viewport

glDepthRangeArrayvback to summary
public static void glDepthRangeArrayv(int first, double[] v)

Array version of: DepthRangeArrayv

glDepthRangeIndexedback to summary
public static void glDepthRangeIndexed(int index, double zNear, double zFar)

Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified viewport.

Parameters
index:int

the index of the viewport whose depth range to update

zNear:double

the mapping of the near clipping plane to window coordinates. The initial value is 0.

zFar:double

the mapping of the far clipping plane to window coordinates. The initial value is 1.

glGetDoubleiback to summary
public static double glGetDoublei(int target, int index)

Queries the double value of an indexed state variable.

Parameters
target:int

the indexed state to query

index:int

the index of the element being queried

Annotations
@NativeType:void
glGetDoublei_vback to summary
public static void glGetDoublei_v(int target, int index, DoubleBuffer data)

Queries the double value of an indexed state variable.

Parameters
target:int

the indexed state to query

index:int

the index of the element being queried

data:DoubleBuffer

a scalar or buffer in which to place the returned data

glGetDoublei_vback to summary
public static void glGetDoublei_v(int target, int index, double[] data)

Array version of: GetDoublei_v

glGetFloatiback to summary
public static float glGetFloati(int target, int index)

Queries the float value of an indexed state variable.

Parameters
target:int

the indexed state to query

index:int

the index of the element being queried

Annotations
@NativeType:void
glGetFloati_vback to summary
public static void glGetFloati_v(int target, int index, FloatBuffer data)

Queries the float value of an indexed state variable.

Parameters
target:int

the indexed state to query

index:int

the index of the element being queried

data:FloatBuffer

a scalar or buffer in which to place the returned data

glGetFloati_vback to summary
public static void glGetFloati_v(int target, int index, float[] data)

Array version of: GetFloati_v

glScissorArrayvback to summary
public static void glScissorArrayv(int first, IntBuffer v)

Defines the scissor box for multiple viewports.

Parameters
first:int

the index of the first viewport whose scissor box to modify

v:IntBuffer

an array containing the left, bottom, width and height of each scissor box, in that order

glScissorArrayvback to summary
public static void glScissorArrayv(int first, int[] v)

Array version of: ScissorArrayv

glScissorIndexedback to summary
public static void glScissorIndexed(int index, int left, int bottom, int width, int height)

Defines the scissor box for a specific viewport.

Parameters
index:int

the index of the viewport whose scissor box to modify

left:int

the left scissor box coordinate

bottom:int

the bottom scissor box coordinate

width:int

the scissor box width

height:int

the scissor box height

glScissorIndexedvback to summary
public static void glScissorIndexedv(int index, IntBuffer v)

Pointer version of ScissorIndexed.

Parameters
index:int

the index of the viewport whose scissor box to modify

v:IntBuffer

an array containing the left, bottom, width and height of each scissor box, in that order

glScissorIndexedvback to summary
public static void glScissorIndexedv(int index, int[] v)

Array version of: ScissorIndexedv

glViewportArrayvback to summary
public static void glViewportArrayv(int first, FloatBuffer v)

Sets multiple viewports.

Parameters
first:int

the first viewport to set

v:FloatBuffer

an array containing the viewport parameters

glViewportArrayvback to summary
public static void glViewportArrayv(int first, float[] v)

Array version of: ViewportArrayv

glViewportIndexedfback to summary
public static void glViewportIndexedf(int index, float x, float y, float w, float h)

Sets a specified viewport.

Parameters
index:int

the viewport to set

x:float

the left viewport coordinate

y:float

the bottom viewport coordinate

w:float

the viewport width

h:float

the viewport height

glViewportIndexedfvback to summary
public static void glViewportIndexedfv(int index, FloatBuffer v)

Pointer version of ViewportIndexedf.

Parameters
index:int

the viewport to set

v:FloatBuffer

the viewport parameters

glViewportIndexedfvback to summary
public static void glViewportIndexedfv(int index, float[] v)

Array version of: ViewportIndexedfv

nglDepthRangeArrayvback to summary
public static void nglDepthRangeArrayv(int first, int count, long v)

Unsafe version of: DepthRangeArrayv

Parameters
count:int

the number of viewports whose depth range to update

nglGetDoublei_vback to summary
public static void nglGetDoublei_v(int target, int index, long data)

Unsafe version of: GetDoublei_v

nglGetFloati_vback to summary
public static void nglGetFloati_v(int target, int index, long data)

Unsafe version of: GetFloati_v

nglScissorArrayvback to summary
public static void nglScissorArrayv(int first, int count, long v)

Unsafe version of: ScissorArrayv

Parameters
count:int

the number of scissor boxes to modify

nglScissorIndexedvback to summary
public static void nglScissorIndexedv(int index, long v)

Unsafe version of: ScissorIndexedv

nglViewportArrayvback to summary
public static void nglViewportArrayv(int first, int count, long v)

Unsafe version of: ViewportArrayv

Parameters
count:int

the number of viewports to set

nglViewportIndexedfvback to summary
public static void nglViewportIndexedfv(int index, long v)

Unsafe version of: ViewportIndexedfv