Class ARBViewportArray
- java.lang.Object
-
- org.lwjgl.opengl.ARBViewportArray
-
public class ARBViewportArray extends java.lang.Object
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 orARB_geometry_shader4
. Promoted to core inOpenGL 4.1
.
-
-
Field Summary
Fields Modifier and Type Field and Description static int
GL_LAYER_PROVOKING_VERTEX
GL_MAX_VIEWPORTSAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.static int
GL_UNDEFINED_VERTEX
Returned in thedata
parameter from a Get query with apname
of LAYER_PROVOKING_VERTEX or VIEWPORT_INDEX_PROVOKING_VERTEX.static int
GL_VIEWPORT_BOUNDS_RANGE
GL_VIEWPORT_INDEX_PROVOKING_VERTEX
GL_VIEWPORT_SUBPIXEL_BITSAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
glDepthRangeArrayv(int first, double[] v)
Array version of:DepthRangeArrayv
static void
glDepthRangeArrayv(int first, java.nio.DoubleBuffer v)
Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports.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.static void
glGetDoublei_v(int target, int index, double[] data)
Array version of:GetDoublei_v
static void
glGetDoublei_v(int target, int index, java.nio.DoubleBuffer data)
Queries the double value of an indexed state variable.static double
glGetDoublei(int target, int index)
Queries the double value of an indexed state variable.static void
glGetFloati_v(int target, int index, float[] data)
Array version of:GetFloati_v
static void
glGetFloati_v(int target, int index, java.nio.FloatBuffer data)
Queries the float value of an indexed state variable.static float
glGetFloati(int target, int index)
Queries the float value of an indexed state variable.static void
glScissorArrayv(int first, int[] v)
Array version of:ScissorArrayv
static void
glScissorArrayv(int first, java.nio.IntBuffer v)
Defines the scissor box for multiple viewports.static void
glScissorIndexed(int index, int left, int bottom, int width, int height)
Defines the scissor box for a specific viewport.static void
glScissorIndexedv(int index, int[] v)
Array version of:ScissorIndexedv
static void
glScissorIndexedv(int index, java.nio.IntBuffer v)
Pointer version ofScissorIndexed
.static void
glViewportArrayv(int first, float[] v)
Array version of:ViewportArrayv
static void
glViewportArrayv(int first, java.nio.FloatBuffer v)
Sets multiple viewports.static void
glViewportIndexedf(int index, float x, float y, float w, float h)
Sets a specified viewport.static void
glViewportIndexedfv(int index, float[] v)
Array version of:ViewportIndexedfv
static void
glViewportIndexedfv(int index, java.nio.FloatBuffer v)
Pointer version ofViewportIndexedf
.
-
-
-
Field Detail
-
GL_MAX_VIEWPORTS, GL_VIEWPORT_SUBPIXEL_BITS, GL_VIEWPORT_BOUNDS_RANGE, GL_LAYER_PROVOKING_VERTEX, GL_VIEWPORT_INDEX_PROVOKING_VERTEX
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.
-
GL_UNDEFINED_VERTEX
Returned in thedata
parameter from a Get query with apname
of LAYER_PROVOKING_VERTEX or VIEWPORT_INDEX_PROVOKING_VERTEX.
-
-
Method Detail
-
glViewportArrayv
public static void glViewportArrayv(int first, java.nio.FloatBuffer v)
Sets multiple viewports.- Parameters:
first
- the first viewport to setv
- an array containing the viewport parameters
-
glViewportIndexedf
public static void glViewportIndexedf(int index, float x, float y, float w, float h)
Sets a specified viewport.- Parameters:
index
- the viewport to setx
- the left viewport coordinatey
- the bottom viewport coordinatew
- the viewport widthh
- the viewport height
-
glViewportIndexedfv
public static void glViewportIndexedfv(int index, java.nio.FloatBuffer v)
Pointer version ofViewportIndexedf
.- Parameters:
index
- the viewport to setv
- the viewport parameters
-
glScissorArrayv
public static void glScissorArrayv(int first, java.nio.IntBuffer v)
Defines the scissor box for multiple viewports.- Parameters:
first
- the index of the first viewport whose scissor box to modifyv
- an array containing the left, bottom, width and height of each scissor box, in that order
-
glScissorIndexed
public static void glScissorIndexed(int index, int left, int bottom, int width, int height)
Defines the scissor box for a specific viewport.- Parameters:
index
- the index of the viewport whose scissor box to modifyleft
- the left scissor box coordinatebottom
- the bottom scissor box coordinatewidth
- the scissor box widthheight
- the scissor box height
-
glScissorIndexedv
public static void glScissorIndexedv(int index, java.nio.IntBuffer v)
Pointer version ofScissorIndexed
.- Parameters:
index
- the index of the viewport whose scissor box to modifyv
- an array containing the left, bottom, width and height of each scissor box, in that order
-
glDepthRangeArrayv
public static void glDepthRangeArrayv(int first, java.nio.DoubleBuffer v)
Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports.- Parameters:
first
- the index of the first viewport whose depth range to updatev
- n array containing the near and far values for the depth range of each modified viewport
-
glDepthRangeIndexed
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
- the index of the viewport whose depth range to updatezNear
- the mapping of the near clipping plane to window coordinates. The initial value is 0.zFar
- the mapping of the far clipping plane to window coordinates. The initial value is 1.
-
glGetFloati_v
public static void glGetFloati_v(int target, int index, java.nio.FloatBuffer data)
Queries the float value of an indexed state variable.- Parameters:
target
- the indexed state to queryindex
- the index of the element being querieddata
- a scalar or buffer in which to place the returned data
-
glGetFloati
public static float glGetFloati(int target, int index)
Queries the float value of an indexed state variable.- Parameters:
target
- the indexed state to queryindex
- the index of the element being queried
-
glGetDoublei_v
public static void glGetDoublei_v(int target, int index, java.nio.DoubleBuffer data)
Queries the double value of an indexed state variable.- Parameters:
target
- the indexed state to queryindex
- the index of the element being querieddata
- a scalar or buffer in which to place the returned data
-
glGetDoublei
public static double glGetDoublei(int target, int index)
Queries the double value of an indexed state variable.- Parameters:
target
- the indexed state to queryindex
- the index of the element being queried
-
glViewportArrayv
public static void glViewportArrayv(int first, float[] v)
Array version of:ViewportArrayv
-
glViewportIndexedfv
public static void glViewportIndexedfv(int index, float[] v)
Array version of:ViewportIndexedfv
-
glScissorArrayv
public static void glScissorArrayv(int first, int[] v)
Array version of:ScissorArrayv
-
glScissorIndexedv
public static void glScissorIndexedv(int index, int[] v)
Array version of:ScissorIndexedv
-
glDepthRangeArrayv
public static void glDepthRangeArrayv(int first, double[] v)
Array version of:DepthRangeArrayv
-
glGetFloati_v
public static void glGetFloati_v(int target, int index, float[] data)
Array version of:GetFloati_v
-
glGetDoublei_v
public static void glGetDoublei_v(int target, int index, double[] data)
Array version of:GetDoublei_v
-
-