Class ARBViewportArray
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
FieldsModifier and TypeFieldDescriptionstatic final intAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.static final intAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.static final intReturned in thedataparameter from a Get query with apnameof LAYER_PROVOKING_VERTEX or VIEWPORT_INDEX_PROVOKING_VERTEX.static final intAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.static final intAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.static final intAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidglDepthRangeArrayv(int first, double[] v) Array version of:DepthRangeArrayvstatic voidglDepthRangeArrayv(int first, DoubleBuffer v) Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports.static voidglDepthRangeIndexed(int index, double zNear, double zFar) Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified viewport.static doubleglGetDoublei(int target, int index) Queries the double value of an indexed state variable.static voidglGetDoublei_v(int target, int index, double[] data) Array version of:GetDoublei_vstatic voidglGetDoublei_v(int target, int index, DoubleBuffer data) Queries the double value of an indexed state variable.static floatglGetFloati(int target, int index) Queries the float value of an indexed state variable.static voidglGetFloati_v(int target, int index, float[] data) Array version of:GetFloati_vstatic voidglGetFloati_v(int target, int index, FloatBuffer data) Queries the float value of an indexed state variable.static voidglScissorArrayv(int first, int[] v) Array version of:ScissorArrayvstatic voidglScissorArrayv(int first, IntBuffer v) Defines the scissor box for multiple viewports.static voidglScissorIndexed(int index, int left, int bottom, int width, int height) Defines the scissor box for a specific viewport.static voidglScissorIndexedv(int index, int[] v) Array version of:ScissorIndexedvstatic voidglScissorIndexedv(int index, IntBuffer v) Pointer version ofScissorIndexed.static voidglViewportArrayv(int first, float[] v) Array version of:ViewportArrayvstatic voidglViewportArrayv(int first, FloatBuffer v) Sets multiple viewports.static voidglViewportIndexedf(int index, float x, float y, float w, float h) Sets a specified viewport.static voidglViewportIndexedfv(int index, float[] v) Array version of:ViewportIndexedfvstatic voidglViewportIndexedfv(int index, FloatBuffer v) Pointer version ofViewportIndexedf.static voidnglDepthRangeArrayv(int first, int count, long v) Unsafe version of:DepthRangeArrayvstatic voidnglGetDoublei_v(int target, int index, long data) Unsafe version of:GetDoublei_vstatic voidnglGetFloati_v(int target, int index, long data) Unsafe version of:GetFloati_vstatic voidnglScissorArrayv(int first, int count, long v) Unsafe version of:ScissorArrayvstatic voidnglScissorIndexedv(int index, long v) Unsafe version of:ScissorIndexedvstatic voidnglViewportArrayv(int first, int count, long v) Unsafe version of:ViewportArrayvstatic voidnglViewportIndexedfv(int index, long v) Unsafe version of:ViewportIndexedfv
-
Field Details
-
GL_MAX_VIEWPORTS
public static final int GL_MAX_VIEWPORTSAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.- See Also:
-
GL_VIEWPORT_SUBPIXEL_BITS
public static final int GL_VIEWPORT_SUBPIXEL_BITSAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.- See Also:
-
GL_VIEWPORT_BOUNDS_RANGE
public static final int GL_VIEWPORT_BOUNDS_RANGEAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.- See Also:
-
GL_LAYER_PROVOKING_VERTEX
public static final int GL_LAYER_PROVOKING_VERTEXAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.- See Also:
-
GL_VIEWPORT_INDEX_PROVOKING_VERTEX
public static final int GL_VIEWPORT_INDEX_PROVOKING_VERTEXAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.- See Also:
-
GL_UNDEFINED_VERTEX
public static final int GL_UNDEFINED_VERTEXReturned in thedataparameter from a Get query with apnameof LAYER_PROVOKING_VERTEX or VIEWPORT_INDEX_PROVOKING_VERTEX.- See Also:
-
-
Method Details
-
nglViewportArrayv
public static void nglViewportArrayv(int first, int count, long v) Unsafe version of:ViewportArrayv- Parameters:
count- the number of viewports to set
-
glViewportArrayv
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
-
nglViewportIndexedfv
public static void nglViewportIndexedfv(int index, long v) Unsafe version of:ViewportIndexedfv -
glViewportIndexedfv
Pointer version ofViewportIndexedf.- Parameters:
index- the viewport to setv- the viewport parameters
-
nglScissorArrayv
public static void nglScissorArrayv(int first, int count, long v) Unsafe version of:ScissorArrayv- Parameters:
count- the number of scissor boxes to modify
-
glScissorArrayv
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
-
nglScissorIndexedv
public static void nglScissorIndexedv(int index, long v) Unsafe version of:ScissorIndexedv -
glScissorIndexedv
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
-
nglDepthRangeArrayv
public static void nglDepthRangeArrayv(int first, int count, long v) Unsafe version of:DepthRangeArrayv- Parameters:
count- the number of viewports whose depth range to update
-
glDepthRangeArrayv
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.
-
nglGetFloati_v
public static void nglGetFloati_v(int target, int index, long data) Unsafe version of:GetFloati_v -
glGetFloati_v
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
-
nglGetDoublei_v
public static void nglGetDoublei_v(int target, int index, long data) Unsafe version of:GetDoublei_v -
glGetDoublei_v
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
-