diff --git a/es1/glActiveTexture.xml b/es1/glActiveTexture.xml new file mode 100644 index 00000000..32bfc3ba --- /dev/null +++ b/es1/glActiveTexture.xml @@ -0,0 +1,66 @@ + + + +
glActiveTexture — select server-side active texture unit
void glActiveTexture( | GLenum texture) ; |
texture
+
+ Specifies which texture unit to make active. The
+ number of texture units is implementation dependent, but
+ must be at least two.
+ texture
must be one of
+ GL_TEXTURE
i
,
+ where
+ GL_TEXTURE0
.
+
+ glActiveTexture
+ selects which texture unit subsequent texture state calls will
+ affect. The number of texture units an implementation supports
+ is implementation dependent, it must be at least 2.
+ GL_INVALID_ENUM
is generated if
+ texture
is not one of
+ GL_TEXTURE
i
,
+ where
+
It is always the case that
+
A texture unit consists of the texture enable state, + texture matrix stack, texture environment and currently bound + texture. Modifying any of these states has an effect only on + the active texture unit. +
Vertex arrays are client-side GL resources, which are + selected by the + glClientActiveTexture + routine.
+ glBindTexture, + glClientActiveTexture, + glEnable, + glGet, + glMatrixMode, + glMultiTexCoord, + glTexEnv +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glAlphaFunc — specify the alpha test function
void glAlphaFunc( | GLenum func, |
GLclampf ref) ; |
void glAlphaFuncx( | GLenum func, |
GLclampx ref) ; |
func
+ Specifies the alpha comparison function. Symbolic
+ constants
+ GL_NEVER
,
+ GL_LESS
,
+ GL_EQUAL
,
+ GL_LEQUAL
,
+ GL_GREATER
,
+ GL_NOTEQUAL
,
+ GL_GEQUAL
, and
+ GL_ALWAYS
+ are accepted. The initial value is
+ GL_ALWAYS
.
+
ref
+ Specifies the reference value that incoming alpha + values are compared to. This value is clamped to the + range [0, 1], where 0 represents the lowest possible + alpha value and 1 the highest possible value. The initial + reference value is 0. +
The alpha test discards fragments depending on the
+ outcome of a comparison between an incoming fragment's alpha
+ value and a constant reference value.
+ glAlphaFunc
+ specifies the reference value and the comparison function. The
+ comparison is performed only if alpha testing is enabled.
+ To enable and disable alpha testing, call
+ glEnable and
+ glDisable
+ with argument GL_ALPHA_TEST
.
+ Alpha testing is initially disabled. When disabled, it is as if the comparison
+ always passes.
+
+
+ func
and ref
+ specify the conditions under which the pixel is drawn. The
+ incoming alpha value is compared to ref
+ using the function specified by func
.
+
+ If the value passes the comparison, the incoming fragment is
+ drawn if it also passes subsequent stencil and depth buffer
+ tests. If the value fails the comparison, no change is made to
+ the frame buffer at that pixel location. The comparison
+ functions are as follows:
+
GL_NEVER
+ Never passes.
GL_LESS
+ Passes if the incoming alpha value is less than the + reference value.
GL_EQUAL
+ Passes if the incoming alpha value is equal to the + reference value.
GL_LEQUAL
+ Passes if the incoming alpha value is less than or + equal to the reference value.
GL_GREATER
+ Passes if the incoming alpha value is greater than + the reference value.
GL_NOTEQUAL
+ Passes if the incoming alpha value is not equal to + the reference value.
GL_GEQUAL
+ Passes if the incoming alpha value is greater than + or equal to the reference value.
GL_ALWAYS
+ Always passes (initial value).
+ glAlphaFunc
+ operates on all pixel write operations, including those
+ resulting from the scan conversion of points, lines, and
+ polygons.
+ glAlphaFunc
+ does not affect
+ glClear.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBindBuffer — bind a named buffer to a target
void glBindBuffer( | GLenum target, |
GLuint buffer) ; |
target
+
+ Specifies the target to which the buffer is bound.
+ The symbolic constant must be
+ GL_ARRAY_BUFFER
+ or GL_ELEMENT_ARRAY_BUFFER
.
+
buffer
+ Specifies the name of a buffer object.
+ glBindBuffer
+ lets you create or use a named buffer object.
+ Calling glBindBuffer
+ with target
+ set to GL_ARRAY_BUFFER
+ or GL_ELEMENT_ARRAY_BUFFER
+ and buffer
set to the name of the new buffer object
+ binds the buffer object name to the target. When a buffer object is bound to
+ a target, the previous binding for that target is automatically broken.
+
+ glBindBuffer
lets you create or use a named buffer object. Calling glBindBuffer
with
+ target
set to
+ GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
and
+ buffer
set to the name
+ of the new buffer object binds the buffer object name to the target.
+ When a buffer object is bound to a target, the previous binding for that
+ target is automatically broken.
+
+ Buffer object names are unsigned integers. The value zero is reserved, but
+ there is no default buffer object for each buffer object target. Instead, buffer
set to zero
+ effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target.
+ Buffer object names and the corresponding buffer object contents are local to
+ the shared buffer-object space (see eglCreateContext) of the current
+ GL rendering context.
+
+ You may use glGenBuffers to generate a set of new buffer object names. +
+ The state of a buffer object immediately after it is first bound is an unmapped zero-sized memory buffer with
+ GL_READ_WRITE
access and GL_STATIC_DRAW
usage.
+
+ While a non-zero buffer object name is bound, GL operations on the target to which it is
+ bound affect the bound buffer object, and queries of the target to which it is bound return state
+ from the bound buffer object. While buffer object name zero is bound, as in the initial state,
+ attempts to modify or query state on the target to which it is bound generates an
+ GL_INVALID_OPERATION
error.
+
+ When vertex array pointer state is changed, for example by a call to
+ glNormalPointer,
+ the current buffer object binding (GL_ARRAY_BUFFER_BINDING
) is copied into the
+ corresponding client state for the vertex array type being changed, for example
+ GL_NORMAL_ARRAY_BUFFER_BINDING
. While a non-zero buffer object is bound to the
+ GL_ARRAY_BUFFER
target, the vertex array pointer parameter that is traditionally
+ interpreted as a pointer to client-side memory is instead interpreted as an offset within the
+ buffer object measured in basic machine units.
+
+ While a non-zero buffer object is bound to the GL_ELEMENT_ARRAY_BUFFER
target,
+ the indices parameter of glDrawElements
+ that is traditionally
+ interpreted as a pointer to client-side memory is instead interpreted as an offset within the
+ buffer object measured in basic machine units.
+
+ A buffer object binding created with glBindBuffer
remains active until a different
+ buffer object name is bound to the same target, or until the bound buffer object is
+ deleted with glDeleteBuffers.
+
+ Once created, a named buffer object may be re-bound to any target as often as needed. However, + the GL implementation may make choices about how to optimize the storage of a buffer object based + on its initial binding target. +
+ glGet
+ with argument GL_ARRAY_BUFFER_BINDING
or
+ GL_ELEMENT_ARRAY_BUFFER_BINDING
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBindTexture — bind a named texture to a texturing target
void glBindTexture( | GLenum target, |
GLuint texture) ; |
target
+ Specifies the target to which the texture is bound.
+ Must be GL_TEXTURE_2D
.
texture
+ Specifies the name of a texture.
glBindTexture
+ lets you create or use a named texture. Calling
+ glBindTexture
+ with target
+ set to GL_TEXTURE_2D
, and
+ texture
+ set to the name of the new texture binds the texture name to
+ the target. When a texture is bound to a target, the previous
+ binding for that target is automatically broken.
Texture names are unsigned integers. The value 0 is + reserved to represent the default texture for each texture + target. Texture names and the corresponding texture contents + are local to the shared texture-object space (see + eglCreateContext) + of the current GL rendering context.
You may use + glGenTextures + to generate a set of new texture names.
While a texture is bound, GL operations on the target to + which it is bound affect the bound texture. If texture mapping + of the dimensionality of the target to which a texture is bound + is active, the bound texture is used. In effect, the texture + targets become aliases for the textures currently bound to + them, and the texture name 0 refers to the default textures + that were bound to them at initialization.
A texture binding created with glBindTexture
+ remains active until a different texture is bound to the same
+ target, or until the bound texture is deleted with
+ glDeleteTextures.
Once created, a named texture may be re-bound to the
+ target of the matching dimensionality as often as needed. It is
+ usually much faster to use glBindTexture
+ to bind an existing named texture to one of the texture targets
+ than it is to reload the texture image using
+ glTexImage2D.
+ eglCreateContext, + glActiveTexture, + glCompressedTexImage2D, + glCopyTexImage2D, + glDeleteTextures, + glGenTextures, + glGet, + glTexImage2D, + glTexParameter +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBlendFunc — specify pixel arithmetic
void glBlendFunc( | GLenum sfactor, |
GLenum dfactor) ; |
sfactor
+
+ Specifies how the red, green, blue, and alpha
+ source blending factors are computed. The following
+ symbolic constants are accepted:
+ GL_ZERO
,
+ GL_ONE
,
+ GL_DST_COLOR
,
+ GL_ONE_MINUS_DST_COLOR
,
+ GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ GL_DST_ALPHA
,
+ GL_ONE_MINUS_DST_ALPHA
, and
+ GL_SRC_ALPHA_SATURATE
.
+ The initial value is GL_ONE
.
+
dfactor
+ Specifies how the red, green, blue, and alpha
+ destination blending factors are computed. Eight symbolic
+ constants are accepted:
+ GL_ZERO
,
+ GL_ONE
,
+ GL_SRC_COLOR
,
+ GL_ONE_MINUS_SRC_COLOR
,
+ GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ GL_DST_ALPHA
, and
+ GL_ONE_MINUS_DST_ALPHA
. The initial value is
+ GL_ZERO
.
Pixels can be drawn using a function that blends the
+ incoming (source) values with the values that are already in
+ the color buffer (the destination values). Use
+ glEnable and
+ glDisable
+ with argument GL_BLEND
+ to enable and disable blending.
+ Blending is initially disabled.
+
+ glBlendFunc
+ defines the operation of blending when it is enabled.
+ sfactor
+ specifies which of eleven methods is used to scale the source color components.
+ dfactor
+ specifies which of ten methods is used to scale the destination color components.
+ The eleven possible methods are described in the following table.
+ Each method defines four scale factors, one each for red, green, blue, and alpha.
+
In the table and in subsequent equations, source and
+ destination color components are referred to as
+
and
+
Source and destination scale factors are referred to as
+
Parameter |
+ |
---|---|
+ GL_ZERO
+ |
+ |
+ GL_ONE
+ |
+ |
+ GL_SRC_COLOR
+ |
+ |
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ |
+ GL_DST_COLOR
+ |
+ |
+ GL_ONE_MINUS_DST_COLOR
+ |
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_DST_ALPHA
+ |
+ |
+ GL_ONE_MINUS_DST_ALPHA
+ |
+ |
+ GL_SRC_ALPHA_SATURATE
+ |
+ |
In the table,
To determine the blended values of a pixel, the system + uses the following equations:
Despite the apparent precision of the above equations,
+ blending arithmetic is not exactly specified, because blending
+ operates with imprecise integer color values. However, a blend
+ factor that should be equal to 1 is guaranteed not to modify
+ its multiplicand, and a blend factor equal to 0 reduces its
+ multiplicand to 0. For example, when sfactor
+ is GL_SRC_ALPHA
,
+ dfactor
is
+ GL_ONE_MINUS_SRC_ALPHA
, and
+
+ glBlendFunc
operates on all pixel write operations,
+ including the scan conversion of points, lines, and polygons.
+ glBlendFunc
does not affect
+ glClear.
+
Transparency is best implemented using
+ glBlendFunc
(GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
)
+ with primitives sorted from farthest to nearest. Note that
+ this transparency calculation does not require the presence of
+ alpha bitplanes in the color buffer.
glBlendFunc
(GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
)
+ is also useful for rendering antialiased points and lines.
+
Incoming (source) alpha is correctly thought of as a
+ material opacity, ranging from 1.0
+ (
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBufferData — creates and initializes a buffer object's data store.
void glBufferData( | GLenum target, |
GLsizeiptr size, | |
const GLvoid * data, | |
GLenum usage) ; |
target
+
+ Specifies the target buffer object. The symbolic constant must be
+ GL_ARRAY_BUFFER
+ or GL_ELEMENT_ARRAY_BUFFER
.
+
size
+ Specifies the size in bytes of the buffer object's new data store.
data
+ Specifies a pointer to data that will be copied into the data store for
+ initialization, or NULL
if no data is to be copied.
usage
+
+ Specifies the expected usage pattern of the data store. The symbolic constant
+ must be
+ GL_STATIC_DRAW
or
+ GL_DYNAMIC_DRAW
.
+
+ glBufferData
creates a new data store for the buffer object currently bound to
+ target
. Any pre-existing data store is deleted. The new data store is created with the
+ specified size
in bytes and usage
. If data
+ is not NULL
, the data store is initialized with data from this pointer.
+
+ usage
is a hint to the GL implementation as to how a buffer object's data store will be
+ accessed. This enables the GL implementation to make more intelligent decisions that may significantly
+ impact buffer object performance. It does not, however, constrain the actual usage of the data store.
+
+ usage
may be one of these:
+
GL_STATIC_DRAW
+ The data store contents will be modified once + and used many times as the source for GL drawing commands. +
GL_DYNAMIC_DRAW
+ The data store contents will be modified repeatedly + and used many times as the source for GL drawing commands. +
+
+ If data
is NULL
, a data store of the specified size is still created,
+ but its contents remain uninitialized and thus undefined.
+
+ Clients must align data elements consistent with the requirements of the client
+ platform, with an additional base-level requirement that an offset within a buffer to
+ a datum comprising
+ GL_INVALID_ENUM
is generated if target
is not
+ GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.
+
+ GL_INVALID_ENUM
is generated if usage
is not
+ GL_STATIC_DRAW
or
+ GL_DYNAMIC_DRAW
.
+
+ GL_INVALID_VALUE
is generated if size
is negative.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ GL_OUT_OF_MEMORY
is generated if the GL is unable to create a data store with the specified size
.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBufferSubData — updates a subset of a buffer object's data store.
void glBufferSubData( | GLenum target, |
GLintptr offset, | |
GLsizeiptr size, | |
const GLvoid * data) ; |
target
+
+ Specifies the target buffer object. The symbolic constant must be
+ GL_ARRAY_BUFFER
+ or GL_ELEMENT_ARRAY_BUFFER
.
+
offset
+ Specifies the offset into the buffer object's data store where data + replacement will begin, measured in bytes.
size
+ Specifies the size in bytes of the data store region being replaced.
data
+ + Specifies a pointer to the new data that will be copied into the data store.
+ glBufferSubData
redefines some or all of the data store for the buffer object currently
+ bound to target
. Data starting at byte offset offset
and
+ extending for size
bytes is copied to the data store from the memory pointed to by
+ data
. An error is thrown if offset
and size
+ together define a range beyond the bounds of the buffer object's data store.
+
+ When replacing the entire data store, consider using glBufferSubData
rather
+ than completely recreating the data store with glBufferData
. This avoids the cost of
+ reallocating the data store.
+
+ Consider using multiple buffer objects to avoid stalling the rendering pipeline during data store updates.
+ If any rendering in the pipeline makes reference to data in the buffer object being updated by
+ glBufferSubData
, especially from the specific region being updated, that rendering must
+ drain from the pipeline before the data store can be updated.
+
+ Clients must align data elements consistent with the requirements of the client
+ platform, with an additional base-level requirement that an offset within a buffer to
+ a datum comprising
+ GL_INVALID_ENUM
is generated if target
is not
+ GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.
+
+ GL_INVALID_VALUE
is generated if offset
or
+ size
is negative, or if together they define a region of memory
+ that extends beyond the buffer object's allocated data store.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glClear — clear buffers to preset values
void glClear( | GLbitfield mask) ; |
mask
+ Bitwise OR of masks that indicate the buffers to be
+ cleared. Valid masks are
+ GL_COLOR_BUFFER_BIT
,
+ GL_DEPTH_BUFFER_BIT
, and
+ GL_STENCIL_BUFFER_BIT
.
+ glClear
+ sets the bitplane area of the window to values previously selected by
+ glClearColor,
+ glClearDepth,
+ and
+ glClearStencil.
+
The pixel ownership test, the scissor test, dithering,
+ and the buffer write masks affect the operation of
+ glClear
.
+ The scissor box bounds the cleared region. Alpha function,
+ blend function, logical operation, stenciling, texture mapping,
+ and depth-buffering are ignored by glClear
.
+ glClear
+ takes a single argument that is the bitwise OR of several
+ values indicating which buffer is to be cleared.
The values are as follows:
GL_COLOR_BUFFER_BIT
+ Indicates the color buffer.
GL_DEPTH_BUFFER_BIT
+ Indicates the depth buffer.
GL_STENCIL_BUFFER_BIT
+ Indicates the stencil buffer.
The value to which each buffer is cleared depends on the + setting of the clear value for that buffer.
+ glGet with argument GL_COLOR_CLEAR_VALUE
+
+ glGet with argument GL_DEPTH_CLEAR_VALUE
+
+ glGet with argument GL_STENCIL_CLEAR_VALUE
+
+ glClearColor, + glClearDepth, + glClearStencil, + glColorMask, + glDepthMask, + glScissor, + glStencilMask +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glClearColor — specify clear values for the color buffer
void glClearColor( | GLclampf red, |
GLclampf green, | |
GLclampf blue, | |
GLclampf alpha) ; |
void glClearColorx( | GLclampx red, |
GLclampx green, | |
GLclampx blue, | |
GLclampx alpha) ; |
red
,
+ green
,
+ blue
,
+ alpha
+ Specify the red, green, blue, and alpha values used + when the color buffer is cleared. The initial values + are all 0.
+ glClearColor
+ specifies the red, green, blue, and alpha values used by
+ glClear
+ to clear the color buffer. Values specified by
+ glClearColor
+ are clamped to the range [0, 1].
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glClearDepth — specify the clear value for the depth buffer
void glClearDepthf( | GLclampf depth) ; |
void glClearDepthx( | GLclampx depth) ; |
depth
+ Specifies the depth value used when the depth + buffer is cleared. The initial value is 1.
+ glClearDepth
specifies the depth value used by
+ glClear
+ to clear the depth buffer. Values specified by
+ glClearDepth
+ are clamped to the range [0, 1].
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glClearStencil — specify the clear value for the stencil buffer
void glClearStencil( | GLint s) ; |
s
+ Specifies the index used when the stencil buffer is + cleared. The initial value is 0.
glClearStencil
+ specifies the index used by
+ glClear
+ to clear the stencil buffer. s
+ is masked with
+ m
+ is the number of bits in the stencil buffer.
+ glGet with argument GL_STENCIL_CLEAR_VALUE
+
+ glGet
+ with argument GL_STENCIL_BITS
+
+ glClear, + glClearColor, + glClearDepth, + glGet, + glStencilFunc, + glStencilOp, + glStencilMask +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glClientActiveTexture — select client-side active texture unit
void glClientActiveTexture( | GLenum texture) ; |
texture
+
+ Specifies which texture unit to make active. The
+ number of texture units is implementation dependent, but
+ must be at least two.
+ texture
must be one of
+ GL_TEXTURE
i
,
+ GL_TEXTURE0
.
+
+ glClientActiveTexture
+ selects the vertex array client state parameters to be modified
+ by
+ glTexCoordPointer,
+ and enabled or disabled with
+ glEnableClientState
+ or
+ glDisableClientState,
+ respectively, when called with a parameter of
+ GL_TEXTURE_COORD_ARRAY
.
+ GL_INVALID_ENUM
is generated if
+ texture
is not one of
+ GL_TEXTURE
i
,
+ where
+
+ glActiveTexture, + glEnableClientState, + glGet, + glMultiTexCoord, + glTexCoordPointer +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glClipPlane — specify a plane against which all geometry is + clipped
void glClipPlanef( | GLenum plane, |
const GLfloat *equation) ; |
void glClipPlanex( | GLenum plane, |
const GLfixed *equation) ; |
plane
Specifies which clipping plane is being positioned. Symbolic
+ names of the form GL_CLIP_PLANE
i,
+ where i is an integer
+ between 0 and GL_MAX_CLIP_PLANES
+
equation
Specifies the address of an array of four fixed-point or + floating-point values. These are the coefficients of a plane + equation in object coordinates: p1, + p2, p3, and + p4, in that order.
Geometry is always clipped against the boundaries of a six-plane
+ frustum in x, y, and z. glClipPlane
allows the
+ specification of additional planes, not necessarily perpendicular to the
+ x, y, or z axis, against which all geometry is clipped. To determine the
+ maximum number of additional clipping planes, call glGet with argument GL_MAX_CLIP_PLANES
.
+ All implementations support at least one such clipping plane. Because the
+ resulting clipping region is the intersection of the defined half-spaces,
+ it is always convex.
glClipPlane
specifies a half-space using a
+ four-component plane equation. When glClipPlane
is
+ called, the coefficients given by equation
are
+ transformed by the inverse of the modelview matrix and stored in the
+ resulting eye coordinates. The resulting plane equation is undefined, if
+ the model-view matrix M is singular and it may be
+ inaccurate, if M is poorly conditioned. Subsequent
+ changes to the modelview matrix have no effect on the stored
+ plane-equation coefficients. If the dot product of the eye coordinates of
+ a vertex with the stored plane equation components is positive or zero,
+ the vertex is in
with respect to that clipping plane.
+ Otherwise, it is out
.
To enable and disable clipping planes, call glEnable and glDisable
with the argument
+ GL_CLIP_PLANEi
, where i
is the
+ plane number.
All clipping planes are initially defined as (0, 0, 0,
+ 0)
in eye coordinates and are disabled.
It is always the case that i
+
+ .
+
Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI Free + Software B License. For details, see http://oss.sgi.com/projects/FreeB/.
glColor — set the current color
void glColor4f( | GLfloat red, |
GLfloat green, | |
GLfloat blue, | |
GLfloat alpha) ; |
void glColor4x( | GLfixed red, |
GLfixed green, | |
GLfixed blue, | |
GLfixed alpha) ; |
void glColor4ub( | GLubyte red, |
GLubyte green, | |
GLubyte blue, | |
GLubyte alpha) ; |
red
,
+ green
,
+ blue
,
+ alpha
+ Specify new red, green, blue, and alpha values for + the current color.
glColor
sets a new four-valued current RGBA color.
Current color values are stored in fixed-point or + floating-point. In case the values are stored in + floating-point, the mantissa and exponent sizes are + unspecified.
Neither fixed-point nor floating-point values are clamped + to the range [0, 1] before the current color is updated. + However, color components are clamped to this range before they + are interpolated or written into the color buffer.
Unsigned byte color components specified
+ with glColor4ub
are linearly mapped to
+ floating-point values such that 255 maps to 1.0 (full
+ intensity), and 0 maps to 0.0 (zero intensity).
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glColorMask — enable and disable writing of color buffer + components
void glColorMask( | GLboolean red, |
GLboolean green, | |
GLboolean blue, | |
GLboolean alpha) ; |
red
,
+ green
,
+ blue
,
+ alpha
+ Specify whether red, green, blue, and alpha can or
+ cannot be written into the color buffer. The initial
+ values are all GL_TRUE
,
+ indicating that all color components can be written.
+ glColorMask
+ specifies whether the individual components in the color
+ buffer can or cannot be written. If red
is
+ GL_FALSE
,
+ for example, no change is made to the red component of any
+ pixel in the color buffer, regardless of the drawing operation
+ attempted, including
+ glClear.
+
Changes to individual bits of components cannot be + controlled. Rather, changes are either enabled or disabled for + entire color components.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glColorPointer — define an array of colors
void glColorPointer( | GLint size, |
GLenum type, | |
GLsizei stride, | |
const GLvoid * pointer) ; |
size
+ Specifies the number of components per color. Must + be 4. The initial value is 4.
type
+ Specifies the data type of each color component in
+ the array. Symbolic constants
+ GL_UNSIGNED_BYTE
and
+ GL_FIXED
are accepted.
+ However, the initial value is
+ GL_FLOAT
.
+ The common profile accepts the symbolic constant
+ GL_FLOAT
as well.
+
stride
+ Specifies the byte offset between consecutive colors. If
+ stride
+ is 0, the colors are understood to be
+ tightly packed in the array. The initial value is 0.
pointer
+ Specifies a pointer to the first component of the + first color element in the array.
+ glColorPointer
+ specifies the location and data of an array of color components
+ to use when rendering.
+ size
+ specifies the number of components per color, and must be 4.
+ type
+ specifies the data type of each color component, and
+ stride
+ specifies the byte stride from one color to the next allowing
+ vertices and attributes to be packed into a single array or
+ stored in separate arrays. (Single-array storage may be more
+ efficient on some implementations.)
When a color array is specified,
+ size
,
+ type
,
+ stride
, and
+ pointer
+ are saved as client-side state.
+ If the color array is enabled, it is used when
+ glDrawArrays,
+ or
+ glDrawElements
+ is called.
+ To enable and disable the color array, call
+ glEnableClientState
+ and
+ glDisableClientState
+ with the argument GL_COLOR_ARRAY
.
+ The color array is initially disabled and isn't accessed when
+ glDrawArrays or
+ glDrawElements
+ is called.
Use + glDrawArrays + to construct a sequence of primitives (all of the same type) + from prespecified vertex and vertex attribute arrays. Use + glDrawElements + to construct a sequence of primitives by indexing vertices and + vertex attributes.
+ GL_INVALID_VALUE
is generated if
+ size
is not 4.
+ GL_INVALID_ENUM
is generated if
+ type
is not an accepted value.
+ GL_INVALID_VALUE
is generated if
+ stride
is negative.
+ glColor, + glDrawArrays, + glDrawElements, + glEnableClientState, + glNormalPointer, + glTexCoordPointer, + glVertexPointer +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCompressedTexImage2D — specify a two-dimensional compressed texture image
void glCompressedTexImage2D( | GLenum target, |
GLint level, | |
GLenum internalformat, | |
GLsizei width, | |
GLsizei height, | |
GLint border, | |
GLsizei imageSize, | |
const GLvoid * data) ; |
target
+ Specifies the target texture. Must be
+ GL_TEXTURE_2D
.
level
+ Specifies the level-of-detail number. For paletted formats,
+ where all mipmap levels are loaded at once,
+ this parameter is overloaded to represent the negative of the
+ greatest mipmap level included in data
.
+
internalformat
+ Specifies the color components in the
+ texture. The following symbolic constants are accepted:
+ GL_PALETTE4_RGB8_OES
,
+ GL_PALETTE4_RGBA8_OES
,
+ GL_PALETTE4_R5_G6_B5_OES
,
+ GL_PALETTE4_RGBA4_OES
,
+ GL_PALETTE4_RGB5_A1_OES
,
+ GL_PALETTE8_RGB8_OES
,
+ GL_PALETTE8_RGBA8_OES
,
+ GL_PALETTE8_R5_G6_B5_OES
,
+ GL_PALETTE8_RGBA4_OES
, and
+ GL_PALETTE8_RGB5_A1_OES
.
width
+ Specifies the width of the texture image. Must be
+ n
.
+ All implementations support texture images that are at
+ least 64 texels wide.
height
+ Specifies the height of the texture image. Must be
+ m
.
+ All implementations support texture images that are at
+ least 64 texels high.
border
+ Specifies the width of the border. Must be 0.
imageSize
+ Specifies the size of the compressed image data in bytes.
data
+ Specifies a pointer to the compressed image data in memory.
+ glCompressedTexImage2D
defines a two-dimensional texture image
+ or cube-map texture image using compressed image data from client memory. The texture
+ image is decoded according to the definition of the
+ internalformat
. In addition to the paletted formats
+ described below, OpenGL ES provides a mechanism to obtain symbolic constants for
+ other formats provided by extensions. The number of compressed texture formats
+ supported can be obtained by querying the value of
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS
. The list of specific
+ compressed texture formats supported can be obtained by querying the value of
+ GL_COMPRESSED_TEXTURE_FORMATS
.
+
The required compressed formats are paletted textures.
+ The layout of the compressed image is a
+ palette followed by multiple mip-levels of
+ texture indices used for lookup into the palette.
+ The palette format can be one of
+ R5_G6_B5
,
+ RGBA4
,
+ RGB5_A1
,
+ RGB8
, or
+ RGBA8
.
+ The texture indices can have a resolution of 4 or 8 bits.
+ As a result, the number of palette entries is either
+ 16 or 256. If level
is 0, only one mip-level
+ of texture indices is described in data
. Otherwise,
+ the negative value of level
+ specifies up to which mip-level the texture indices are described.
+ A possibly remaining pad nibble for the lowest resolution
+ mip-level is ignored.
glPixelStorei + has no effect on compressed texture images.
glCompressedTexImage2D
+ specifies the two-dimensional texture for the currently bound texture,
+ specified with
+ glBindTexture,
+ and the current texture
+ unit, specified with
+ glActiveTexture.
+
GL_INVALID_ENUM
is generated if
+ target
is not
+ GL_TEXTURE_2D
.
GL_INVALID_VALUE
may be generated if
+ if internalformat
is not one of the paletted formats and
+ level
is greater than 0 or the
+ absolute value of level
is greater than
+ max
is the returned value of
+ GL_MAX_TEXTURE_SIZE
.
GL_INVALID_VALUE
may be generated if
+ if internalformat
is not one of the paletted formats and
+ level
is less than 0 or greater than
+ max
is the returned value of
+ GL_MAX_TEXTURE_SIZE
.
+ GL_INVALID_ENUM
is generated if
+ internalformat
+ is not one of the accepted symbolic constants.
+
GL_INVALID_VALUE
is generated if
+ width
or
+ height
+ is less than 0 or greater than
+ GL_MAX_TEXTURE_SIZE
,
+ or if either cannot be represented as
+ k
.
GL_INVALID_VALUE
is generated if
+ border
is not 0.
GL_INVALID_VALUE
is generated if
+ imageSize
is not consistent
+ with format, dimentions, and contents of the compressed image.
+ glGet with arguments
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS
and
+ GL_COMPRESSED_TEXTURE_FORMATS
+
+ glGet
+ with argument GL_MAX_TEXTURE_SIZE
+ glActiveTexture, + glBindTexture, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glPixelStorei, + glTexEnv, + glTexImage2D, + glTexParameter +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCompressedTexSubImage2D — specify a two-dimensional compressed texture subimage
void glCompressedTexSubImage2D( | GLenum target, |
GLint level, | |
GLint xoffset, | |
GLint yoffset, | |
GLsizei width, | |
GLsizei height, | |
GLenum format, | |
GLsizei imageSize, | |
const GLvoid * data) ; |
target
+ Specifies the target texture. Must be
+ GL_TEXTURE_2D
.
level
+ Specifies the level-of-detail number.
xoffset
+ Specifies a texel offset in the x direction within + the texture array.
yoffset
+ Specifies a texel offset in the y direction within + the texture array.
width
+ Specifies the width of the texture subimage.
height
+ Specifies the height of the texture subimage.
format
+ Specifies the format of the pixel data. + Currently, there is no supported format.
imageSize
+ Specifies the size of the compressed pixel data in bytes.
data
+ Specifies a pointer to the compressed image data in + memory.
+ glCompressedTexSubImage2D
+ redefines a contiguous subregion of an existing two-dimensional
+ compressed texture image.
+ The texels referenced by pixels
+ replace the portion of the existing texture array with x indices
+ xoffset
and
+ yoffset
and
+
format
must be the same compressed-texture format
+ previously specified by
+ glCompressedTexImage2D.
The required paletted formats do not allow subimage updates, + but other formats defined by extensions may.
glPixelStorei + has no effect on compressed texture images.
+ glCompressedTexSubImage2D
+ specifies the two-dimensional sub texture for the currently bound texture,
+ specified with
+ glBindTexture,
+ and the current texture
+ unit, specified with
+ glActiveTexture.
+
GL_INVALID_ENUM
is generated if
+ target
is not GL_TEXTURE_2D
.
+
GL_INVALID_VALUE
is generated if
+ level
is less than 0.
GL_INVALID_VALUE
may be generated if
+ level
is greater than
+ max
is the returned value of
+ GL_MAX_TEXTURE_SIZE
.
+ GL_INVALID_VALUE
is generated if
+
GL_INVALID_VALUE
is generated if
+ width
or
+ height
is less than 0.
+ GL_INVALID_OPERATION
is generated if the texture array has not
+ been defined by a previous
+ glCompressedTexImage2D
+ operation whose internalformat
matches the format
+ of glCompressedTexSubImage2D
.
+
+ GL_INVALID_OPERATION
is generated if parameter combinations are not
+ supported by the specific compressed internal format as specified in the
+ specific texture compression extension.
+
+ Undefined results, including abnormal program termination, are generated if
+ data
is not encoded in a manner consistent with the extension
+ specification defining the internal compression format.
+
+ glGet with arguments
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS
and
+ GL_COMPRESSED_TEXTURE_FORMATS
+
+ glGet
+ with argument GL_MAX_TEXTURE_SIZE
+ glActiveTexture, + glBindTexture, + glCompressedTexImage2D, + glCopyTexSubImage2D, + glGet, + glPixelStorei, + glTexEnv, + glTexParameter +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCopyTexImage2D — specify a two-dimensional texture image with pixels from the color buffer
void glCopyTexImage2D( | GLenum target, |
GLint level, | |
GLenum internalformat, | |
GLint x, | |
GLint y, | |
GLsizei width, | |
GLsizei height, | |
GLint border) ; |
target
+ Specifies the target texture. Must be
+ GL_TEXTURE_2D
.
level
+ Specifies the level-of-detail number. Level 0 is
+ the base image level. Level n
+ is the n
th mipmap reduction image.
internalformat
+ Specifies the color components of the texture. Must be one
+ of the following symbolic constants:
+ GL_ALPHA
,
+ GL_LUMINANCE
,
+ GL_LUMINANCE_ALPHA
,
+ GL_RGB
, or
+ GL_RGBA
.
x
, y
+ Specify the window coordinates of the lower left + corner of the rectangular region of pixels to be + copied.
width
+ Specifies the width of the texture image. Must be 0 or
+ n
.
height
+ Specifies the height of the texture image. Must be 0 or
+ m
.
border
+ Specifies the width of the border. Must be 0.
+ glCopyTexImage2D
+ defines a two-dimensional texture image with pixels from the
+ color buffer.
The screen-aligned pixel rectangle with lower left corner
+ at (x
, y
)
+ and with a width of
+ level
. internalformat
+ specifies the color components of the texture.
+ The red, green, blue, and alpha + components of each pixel that is read are converted to an + internal fixed-point or floating-point format with unspecified precision. + The conversion maps the largest representable component + value to 1.0, and component value 0 to 0.0. + The values are then converted to the texture's internal format for + storage in the texel array.
internalformat
must be chosen such that
+ color buffer components can be dropped during conversion to the
+ internal format, but new components cannot be added. For example,
+ an GL_RGB
color buffer can be used to create
+ GL_LUMINANCE
or GL_RGB
+ textures, but not GL_ALPHA
,
+ GL_LUMINANCE_ALPHA
or GL_RGBA
+ textures.
Pixel ordering is such that lower x
+ and y
screen coordinates correspond to lower
+ s
and t
texture
+ coordinates.
If any of the pixels within the specified rectangle of + the color buffer are outside the window associated with the + current rendering context, then the values obtained for those + pixels are undefined.
GL_INVALID_ENUM
is generated if
+ target
is not
+ GL_TEXTURE_2D
.
GL_INVALID_OPERATION
is generated if
+ internalformat
is not compatible
+ with the color buffer format.
GL_INVALID_VALUE
is generated if
+ level
is less than 0.
GL_INVALID_VALUE
may be generated if
+ level
is greater than
+ max
is the returned value of
+ GL_MAX_TEXTURE_SIZE
.
+ GL_INVALID_VALUE
is generated if
+ width
or
+ height
+ is less than 0, greater than
+ GL_MAX_TEXTURE_SIZE
, or if
+ width
or height
+ cannot be represented as
+ k
.
GL_INVALID_VALUE
is generated if
+ border
is not 0.
+ GL_INVALID_ENUM
is generated if
+ internalformat
+ is not an accepted constant.
+
+ glCompressedTexImage2D, + glCopyTexSubImage2D, + glGet, + glTexEnv, + glTexImage2D, + glTexSubImage2D, + glTexParameter +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCopyTexSubImage2D — specify a two-dimensional texture subimage with pixels from the color buffer
void glCopyTexSubImage2D( | GLenum target, |
GLint level, | |
GLint xoffset, | |
GLint yoffset, | |
GLint x, | |
GLint y, | |
GLsizei width, | |
GLsizei height) ; |
target
+ Specifies the target texture. Must be
+ GL_TEXTURE_2D
.
level
+ Specifies the level-of-detail number. Level 0 is
+ the base image level. Level n
+ is the n
th mipmap reduction image.
xoffset
+ Specifies a texel offset in the x direction within + the texture array.
yoffset
+ Specifies a texel offset in the y direction within + the texture array.
x
, y
+ Specify the window coordinates of the lower left + corner of the rectangular region of pixels to be + copied.
width
+ Specifies the width of the texture subimage.
height
+ Specifies the height of the texture subimage.
glCopyTexSubImage2D
+ replaces a rectangular portion of a two-dimensional texture
+ image with pixels from the color buffer.
+
The screen-aligned pixel rectangle with lower left corner at (
+ x
, y
) and with width
+ width
and height
+ height
+ replaces the portion of the texture array with x indices
+ xoffset
through
+ yoffset
through
+ level
.
The pixels in the rectangle are processed the same way + as with + glCopyTexImage2D. +
glCopyTexSubImage2D
requires
+ that the internal format of the currently bound texture is such that
+ color buffer components can be dropped during conversion to the
+ internal format, but new components cannot be added. For example,
+ an GL_RGB
color buffer can be used to create
+ GL_LUMINANCE
or GL_RGB
+ textures, but not GL_ALPHA
,
+ GL_LUMINANCE_ALPHA
or GL_RGBA
+ textures.
The destination rectangle in the texture array may not + include any texels outside the texture array as it was + originally specified. It is not an error to specify a + subtexture with zero width or height, but such a specification + has no effect.
If any of the pixels within the specified rectangle of + the current color buffer are outside the read window associated + with the current rendering context, then the values obtained + for those pixels are undefined.
No change is made to the
+ internalformat
,
+ width
,
+ height
, or
+ border
+ parameters of the specified texture array or to texel values
+ outside the specified subregion.
GL_INVALID_ENUM
is generated if
+ target
is not
+ GL_TEXTURE_2D
.
GL_INVALID_OPERATION
is generated if
+ the texture array has not been defined by a previous
+ glTexImage2D
+ or
+ glCopyTexImage2D
+ operation or if the internal format of the currently bound texture
+ is not compatible with the color buffer format.
GL_INVALID_VALUE
is generated if
+ level
is less than 0.
GL_INVALID_VALUE
may be generated if
+ level
is greater than
+ max
is the returned value of
+ GL_MAX_TEXTURE_SIZE
.
GL_INVALID_VALUE
is generated if
+ w
is the texture width and
+ h
is the texture height.
+ glCompressedTexSubImage2D, + glCopyTexImage2D, + glGet, + glTexEnv, + glTexImage2D, + glTexParameter, + glTexSubImage2D +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCullFace — specify whether front- or back-facing polygons are + culled
void glCullFace( | GLenum mode) ; |
mode
+ Specifies whether front- or back-facing polygons are
+ culled. Symbolic constants
+ GL_FRONT
,
+ GL_BACK
, and
+ GL_FRONT_AND_BACK
+ are accepted. The initial value is
+ GL_BACK
.
+ glCullFace
+ specifies whether front- or back-facing polygons are culled (as
+ specified by mode
)
+ when culling is enabled.
+ To enable and disable culling, call
+ glEnable
+ and
+ glDisable
+ with argument GL_CULL_FACE
.
+ Culling is initially disabled.
+
+ glFrontFace + specifies which of the clockwise and counterclockwise polygons + are front-facing and back-facing.
If mode
is
+ GL_FRONT_AND_BACK
,
+ no polygons are drawn, but other primitives such as points and
+ lines are drawn.
+ glIsEnabled with argument GL_CULL_FACE
+
+ glGet with argument GL_CULL_FACE_MODE
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDeleteBuffers — delete named buffer objects
void glDeleteBuffers( | GLsizei n, |
const GLuint * buffers) ; |
n
+ Specifies the number of buffer objects to be + deleted.
buffers
+ Specifies an array of buffer object names to be + deleted.
+ glDeleteBuffers
+ deletes n
+ buffer objects named by the elements of the array
+ buffers
.
+ After a buffer object is deleted, it has no contents,
+ and its name is free for reuse.
glDeleteBuffers
+ silently ignores zero
and names that do not correspond to
+ existing buffer objects.
+ If a buffer object is deleted while it is bound, all
+ bindings to that object in the current context (i.e. in the thread that called
+ glDeleteBuffers
) are reset to zero.
+ Bindings to that buffer in other contexts and other
+ threads are not affected, but attempting to use a deleted buffer in another thread
+ produces undefined results, including but not limited to possible GL errors and
+ rendering corruption. Using a deleted buffer in another context or thread may not,
+ however, result in program termination.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDeleteTextures — delete named textures
void glDeleteTextures( | GLsizei n, |
const GLuint * textures) ; |
n
+ Specifies the number of textures to be + deleted.
textures
+ Specifies an array of textures to be + deleted.
+ glDeleteTextures
+ deletes n
+ textures named by the elements of the array
+ textures
.
+ After a texture is deleted, it has no contents or
+ dimensionality, and its name is free for reuse (for example by
+ glGenTextures).
+ If a texture that is currently bound is deleted, the binding
+ reverts to 0 (the default texture).
glDeleteTextures
+ silently ignores 0's and names that do not correspond to
+ existing textures.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDepthFunc — specify the value used for depth buffer comparisons
void glDepthFunc( | GLenum func) ; |
func
+ Specifies the depth comparison function. Symbolic constants
+ GL_NEVER
,
+ GL_LESS
,
+ GL_EQUAL
,
+ GL_LEQUAL
,
+ GL_GREATER
,
+ GL_NOTEQUAL
,
+ GL_GEQUAL
, and
+ GL_ALWAYS
are accepted. The initial value is
+ GL_LESS
.
+ glDepthFunc
+ specifies the function used to compare each incoming pixel
+ depth value with the depth value present in the depth buffer.
+ The comparison is performed only if depth testing is enabled.
+ To enable and disable depth testing, call
+ glEnable and
+ glDisable
+ with argument GL_DEPTH_TEST
.
+ Depth testing is initially disabled.
func
+ specifies the conditions under which the pixel will be drawn.
+ The comparison functions are as follows:
GL_NEVER
+ Never passes.
GL_LESS
+ Passes if the incoming depth value is less than the + stored depth value.
GL_EQUAL
+ Passes if the incoming depth value is equal to the + stored depth value.
GL_LEQUAL
+ Passes if the incoming depth value is less than or + equal to the stored depth value.
GL_GREATER
+ Passes if the incoming depth value is greater than + the stored depth value.
GL_NOTEQUAL
+ Passes if the incoming depth value is not equal to + the stored depth value.
GL_GEQUAL
+ Passes if the incoming depth value is greater than + or equal to the stored depth value.
GL_ALWAYS
+ Always passes.
The initial value of func
is
+ GL_LESS
. Initially, depth testing is disabled.
+ If depth testing is disabled or no depth buffer exists, it is as if the
+ depth test always passes.
+ Even if the depth buffer exists and the depth mask is non-zero,
+ the depth buffer is not updated if the depth test is disabled.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDepthMask — enable or disable writing into the depth buffer
void glDepthMask( | GLboolean flag) ; |
flag
+ Specifies whether the depth buffer is enabled for writing. If
+ flag
is GL_FALSE
,
+ depth buffer writing is disabled, otherwise it is enabled.
+ The initial value is GL_TRUE
.
+ glDepthMask
+ specifies whether the depth buffer is enabled for writing. If
+ flag
is GL_FALSE
,
+ depth buffer writing is disabled. Otherwise, it is enabled.
+ Initially, depth buffer writing is enabled.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDepthRange — specify mapping of depth values from normalized + device coordinates to window coordinates
void glDepthRangef( | GLclampf near, |
GLclampf far) ; |
void glDepthRangex( | GLclampx near, |
GLclampx far) ; |
near
+ Specifies the mapping of the near clipping plane to + window coordinates. The initial value is 0.
far
+ Specifies the mapping of the far clipping plane to + window coordinates. The initial value is 1.
After clipping and division by w
,
+ depth coordinates range from -1 to 1, corresponding to the
+ near and far clipping planes. glDepthRange
+ specifies a linear mapping of the normalized depth coordinates
+ in this range to window depth coordinates. Regardless of the
+ actual depth buffer implementation, window coordinate depth
+ values are treated as though they range from 0 through 1 (like
+ color components). Thus, the values accepted by
+ glDepthRange
+ are both clamped to this range before they are accepted.
The setting of (0, 1) maps the near plane to 0 and the far + plane to 1. With this mapping, the depth buffer range is fully + utilized.
It is not necessary that near
+ be less than far
.
+ Reverse mappings such as
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDrawArrays — render primitives from array data
void glDrawArrays( | GLenum mode, |
GLint first, | |
GLsizei count) ; |
mode
+ Specifies what kind of primitives to render.
+ Symbolic constants
+ GL_POINTS
,
+ GL_LINE_STRIP
,
+ GL_LINE_LOOP
,
+ GL_LINES
,
+ GL_TRIANGLE_STRIP
,
+ GL_TRIANGLE_FAN
, and
+ GL_TRIANGLES
are accepted.
first
+ Specifies the starting index in the enabled arrays.
count
+ Specifies the number of indices to be rendered.
+ glDrawArrays
+ specifies multiple geometric primitives with very few
+ subroutine calls. You can prespecify separate arrays of
+ vertices, normals, colors, and texture coordinates and use them
+ to construct a sequence of primitives with a single call to
+ glDrawArrays
.
When
+ glDrawArrays
is called, it uses
+ count
+ sequential elements from each enabled array to construct a
+ sequence of geometric primitives, beginning with element
+ first
.
+ mode
+ specifies what kind of primitives are constructed, and how the
+ array elements construct those primitives. If
+ GL_VERTEX_ARRAY
+ is not enabled, no geometric primitives are generated.
Vertex attributes that are modified by
+ glDrawArrays
have an unspecified value after
+ glDrawArrays
returns. For example, if
+ GL_COLOR_ARRAY
+ is enabled, the value of the current color is undefined after
+ glDrawArrays
+ executes. Attributes that aren't modified remain well defined.
GL_INVALID_ENUM
is generated if
+ mode
is not an accepted value.
GL_INVALID_VALUE
is generated if
+ count
is negative.
+ glClientActiveTexture, + glColorPointer, + glDrawElements, + glNormalPointer, + glTexCoordPointer, + glVertexPointer +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDrawElements — render primitives from array data
void glDrawElements( | GLenum mode, |
GLsizei count, | |
GLenum type, | |
const GLvoid * indices) ; |
mode
+ Specifies what kind of primitives to render.
+ Symbolic constants
+ GL_POINTS
,
+ GL_LINE_STRIP
,
+ GL_LINE_LOOP
,
+ GL_LINES
,
+ GL_TRIANGLE_STRIP
,
+ GL_TRIANGLE_FAN
, and
+ GL_TRIANGLES
are accepted.
count
+ Specifies the number of elements to be rendered.
type
+ Specifies the type of the values in
+ indices
. Must be either
+ GL_UNSIGNED_BYTE
or
+ GL_UNSIGNED_SHORT
.
indices
+ Specifies a pointer to the location where the + indices are stored.
+ glDrawElements
+
+ specifies multiple geometric primitives with very few
+ subroutine calls. You can prespecify separate arrays of
+ vertices, normals, colors, and texture coordinates and use them
+ to construct a sequence of primitives with a single call to
+ glDrawElements
.
When glDrawElements
is called, it uses
+ count
sequential indices from
+ indices
+ to lookup elements in enabled arrays to construct a sequence of
+ geometric primitives.
+ mode
+ specifies what kind of primitives are constructed, and how the
+ array elements construct these primitives. If
+ GL_VERTEX_ARRAY
+ is not enabled, no geometric primitives are constructed.
Vertex attributes that are modified by
+ glDrawElements
have an unspecified value after
+ glDrawElements
+ returns. For example, if GL_COLOR_ARRAY
+ is enabled, the value of the current color is undefined after
+ glDrawElements
+ executes. Attributes that aren't modified maintain their
+ previous values.
GL_INVALID_ENUM
is generated if
+ mode
is not an accepted value.
GL_INVALID_ENUM
is generated if
+ type
is not an accepted value.
GL_INVALID_VALUE
is generated if
+ count
is negative.
+ glClientActiveTexture, + glColorPointer, + glDrawArrays, + glNormalPointer, + glTexCoordPointer, + glVertexPointer
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glEnable — enable or disable server-side GL capabilities
void glEnable( | GLenum cap) ; |
void glDisable( | GLenum cap) ; |
glEnable
and glDisable
+ enable and disable various capabilities. Use
+ glIsEnabled or
+ glGet to determine the
+ current setting of any capability. The initial value for
+ each capability with the exception of
+ GL_DITHER
and
+ GL_MULTISAMPLE
is
+ GL_FALSE
. The initial value for
+ GL_DITHER
and
+ GL_MULTISAMPLE
is
+ GL_TRUE
.
Both glEnable
and glDisable
+ take a single argument, cap
,
+ which can assume one of the following values:
GL_ALPHA_TEST
+ If enabled, do alpha testing. See + glAlphaFunc.
GL_BLEND
+ If enabled, blend the computed fragment color values + with the values in the color buffers. See + glBlendFunc.
GL_COLOR_LOGIC_OP
+ If enabled, apply the currently selected logical + operation to the computed fragment color and color buffer values. See + glLogicOp.
GL_CLIP_PLANE
i
+ If enabled, clip geometry against user-defined clipping plane + i. See + glClipPlane.
GL_COLOR_MATERIAL
+ If enabled, have ambient and diffuse material + parameters track the current color.
GL_CULL_FACE
+ If enabled, cull polygons based on their winding in + window coordinates. See + glCullFace.
GL_DEPTH_TEST
+ If enabled, do depth comparisons and update the + depth buffer. Note that even if the depth buffer exists + and the depth mask is non-zero, the depth buffer is not + updated if the depth test is disabled. See + glDepthFunc + and + glDepthRange.
GL_DITHER
+ If enabled, dither color components + before they are written to the color buffer.
GL_FOG
+ If enabled, blend a fog color into the + posttexturing color. See + glFog.
GL_LIGHT
i
+ If enabled, include light i
+ in the evaluation of the lighting equation. See
+ glLightModel
+ and
+ glLight.
GL_LIGHTING
+ If enabled, use the current lighting parameters to + compute the vertex color. Otherwise, simply + associate the current color with each vertex. See + glMaterial, + glLightModel, and + glLight.
GL_LINE_SMOOTH
+ If enabled, draw lines with correct filtering. + Otherwise, draw aliased lines. See + glLineWidth.
GL_MULTISAMPLE
+ If enabled, use multiple fragment samples in computing the final color + of a pixel. See + glSampleCoverage.
GL_NORMALIZE
+ If enabled, normal vectors are normalized to unit length after
+ transformation and before lighting. This method is generally
+ less efficient than GL_RESCALE_NORMAL
. See
+ glNormal and
+ glNormalPointer.
GL_POINT_SMOOTH
+ If enabled, draw points with proper filtering. + Otherwise, draw aliased points. See + glPointSize.
GL_POINT_SPRITE_OES
+ + If enabled, point sprites are enabled. + See + glPointSize + and + glTexEnv +
GL_POLYGON_OFFSET_FILL
+ If enabled, + an offset is added to depth values of a polygon's + fragments before the depth comparison is performed. See + glPolygonOffset.
GL_RESCALE_NORMAL
+ If enabled, normal vectors are scaled after transformation and before
+ lighting by a factor computed from the modelview matrix. If the modelview
+ matrix scales space uniformly, this has the effect of restoring the
+ transformed normal to unit length. This method is generally more efficient than
+ GL_NORMALIZE
. See
+ glNormal and
+ glNormalPointer.
GL_SAMPLE_ALPHA_TO_COVERAGE
+ If enabled, compute a temporary coverage value where each bit is + determined by the alpha value at the corresponding sample location. The + temporary coverage value is then ANDed with the fragment coverage value.
GL_SAMPLE_ALPHA_TO_ONE
+ If enabled, each sample alpha value is replaced by the maximum + representable alpha value.
GL_SAMPLE_COVERAGE
+ If enabled, the fragment's coverage is ANDed with the temporary
+ coverage value. If GL_SAMPLE_COVERAGE_INVERT
is set to
+ GL_TRUE
, invert the coverage value. See
+ glSampleCoverage.
GL_SCISSOR_TEST
+ If enabled, discard fragments that are outside the + scissor rectangle. See + glScissor.
GL_STENCIL_TEST
+ If enabled, do stencil testing and update the + stencil buffer. See + glStencilFunc, + glStencilMask, + and + glStencilOp.
GL_TEXTURE_2D
+ If enabled, two-dimensional texturing is performed + for the active texture unit. See + glActiveTexture, + glTexImage2D, + glCompressedTexImage2D, + and + glCopyTexImage2D.
+ GL_CLIP_PLANE
i and
+ GL_POINT_SPRITE_OES
are only supported if the GL version is
+ 1.1 or greater.
+
+ glActiveTexture, + glAlphaFunc, + glBlendFunc, + glClipPlane, + glCompressedTexImage2D, + glCopyTexImage2D, + glCullFace, + glDepthFunc, + glDepthRange, + glEnableClientState, + glFog, + glGet, + glIsEnabled, + glLight, + glLightModel, + glLineWidth, + glLogicOp, + glMaterial, + glNormal, + glPointSize, + glPolygonOffset, + glSampleCoverage, + glScissor, + glStencilFunc, + glStencilOp, + glTexEnv, + glTexImage2D +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glEnableClientState — enable or disable client-side capability
void glEnableClientState( | GLenum array) ; |
void glDisableClientState( | GLenum array) ; |
array
+
+ Specifies the capability to enable or disable.
+ Symbolic constants
+ GL_COLOR_ARRAY
,
+
+ GL_NORMAL_ARRAY
,
+ GL_POINT_SIZE_ARRAY_OES
,
+ GL_TEXTURE_COORD_ARRAY
, and
+ GL_VERTEX_ARRAY
+
+ are accepted.
+
+ glEnableClientState
and
+ glDisableClientState
+ enable or disable individual client-side capabilities. By
+ default, all client-side capabilities are disabled. Both
+ glEnableClientState
and
+ glDisableClientState
+ take a single argument, array
,
+ which can assume one of the following values:
GL_COLOR_ARRAY
+ If enabled, the color array is enabled for writing + and used during rendering when + glDrawArrays, or + glDrawElements is called. See + glColorPointer.
GL_NORMAL_ARRAY
+ If enabled, the normal array is enabled for writing + and used during rendering when + glDrawArrays, or + glDrawElements is called. See + glNormalPointer.
GL_POINT_SIZE_ARRAY_OES
+ + If enabled, the point size array controls the sizes used + to render points and point sprites. In this case the point + size defined by glPointSize + is ignored. + The point sizes supplied in the point size arrays will be + the sizes used to render both points and point sprites. + See glPointSize +
GL_TEXTURE_COORD_ARRAY
+ If enabled, the texture coordinate array is enabled + for writing and used during rendering when + glDrawArrays, or + glDrawElements is called. See + glTexCoordPointer.
GL_VERTEX_ARRAY
+ If enabled, the vertex array is enabled for writing + and used during rendering when + glDrawArrays, or + glDrawElements is called. See + glVertexPointer.
Enabling and disabling
+ GL_TEXTURE_COORD_ARRAY
+ affects the active client texture unit. The active client
+ texture unit is controlled with
+ glClientActiveTexture.
+ glClientActiveTexture, + glColorPointer, + glDrawArrays, + glDrawElements, + glEnable, + glNormalPointer, + glTexCoordPointer, + glVertexPointer +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glFinish — block until all GL execution is complete
void glFinish( | void) ; |
+ glFinish
does not return until the effects
+ of all previously called GL commands are complete. Such effects
+ include all changes to GL client and server state as well as all
+ changes to the frame buffer contents.
+ glFinish
is NOT required before a call
+ to eglSwapBuffers
+ or glReadPixels.
+ glFinish
can take some time and for
+ performance reasons it is best to use this function
+ infrequently and only when necessary.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glFlush — force execution of GL commands in finite time
void glFlush( | void) ; |
Different GL implementations may buffer commands in
+ several different locations, including the GL client, the GL
+ server, and the graphics accelerator.
+ glFlush
empties all of these buffers,
+ causing all issued commands to be executed as quickly as they
+ are accepted by the actual rendering engine. Though this
+ execution may not be completed in any particular time period, it
+ does complete in finite time.
Because any GL program might be on an implementation that
+ buffers commands, all programs should call
+ glFlush
whenever they count on having all
+ of their previously issued commands completed. For example, call
+ glFlush
before waiting for user input that
+ depends on the generated image.
+ glFlush
+ can return at any time. It does not wait until the execution of
+ all previously issued GL commands is complete.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glFog — specify fog parameters
void glFogf( | GLenum pname, |
GLfloat param) ; |
void glFogx( | GLenum pname, |
GLfixed param) ; |
pname
+ Specifies a single-valued fog parameter.
+ GL_FOG_MODE
,
+ GL_FOG_DENSITY
,
+ GL_FOG_START
, and
+ GL_FOG_END
are accepted.
param
+ Specifies the value that
+ pname
+
+ will be set to.
void glFogfv( | GLenum pname, |
const GLfloat * params) ; |
void glFogxv( | GLenum pname, |
const GLfixed * params) ; |
pname
+ Specifies a fog parameter.
+ GL_FOG_MODE
,
+ GL_FOG_DENSITY
,
+ GL_FOG_START
,
+ GL_FOG_END
, and
+ GL_FOG_COLOR
are accepted.
params
+ Specifies the value or values to be assigned to
+ pname
.
+ GL_FOG_COLOR
+ requires an array of four values. All other parameters
+ accept an array containing only a single value.
If fog is enabled, fog affects
+ rasterized geometry, bitmaps, and pixel blocks, but not buffer
+ clear operations. To enable and disable fog, call
+ glEnable and
+ glDisable
+ with argument GL_FOG
.
+ Fog is initially disabled.
+
+ glFog
assigns the value or values in
+ params
to the fog parameter specified by
+ pname
. The following values are accepted for
+ pname
:
GL_FOG_MODE
+
+ params
+ is a single fixed-point or floating-point value that
+ specifies the equation to be used to compute the fog
+ blend factor f
.
+ Three symbolic constants are accepted:
+ GL_LINEAR
,
+ GL_EXP
, and
+ GL_EXP2
.
+ The equations corresponding to these symbolic constants
+ are defined below. The initial fog mode is
+ GL_EXP
.
GL_FOG_DENSITY
+
+ params
+ is a single fixed-point or floating-point value that
+ specifies density
,
+ the fog density used in both exponential fog equations.
+ Only nonnegative densities are accepted. The initial fog
+ density is 1.
GL_FOG_START
+
+ params
+ is a single fixed-point or floating-point value that
+ specifies start
,
+ the near distance used in the linear fog equation. The
+ initial near distance is 0.
GL_FOG_END
+
+ params
+ is a single fixed-point or floating-point value that
+ specifies end
,
+ the far distance used in the linear fog equation. The
+ initial far distance is 1.
GL_FOG_COLOR
+
+ params
+ contains four fixed-point or floating-point values that specify
+
Fog blends a fog color with each rasterized pixel
+ fragment's posttexturing color using a blending factor
+ f
. Factor f
+ is computed in one of three ways, depending on the fog mode.
+ Let z
+ be the distance in eye coordinates from the origin to the
+ fragment being fogged. The equation for GL_LINEAR
+ fog is
The equation for GL_EXP
fog is
The equation for GL_EXP2
fog is
Regardless of the fog mode, f
+ is clamped to the range [0, 1] after it is computed. Then,
+ the fragment's red, green, and blue colors, represented by
+
Fog does not affect a fragment's alpha component.
GL_INVALID_ENUM
is generated if
+ pname
is not an accepted value, or if
+ pname
is
+ GL_FOG_MODE
and
+ params
is not an accepted value.
GL_INVALID_VALUE
is generated if
+ pname
is
+ GL_FOG_DENSITY
, and
+ params
is negative.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glFrontFace — define front- and back-facing polygons
void glFrontFace( | GLenum mode) ; |
mode
+ Specifies the orientation of front-facing polygons.
+ GL_CW
and
+ GL_CCW
are accepted. The initial value is
+ GL_CCW
.
In a scene composed entirely of opaque closed surfaces,
+ back-facing polygons are never visible. Eliminating (culling) these
+ invisible polygons has the obvious benefit of speeding up the
+ rendering of the image. To enable and disable culling, call
+ glEnable and
+ glDisable
+ with argument GL_CULL_FACE
.
+ Culling is initially disabled.
+
The projection of a polygon to window coordinates is said
+ to have clockwise winding if an imaginary object following the
+ path from its first vertex, its second vertex, and so on, to
+ its last vertex, and finally back to its first vertex, moves in
+ a clockwise direction about the interior of the polygon. The
+ polygon's winding is said to be counterclockwise if the
+ imaginary object following the same path moves in a
+ counterclockwise direction about the interior of the polygon.
+ glFrontFace
+ specifies whether polygons with clockwise winding in window
+ coordinates, or counterclockwise winding in window coordinates,
+ are taken to be front-facing. Passing
+ GL_CCW
to mode
+ selects counterclockwise polygons as front-facing.
+ GL_CW
+ selects clockwise polygons as front-facing. By default,
+ counterclockwise polygons are taken to be front-facing.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glFrustum — multiply the current matrix by a perspective matrix
void glFrustumf( | GLfloat left, |
GLfloat right, | |
GLfloat bottom, | |
GLfloat top, | |
GLfloat near, | |
GLfloat far) ; |
void glFrustumx( | GLfixed left, |
GLfixed right, | |
GLfixed bottom, | |
GLfixed top, | |
GLfixed near, | |
GLfixed far) ; |
left
,
+ right
+ Specify the coordinates for the left and right + vertical clipping planes.
bottom
,
+ top
+ Specify the coordinates for the bottom and top + horizontal clipping planes.
near
,
+ far
+ Specify the distances to the near and far depth + clipping planes. Both distances must be positive.
glFrustum
+ describes a perspective matrix that produces a perspective
+ projection. The current matrix (see
+ glMatrixMode)
+ is multiplied by this matrix and the result replaces the
+ current matrix, as if
+ glMultMatrix
+ were called with the following matrix as its argument:
+
+
+
+
+
+
+
+
+
+
Typically, the matrix mode is
+ GL_PROJECTION
, and
+ (left
, bottom
,
+ -near
) and
+ (right
, top
,
+ -near
)
+ specify the points on the near clipping plane that are mapped
+ to the lower left and upper right corners of the window,
+ assuming that the eye is located at (0, 0, 0).
+ -far
+ specifies the location of the far clipping plane. Both
+ near
and
+ far
must be positive.
Use + glPushMatrix + and + glPopMatrix + to save and restore the current matrix stack.
Depth buffer precision is affected by the values
+ specified for near
and
+ far
. The greater the ratio of
+ far
to
+ near
+ is, the less effective the depth buffer will be at
+ distinguishing between surfaces that are near each other. If
roughly
+ r
approaches infinity as
+ near
approaches 0,
+ near
must never be set to 0.
+ GL_INVALID_VALUE
is generated if
+ near
or far
+ is not positive, or if
+ left
= right
, or
+ bottom
= top
, or
+ near
= far
.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGenBuffers — generate buffer object names
void glGenBuffers( | GLsizei n, |
GLuint * buffers) ; |
n
+ Specifies the number of buffer object names to be generated.
buffers
+ Specifies an array in which the generated + buffer object names are stored.
glGenBuffers
returns
+ n
buffer object names in
+ buffers
. There is no guarantee that the names form a
+ contiguous set of integers; however, it is guaranteed that none of the names
+ was in use immediately before the call to glGenBuffers
.
Buffer object names returned by a call to glGenBuffers
+ are not returned by subsequent calls, unless they are first deleted with
+ glDeleteBuffers.
No buffer objects are associated with the returned buffer object names + until they are first bound by calling + glBindBuffer.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGenTextures — generate texture names
void glGenTextures( | GLsizei n, |
GLuint * textures) ; |
n
+ Specifies the number of texture names to be generated.
textures
+ Specifies an array in which the generated texture + names are stored.
glGenTextures
returns
+ n
texture names in
+ textures
.
+ There is no guarantee that the names form a contiguous set of
+ integers. However, it is guaranteed that none of the returned
+ names was in use immediately before the call to
+ glGenTextures
.
The generated textures have no dimensionality; they + assume the dimensionality of the texture target to which they + are first bound (see + glBindTexture).
Texture names returned by a call to
+ glGenTextures
+ are not returned by subsequent calls, unless they are first deleted with
+ glDeleteTextures.
+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glTexImage2D, + glTexParameter +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGet — return the value or values of a selected parameter
void glGetBooleanv( | GLenum pname, |
GLboolean * params) ; |
void glGetFixedv( | GLenum pname, |
GLfixed * params) ; |
void glGetFloatv( | GLenum pname, |
GLfloat * params) ; |
void glGetIntegerv( | GLenum pname, |
GLint * params) ; |
pname
+ Specifies the parameter value to be returned. The + symbolic constants in the list below are accepted.
params
+ Returns the value or values of the specified parameter.
+ These commands return values for static state variables in GL.
+ pname
+ is a symbolic constant indicating the static state variable to
+ be returned, and params
+ is a pointer to an array of the indicated type in which to place the
+ returned data.
+ If a Get command is issued that returns value types different from the type of the
+ value being obtained, a type conversion is performed.
+ If GetBooleanv is called, a floating-point or integer value converts to GL_FALSE
+ if and only if it is zero
(otherwise it converts to GL_TRUE
).
+ If GetIntegerv is called, a boolean value is interpreted as either 1
+ or 0
, and a floating-point value is rounded to the nearest integer,
+ unless the value is an RGBA color component, a DepthRange value, a depth buffer clear value, or a normal coordinate.
+ In these cases, the Get command does a linear mapping that maps 1.0
to the most positive representable
+ integer value, and -1.0
to the most negative representable integer value.
+ If GetFloatv is called, a boolean value is interpreted as either 1.0
or 0.0
, an integer
+ is coerced to floating-point. If a value is so large in magnitude that it cannot be represented with
+ the requested type, then the nearest value representable using the requested type is returned.
+
The following symbolic constants are accepted by
+ pname
:
GL_ACTIVE_TEXTURE
+ params
returns a single value indicating the active multitexture unit.
+ The initial value is GL_TEXTURE0
.
+ See glActiveTexture.
+
GL_ALIASED_POINT_SIZE_RANGE
+
+ params
+ returns two values,
+ the smallest and largest supported sizes for
+ aliased points. The range must include 1
.
+ See glPointSize.
+
GL_ALIASED_LINE_WIDTH_RANGE
+
+ params
+ returns two values,
+ the smallest and largest supported widths for
+ aliased lines. The range must include 1
.
+ See glLineWidth.
+
GL_ALPHA_BITS
+
+ params
+ returns one value,
+ the number of alpha bitplanes in the
+ color buffer.
+
GL_ALPHA_TEST
+
+ params
returns a single boolean value indicating whether alpha
+ testing of fragments is enabled. The initial value is GL_FALSE
.
+ See glAlphaFunc.
+
GL_ALPHA_TEST_FUNC
+
+ params
+ returns one value,
+ the symbolic name of the alpha test function.
+ See glAlphaFunc.
+
GL_ALPHA_TEST_REF
+
+ params
+ returns one value,
+ the reference value for the alpha test.
+ An integer value, if requested, is linearly mapped from
+ the internal floating-point representation such that 1.0
+ returns the most positive representable integer value, and -1.0
+ returns the most negative representable integer value.
+ See glAlphaFunc.
+
GL_ARRAY_BUFFER_BINDING
+
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_ARRAY_BUFFER
. If no buffer object
+ is bound to this target, 0
is returned. The initial value is 0
.
+ See glBindBuffer.
+
GL_BLEND
+
+ params
returns a single boolean value indicating whether
+ blending of fragments is enabled. The initial value is GL_FALSE
.
+ See glBlendFunc and
+ glLogicOp.
+
GL_BLEND_DST
+
+ params
+ returns one value,
+ the symbolic constant identifying the destination blend function.
+ See glBlendFunc.
+
GL_BLEND_SRC
+
+ params
+ returns one value,
+ the symbolic constant identifying the source blend function.
+ See glBlendFunc.
+
GL_BLUE_BITS
+
+ params
+ returns one value,
+ the number of blue bitplanes in the
+ color buffer.
+
GL_CLIENT_ACTIVE_TEXTURE
+ params
returns a single value indicating the current
+ client active multitexture unit.
+ The initial value is GL_TEXTURE0
.
+ See glClientActiveTexture.
+
GL_CLIP_PLANE
i
+
+ params
returns a single boolean value indicating whether the
+ ith user clipping plane is enabled. The initial value is GL_FALSE
.
+ See glClipPlane.
+
GL_COLOR_ARRAY
+
+ params
returns a single boolean value indicating whether
+ the color array is enabled. The initial value is GL_FALSE
.
+ See glColorPointer.
+
GL_COLOR_ARRAY_BUFFER_BINDING
+
+ params
+ returns one value,
+ the color array buffer binding.
+ See glColorPointer.
+
GL_COLOR_ARRAY_SIZE
+
+ params
+ returns one value,
+ the number of components per color in the color array.
+ See glColorPointer.
+
GL_COLOR_ARRAY_STRIDE
+
+ params
+ returns one value,
+ the byte offset between consecutive colors in the color array.
+ See glColorPointer.
+
GL_COLOR_ARRAY_TYPE
+
+ params
+ returns one value,
+ returns the data type of each component in the color array.
+ See glColorPointer.
+
GL_COLOR_CLEAR_VALUE
+
+ params
+ returns four values:
+ the red
, green
,
+ blue
, and alpha
+ values used to clear the color buffers.
+ See glClearColor.
+
GL_COLOR_LOGIC_OP
+
+ params
returns a single boolean value indicating whether
+ logical operation on color values is enabled. The initial value is GL_FALSE
.
+ See glLogicOp.
+
GL_COLOR_MATERIAL
+
+ params
returns a single boolean value indicating whether
+ color material tracking is enabled. The initial value is GL_FALSE
.
+ See glMaterial.
+
GL_COLOR_WRITEMASK
+
+ params
+ returns four boolean values:
+ the red
, green
,
+ blue
, and alpha
+ write enables for the color buffers.
+ See glColorMask.
+
GL_COMPRESSED_TEXTURE_FORMATS
+
+ params
returns
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS
+ values, the supported compressed texture formats.
+ See
+ glCompressedTexImage2D
+ and
+ glCompressedTexSubImage2D.
+
GL_CULL_FACE
+ params
returns a single boolean value indicating whether polygon culling
+ is enabled. The initial value is GL_FALSE
.
+ See glCullFace.
+
GL_CULL_FACE_MODE
+ params
returns one value,
+ a symbolic constant indicating which polygon faces are to be
+ culled. The initial value is GL_BACK
.
+ See glCullFace.
+
GL_CURRENT_COLOR
+ params
returns four values:
+ the red, green, blue, and alpha values of the current color.
+ Integer values,
+ if requested,
+ are linearly mapped from the internal floating-point representation such
+ that 1.0 returns the most positive representable integer value,
+ and
+
GL_CURRENT_NORMAL
+ params
returns three values:
+ the x, y, and z values of the current normal.
+ Integer values,
+ if requested,
+ are linearly mapped from the internal floating-point representation such
+ that 1.0 returns the most positive representable integer value,
+ and
+
GL_CURRENT_TEXTURE_COORDS
+ params
returns four values:
+ the s, t, r, and q current texture
+ coordinates. The initial value is (0, 0, 0, 1).
+ See glMultiTexCoord.
+
GL_DEPTH_BITS
+ params
+ returns one value, the number of bitplanes in the depth
+ buffer.
GL_DEPTH_CLEAR_VALUE
+
+ params
+ returns one value,
+ the value that is used to clear the depth buffer.
+ See glClearDepth.
+
GL_DEPTH_FUNC
+
+ params
+ returns one value,
+ the symbolic name of the depth comparision function.
+ See glDepthFunc.
+
GL_DEPTH_RANGE
+
+ params
+ returns two values:
+ the near and far mapping limits for the depth buffer.
+ See glDepthRange.
+
GL_DEPTH_TEST
+
+ params
returns a single boolean value indicating whether depth testing
+ of fragments is enabled. The initial value is GL_FALSE
.
+ See glDepthFunc and glDepthRange.
+
GL_DEPTH_WRITEMASK
+
+ params
+ returns a single boolean value
+ indicating if the depth buffer is enabled for writing.
+ See glDepthMask.
+
GL_ELEMENT_ARRAY_BUFFER_BINDING
+
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_ELEMENT_ARRAY_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned. The initial value is 0
.
+ See glBindBuffer.
+
GL_FOG
+
+ params
returns a single boolean value indicating whether fog
+ is enabled. The initial value is GL_FALSE
.
+ See glFog.
+
GL_FOG_COLOR
+
+ params
+ returns four values:
+ the red
, green
,
+ blue
, and alpha
+ components of the fog color.
+ See glFog.
+
GL_FOG_DENSITY
+
+ params
+ returns one value,
+ the fog density parameter.
+ See glFog.
+
GL_FOG_END
+
+ params
+ returns one value,
+ the end factor for the linear fog equation.
+ See glFog.
+
GL_FOG_HINT
+
+ params
+ returns one value,
+ a symbolic constant indicating the mode of the fog hint.
+ See glHint.
+
GL_FOG_MODE
+
+ params
+ returns one value,
+ a symbolic constant indicating which fog equation is selected.
+ See glFog.
+
GL_FOG_START
+
+ params
+ returns one value,
+ the start factor for the linear fog equation.
+ See glFog.
+
GL_FRONT_FACE
+
+ params
+ returns one value,
+ a symbolic constant indicating whether clockwise or
+ counterclockwise polygon winding is treated as front-facing.
+ See glFrontFace.
+
GL_GREEN_BITS
+ params
+ returns one value, the number of green bitplanes in the
+ color buffer.
GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
+ params
+ returns one value, the preferred format for pixel read back. See
+ glReadPixels.
GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
+ params
+ returns one value, the preferred type for pixel read back. See
+ glReadPixels.
GL_LIGHT_MODEL_AMBIENT
+
+ params
+ returns four values:
+ the red
, green
,
+ blue
, and alpha
+ components of the ambient intensity of the entire scene.
+ See glLightModel.
+
GL_LIGHT_MODEL_TWO_SIDE
+
+ params
+ returns a single boolean value
+ indicating whether separate materials are used to compute
+ lighting for front and back facing polygons.
+ See glLightModel.
+
GL_LIGHT
i
+
+ params
returns a single boolean value indicating whether the
+ ith light is enabled. The initial value is GL_FALSE
.
+ See glLight and
+ glLightModel.
+
GL_LIGHTING
+
+ params
returns a single boolean value indicating whether lighting
+ is enabled. The initial value is GL_FALSE
.
+ See glLight,
+ glLightModel, and
+ glMaterial.
+
GL_LINE_SMOOTH
+
+ params
returns a single boolean value indicating whether line
+ antialiasing is enabled. The initial value is GL_FALSE
.
+ See glLineWidth.
+
GL_LINE_SMOOTH_HINT
+
+ params
+ returns one value,
+ a symbolic constant indicating the mode of the line antialiasing hint.
+ See glHint.
+
GL_LINE_WIDTH
+
+ params
+ returns one value,
+ the line width as specified with
+ glLineWidth.
+
GL_LOGIC_OP_MODE
+
+ params
+ returns one value,
+ a symbolic constant indicating the selected logic operation mode.
+ See glLogicOp.
+
GL_MATRIX_MODE
+
+ params
+ returns one value,
+ a symbolic constant indicating which matrix stack is currently the
+ target of all matrix operations.
+ See glMatrixMode.
+
GL_MAX_CLIP_PLANES
+
+ params
+ returns one value,
+ the maximum number of application defined clipping planes.
+ The value must be at least 6
.
+ See glClipPlane.
+
GL_MAX_LIGHTS
+ params
+ returns one value, the maximum number of lights. The
+ value must be at least 8. See
+ glLight.
GL_MAX_MODELVIEW_STACK_DEPTH
+
+ params
+ returns one value,
+ the maximum supported depth of the
+ modelview matrix stack.
+ The value must be at least 16
.
+ See glPushMatrix.
+
GL_MAX_PROJECTION_STACK_DEPTH
+ params
+ returns one value, the maximum supported depth of the
+ projection matrix stack. The value must be at least 2.
+ See
+ glPushMatrix.
GL_MAX_TEXTURE_SIZE
+ params
+ returns one value. The value gives a rough estimate of the largest
+ texture that the GL can handle. The value must be at least 64.
+ See
+ glTexImage2D,
+ glCompressedTexImage2D, and
+ glCopyTexImage2D.
GL_MAX_TEXTURE_STACK_DEPTH
+ params
+ returns one value, the maximum supported depth of the
+ texture matrix stack. The value must be at least 2. See
+ glPushMatrix.
GL_MAX_TEXTURE_UNITS
+ params
+ returns a single value indicating the number of texture
+ units supported. The value must be at least 1. See
+ glActiveTexture,
+ glClientActiveTexture
+ and
+ glMultiTexCoord.
GL_MAX_VIEWPORT_DIMS
+ params
+ returns two values: the maximum supported width and
+ height of the viewport. These must be at least as large
+ as the visible dimensions of the display being rendered
+ to. See
+ glViewport.
GL_MODELVIEW_MATRIX
+
+ params
+ returns sixteen values:
+ the modelview matrix on the top of the modelview matrix stack.
+ See glPushMatrix.
+
GL_MODELVIEW_STACK_DEPTH
+
+ params
+ returns one value,
+ the number of matrices on the modelview matrix stack.
+ See glPushMatrix.
+
GL_MULTISAMPLE
+
+ params
returns a single boolean value indicating whether multisampling
+ is enabled. The initial value is GL_TRUE
.
+
GL_NORMAL_ARRAY
+
+ params
returns a single boolean value indicating whether
+ the normal array is enabled. The initial value is GL_FALSE
.
+ See glNormalPointer.
+
GL_NORMAL_ARRAY_BUFFER_BINDING
+
+ params
+ returns one value,
+ the normal array buffer binding.
+ See glNormalPointer.
+
GL_NORMAL_ARRAY_STRIDE
+
+ params
+ returns one value,
+ the byte offset between consective normals in the normal array.
+ See glNormalPointer.
+
GL_NORMAL_ARRAY_TYPE
+
+ params
+ returns one value,
+ the data type of each normal in the normal array.
+ See glNormalPointer.
+
GL_NORMALIZE
+
+ params
returns a single boolean value indicating whether
+ normalization of normals is enabled. The initial value is GL_FALSE
.
+ See glNormal.
+
GL_NUM_COMPRESSED_TEXTURE_FORMATS
+
+ params
+ returns one value,
+ the number of supportex compressed
+ texture formats.
+ The value must be at least 10
.
+ See
+ glCompressedTexImage2D
+ and
+ glCompressedTexSubImage2D.
GL_PACK_ALIGNMENT
+
+ params
+ returns one value,
+ the byte alignment used for writing pixel data to memory.
+ See glPixelStorei.
+
GL_PERSPECTIVE_CORRECTION_HINT
+
+ params
+ returns one value,
+ a symbolic constant indicating the mode of the perspective correction hint.
+ See glHint.
+
GL_POINT_DISTANCE_ATTENUATION
+
+ params
+ returns three values, the distance attenuation function coefficients a,
+ b, and c. The initial value is (1, 0, 0). See
+ glPointParameter.
+
GL_POINT_FADE_THRESHOLD_SIZE
+
+ params
+ returns one value, the point fade threshold. The initial value is 1
. See
+ glPointParameter.
+
GL_POINT_SIZE
+
+ params
+ returns one value,
+ the point size as specified by
+ glPointSize.
+
GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES
+
+ params
+ returns one value,
+ the point size array buffer binding.
+ See glPointSizePointerOES.
+
GL_POINT_SIZE_ARRAY_OES
+
+ params
returns a single boolean value indicating whether the point
+ size array is enabled. The initial value is GL_FALSE
.
+ See glPointSizePointerOES.
+
GL_POINT_SIZE_ARRAY_STRIDE_OES
+
+ params
+ returns one value,
+ the byte offset between consecutive point sizes in the point size array.
+ See glPointSizePointerOES.
+
GL_POINT_SIZE_ARRAY_TYPE_OES
+
+ params
+ returns one value,
+ the data type of each point size in the point array.
+ See glPointSizePointerOES.
+
GL_POINT_SIZE_MAX
+
+ params
+ returns one value,
+ the upper bound to which the derived point size is
+ clamped. The initial value is the maximum of the implementation dependent max
+ aliased and smooth point sizes. See
+ glPointParameter.
+
GL_POINT_SIZE_MIN
+
+ params
+ returns one value,
+ the lower bound to which the derived point size is
+ clamped. The initial value is 0
. See
+ glPointParameter.
+
GL_POINT_SMOOTH
+
+ params
returns a single boolean value indicating whether point
+ antialiasing is enabled. The initial value is GL_FALSE
.
+ See glPointSize.
+
GL_POINT_SMOOTH_HINT
+
+ params
+ returns one value,
+ a symbolic constant indicating the mode of the point antialiasing hint.
+ See glHint.
+
GL_POINT_SPRITE_OES
+
+ params
returns a single boolean value indicating whether point
+ sprites are enabled. The initial value is GL_FALSE
.
+ See glTexEnv.
+
GL_POLYGON_OFFSET_FACTOR
+
+ params
+ returns one value,
+ the scaling factor used to determine the variable offset that is added
+ to the depth value of each fragment generated when a polygon is rasterized.
+ See glPolygonOffset.
+
GL_POLYGON_OFFSET_FILL
+
+ params
returns a single boolean value indicating whether polygon offset
+ is enabled for polygons in fill mode. The initial value is GL_FALSE
.
+ See glPolygonOffset.
+
GL_POLYGON_OFFSET_UNITS
+
+ params
+ returns one value.
+ This value is multiplied by an implementation-specific value and
+ then added to the depth value of each fragment generated when a
+ polygon is rasterized.
+ See glPolygonOffset.
+
GL_PROJECTION_MATRIX
+
+ params
+ returns sixteen values:
+ the projection matrix on the top of the projection matrix stack.
+ See glPushMatrix.
+
GL_PROJECTION_STACK_DEPTH
+
+ params
+ returns one value,
+ the number of matrices on the projection matrix stack.
+ See glPushMatrix.
+
GL_RED_BITS
+
+ params
+ returns one value,
+ the number of red bitplanes in each color buffer.
+
GL_RESCALE_NORMAL
+
+ params
returns a single boolean value indicating whether
+ rescaling of normals is enabled. The initial value is GL_FALSE
.
+ See glNormal.
+
GL_SAMPLE_ALPHA_TO_COVERAGE
+ params
returns a single boolean value indicating if the
+ fragment coverage value should be ANDed with a temporary coverage value based
+ on the fragment's alpha value. The initial value is GL_FALSE
.
+ See glSampleCoverage.
+
GL_SAMPLE_ALPHA_TO_ONE
+ params
returns a single boolean value indicating if the
+ fragment's alpha value should be replaced by the maximum representable alpha value
+ after coverage determination. The initial value is GL_FALSE
.
+ See glSampleCoverage.
+
GL_SAMPLE_BUFFERS
+ params
returns a single integer value indicating the number of sample buffers
+ associated with the currently bound framebuffer.
+ See glSampleCoverage.
+
GL_SAMPLE_COVERAGE
+ params
returns a single boolean value indicating if the
+ fragment coverage value should be ANDed with a temporary coverage value based
+ on the current sample coverage value. The initial value is GL_FALSE
.
+ See glSampleCoverage.
+
GL_SAMPLE_COVERAGE_INVERT
+ params
returns a single boolean value indicating if the temporary
+ coverage value should be inverted.
+ See glSampleCoverage.
+
GL_SAMPLE_COVERAGE_VALUE
+ params
returns a single positive floating-point value indicating the
+ current sample coverage value.
+ See glSampleCoverage.
+
GL_SAMPLES
+ params
returns a single integer value
+ indicating the coverage mask size of the currently bound framebuffer.
+ See glSampleCoverage.
+
GL_SCISSOR_BOX
+
+ params
+ returns four values:
+ the x
and y
window coordinates of the scissor box,
+ followed by its width
and height
.
+ See glScissor.
+
GL_SCISSOR_TEST
+ params
returns a single boolean value indicating whether scissoring is
+ enabled. The initial value is GL_FALSE
.
+ See glScissor.
+
GL_SHADE_MODEL
+
+ params
+ returns one value,
+ a symbolic constant indicating whether the shading mode is
+ flat or smooth.
+ See glShadeModel.
+
GL_SMOOTH_LINE_WIDTH_RANGE
+
+ params
+
+ returns two values, the smallest and largest supported
+ widths for antialiased lines. The range must include 1. See
+ glLineWidth.
GL_SMOOTH_POINT_SIZE_RANGE
+ params
+ returns two values, the smallest and largest supported
+ widths for antialiased points. The range must include 1. See
+ glPointSize.
GL_STENCIL_BITS
+ params
+ returns one value, the number of bitplanes in the stencil
+ buffer.
GL_STENCIL_CLEAR_VALUE
+
+ params
+ returns one value,
+ the index to which the stencil bitplanes are cleared.
+ See glClearStencil.
+
GL_STENCIL_FAIL
+
+ params
+ returns one value,
+ a symbolic constant indicating what action is taken when the stencil test fails.
+ See glStencilOp.
+
GL_STENCIL_FUNC
+
+ params
+ returns one value,
+ a symbolic constant indicating what function is used to compare the
+ stencil reference value with the stencil buffer value.
+ See glStencilFunc.
+
GL_STENCIL_PASS_DEPTH_FAIL
+
+ params
+ returns one value,
+ a symbolic constant indicating what action is taken when the stencil
+ test passes, but the depth test fails.
+ See glStencilOp.
+
GL_STENCIL_PASS_DEPTH_PASS
+
+ params
+ returns one value,
+ a symbolic constant indicating what action is taken when the stencil
+ test passes, and the depth test passes.
+ See glStencilOp.
+
GL_STENCIL_REF
+
+ params
+ returns one value,
+ the reference value that is compared with the contents of the stencil buffer.
+ See glStencilFunc.
+
GL_STENCIL_TEST
+ params
returns a single boolean value indicating whether stencil testing
+ of fragments is enabled. The initial value is GL_FALSE
.
+ See glStencilFunc and glStencilOp.
+
GL_STENCIL_VALUE_MASK
+
+ params
+ returns one value,
+ the mask that is used to mask both the stencil reference value and the
+ stencil buffer value before they are compared.
+ See glStencilFunc.
+
GL_STENCIL_WRITEMASK
+
+ params
+ returns one value,
+ the mask that controls writing of the stencil bitplanes.
+ See glStencilMask.
+
GL_SUBPIXEL_BITS
+ params
+ returns one value, an estimate of the number of bits of
+ subpixel resolution that are used to position rasterized
+ geometry in window coordinates. The value must be at
+ least 4.
GL_TEXTURE_2D
+ params
returns a single boolean value indicating whether 2D
+ texturing is enabled. The initial value is GL_FALSE
.
+ See glTexImage2D.
+
GL_TEXTURE_BINDING_2D
+
+ params
+ returns one value,
+ the name of the texture currently bound to the target GL_TEXTURE_2D
.
+ See glBindTexture.
+
GL_TEXTURE_COORD_ARRAY
+
+ params
returns a single boolean value indicating whether
+ the texture coordinate array is enabled. The initial value is GL_FALSE
.
+ See glTexCoordPointer.
+
GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING
+
+ params
+ returns one value,
+ the texture coordinate array buffer binding.
+ See glTexCoordPointer.
+
GL_TEXTURE_COORD_ARRAY_SIZE
+
+ params
+ returns one value,
+ the number of coordinates per element in the texture coordinate array.
+ See glTexCoordPointer.
+
GL_TEXTURE_COORD_ARRAY_STRIDE
+
+ params
+ returns one value,
+ the byte offset between consecutive elements in the texture coordinate array.
+ See glTexCoordPointer.
+
GL_TEXTURE_COORD_ARRAY_TYPE
+
+ params
+ returns one value,
+ returns the data type of each coordinate in the texture coordinate array.
+ See glTexCoordPointer.
+
GL_TEXTURE_MATRIX
+
+ params
+ returns sixteen values:
+ the texture matrix on the top of the texture matrix stack.
+ See glPushMatrix.
+
GL_TEXTURE_STACK_DEPTH
+
+ params
+ returns one value,
+ the number of matrices on the texture matrix stack.
+ See glBindTexture.
+
GL_UNPACK_ALIGNMENT
+
+ params
+ returns one value,
+ the byte alignment used for reading pixel data from memory.
+ See glPixelStorei.
+
GL_VIEWPORT
+
+ params
+ returns four values:,
+ the x
and y
window coordinates of the viewport,
+ followed by its width
and height
.
+ See glViewport.
+
GL_VERTEX_ARRAY
+
+ params
returns a single boolean value indicating whether
+ the vertex array is enabled. The initial value is GL_FALSE
.
+ See glVertexPointer.
+
GL_VERTEX_ARRAY_BUFFER_BINDING
+
+ params
+ returns one value,
+ the vertex array buffer binding.
+ See glVertexPointer.
+
GL_VERTEX_ARRAY_SIZE
+
+ params
+ returns one value,
+ number of coordinates per vertex in the vertex array.
+ See glVertexPointer.
+
GL_VERTEX_ARRAY_STRIDE
+
+ params
+ returns one value,
+ the byte offset between consecutive vertexes in the vertex array.
+ See glVertexPointer.
+
GL_VERTEX_ARRAY_TYPE
+
+ params
+ returns one value,
+ returns the data type of each coordinate in the vertex array.
+ See glVertexPointer.
+
+ GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES
,
+ GL_POINT_SIZE_ARRAY_STRIDE_OES
, and
+ GL_POINT_SIZE_ARRAY_TYPE_OES
are only accepted
+ if the OpenGL ES version number is 1.1 or greater.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetBufferParameteriv — return parameters of a buffer object
void glGetBufferParameteriv( | GLenum target, |
GLenum pname, | |
GLint * params) ; |
target
+
+ Specifies the target buffer object.
+ The symbolic constant must be GL_ARRAY_BUFFER
or
+ GL_ELEMENT_ARRAY_BUFFER
.
+
pname
+
+ Specifies the symbolic name of a buffer object parameter.
+ Accepted values are
+ GL_BUFFER_SIZE
or GL_BUFFER_USAGE
.
+
params
+ Returns the requested parameter.
+ glGetBufferParameteriv
returns in params
a selected parameter of the buffer object
+ specified by target
.
+
+ pname
names a specific buffer object parameter, as follows:
+
GL_BUFFER_SIZE
+ params
returns the size of the buffer object, measured in bytes.
+ The initial value is 0.
+
GL_BUFFER_USAGE
+ params
returns the buffer object's usage pattern. The initial value is
+ GL_STATIC_DRAW
.
+
+ GL_INVALID_ENUM
is generated if target
or pname
is not an
+ accepted value.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetClipPlane — return the coefficients of the specified clipping + plane
void glGetClipPlanef( | GLenum plane, |
GLfloat *equation) ; |
void glGetClipPlanex( | GLenum plane, |
GLfixed *equation) ; |
plane
Specifies a clipping plane. The number of clipping planes
+ depends on the implementation, but at least six clipping planes are
+ supported. Symbolic names of the form
+ GL_CLIP_PLANE
i, where
+ i is an integer between 0 and
+ GL_MAX_CLIP_PLANES
equation
Returns four fixed-point or floating-point values that are the
+ coefficients of the plane equation of plane
+ in eye coordinates in the order p1,
+ p2, p3, and
+ p4. The initial value is (0, 0, 0, 0).
glGetClipPlane
returns in
+ equation
the four coefficients of the plane
+ equation for plane
. The coefficients are in eye
+ coordinates and are returned in the order p1,
+ p2, p3, and
+ p4.
It is always the case that i
+
+ .
+
If an error is generated, no change is made to the contents of
+ equation
.
Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI Free + Software B License. For details, see http://oss.sgi.com/projects/FreeB/.
glGetError — return error information
GLenum glGetError( | void) ; |
+ glGetError
+ returns the value of the error flag. Each detectable error is
+ assigned a numeric code and symbolic name. When an error
+ occurs, the error flag is set to the appropriate error code
+ value. No other errors are recorded until
+ glGetError
+ is called, the error code is returned, and the flag is reset to
+ GL_NO_ERROR
. If a call to
+ glGetError
+ returns GL_NO_ERROR
,
+ there has been no detectable error since the last call to
+ glGetError
,
+ or since the GL was initialized.
To allow for distributed implementations, there may be
+ several error flags. If any single error flag has recorded an
+ error, the value of that flag is returned and that flag is
+ reset to GL_NO_ERROR
when
+ glGetError
+ is called. If more than one flag has recorded an error,
+ glGetError
+ returns and clears an arbitrary error flag value. Thus,
+ glGetError
+ should always be called in a loop, until it returns
+ GL_NO_ERROR
,
+ if all error flags are to be reset.
Initially, all error flags are set to
+ GL_NO_ERROR
.
The following errors are currently defined:
GL_NO_ERROR
+ No error has been recorded. The value of this + symbolic constant is guaranteed to be 0.
GL_INVALID_ENUM
+ An unacceptable value is specified for an + enumerated argument. The offending command is ignored, + and has no other side effect than to set the error + flag.
GL_INVALID_VALUE
+ A numeric argument is out of range. The offending + command is ignored, and has no other side effect than to + set the error flag.
GL_INVALID_OPERATION
+ The specified operation is not allowed in the + current state. The offending command is ignored, and has + no other side effect than to set the error flag.
GL_STACK_OVERFLOW
+ This command would cause a stack overflow. The + offending command is ignored, and has no other side + effect than to set the error flag.
GL_STACK_UNDERFLOW
+ This command would cause a stack underflow. The + offending command is ignored, and has no other side + effect than to set the error flag.
GL_OUT_OF_MEMORY
+ There is not enough memory left to execute the + command. The state of the GL is undefined, except for the + state of the error flags, after this error is + recorded.
When an error flag is set, results of a GL operation are
+ undefined only if GL_OUT_OF_MEMORY
+ has occurred. In all other cases, the command generating the
+ error is ignored and has no effect on the GL state or frame
+ buffer contents. If the generating command returns a value, it
+ returns 0. If glGetError
+ itself generates an error, it returns 0.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetLight — return light source parameter values
void glGetLightfv( | GLenum light, |
GLenum pname, | |
GLfloat * params) ; |
void glGetLightxv( | GLenum light, |
GLenum pname, | |
GLfixed * params) ; |
light
+
+ Specifies a light source. The number of possible
+ lights depends on the implementation, but at least
+ eight lights are supported. They
+ are identified by symbolic names of the form
+
pname
+
+ Specifies a light source parameter for light.
+ Accepted symbolic names are
+ GL_AMBIENT
,
+ GL_DIFFUSE
,
+ GL_SPECULAR
,
+ GL_POSITION
,
+ GL_SPOT_DIRECTION
,
+ GL_SPOT_EXPONENT
,
+ GL_SPOT_CUTOFF
,
+ GL_CONSTANT_ATTENUATION
,
+ GL_LINEAR_ATTENUATION
, and
+ GL_QUADRATIC_ATTENUATION
.
+
params
+ + Returns the requested data. +
+ glGetLight
+ returns in params
the value or values of a light
+ source parameter.
+ light
names the light and is a symbolic
+ name of the form
+ GL_MAX_LIGHTS
is an
+ implementation dependent constant that
+ is greater than or equal to eight.
+ pname
specifies one of
+ ten light source parameters, again by symbolic name.
+
The ten light parameters are defined:
GL_AMBIENT
+
+ params
+ returns four fixed-point or floating-point values that
+ specify the ambient RGBA intensity of the light. Both
+ fixed-point and floating-point values are mapped
+ directly. Neither fixed-point nor floating-point values
+ are clamped.
+ The initial ambient light intensity is (0, 0, 0, 1).
+
GL_DIFFUSE
+
+ params
+ returns four fixed-point or floating-point values that
+ specify the diffuse RGBA intensity of the light. Both
+ fixed-point and floating-point values are mapped
+ directly. Neither fixed-point nor floating-point values
+ are clamped.
+ The initial value for GL_LIGHT0
+ is (1, 1, 1, 1).
+ For other lights, the initial value is (0, 0, 0, 0).
+
GL_SPECULAR
+
+ params
+ returns four fixed-point or floating-point values that
+ specify the specular RGBA intensity of the light. Both
+ fixed-point and floating-point values are mapped
+ directly. Neither fixed-point nor floating-point values
+ are clamped.
+ The initial value for GL_LIGHT0
+ is (1, 1, 1, 1).
+ For other lights, the initial value is (0, 0, 0, 0).
+
GL_POSITION
+ params
returns four fixed-point or floating-point values representing the
+ position of the light source.
+ Both fixed-point and floating-point values are mapped
+ directly.
+ The returned values are those maintained in eye coordinates.
+ They will not be equal to the values specified using glLight,
+ unless the modelview matrix was identity at the time glLight was
+ called. The initial value is (0, 0, 1, 0).
+
GL_SPOT_DIRECTION
+
+ params
+ returns three fixed-point or floating-point values that
+ specify the direction of the light in homogeneous object
+ coordinates. Both fixed-point and floating-point values
+ are mapped directly. Neither fixed-point nor
+ floating-point values are clamped.
+ The initial direction is (0, 0, -1).
+
GL_SPOT_EXPONENT
+
+ params
+ returns a single fixed-point or floating-point value that
+ specifies the intensity distribution of the light.
+ Fixed-point and floating-point values are mapped
+ directly. Only values in the range [0, 128] are
+ accepted.
+ The initial spot exponent is 0.
+
GL_SPOT_CUTOFF
+
+ params
+ returns a single fixed-point or floating-point value that
+ specifies the maximum spread angle of a light source.
+ Fixed-point and floating-point values are mapped
+ directly. Only values in the range [0, 90] and the special
+ value 180 are accepted. If the angle between the
+ direction of the light and the direction from the light
+ to the vertex being lighted is greater than the spot
+ cutoff angle, the light is completely masked.
+ Otherwise, its intensity is controlled by the spot
+ exponent and the attenuation factors. The initial spot
+ cutoff is 180.
+
GL_CONSTANT_ATTENUATION
,
+ GL_LINEAR_ATTENUATION
,
+ GL_QUADRATIC_ATTENUATION
+ params
+ returns a single fixed-point or floating-point value that
+ specifies one of the three light attenuation factors.
+ Fixed-point and floating-point values are mapped
+ directly. Only nonnegative values are accepted. If the
+ light is positional, rather than directional, its
+ intensity is attenuated by the reciprocal of the sum of
+ the constant factor, the linear factor times the distance
+ between the light and the vertex being lighted, and the
+ quadratic factor times the square of the same distance.
+ The initial attenuation factors are (1, 0, 0).
+ It is always the case that
+ i
.
+
+ If an error is generated, no change is made to the contents
+ of params
.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetMaterial — return material parameters values
void glGetMaterialfv( | GLenum face, |
GLenum pname, | |
GLfloat * params) ; |
void glGetMaterialxv( | GLenum face, |
GLenum pname, | |
GLfixed * params) ; |
face
+
+ Specifies which of the two materials is being
+ queried.
+ GL_FRONT
+ or
+ GL_BACK
are accepted,
+ representing the front and back materials, respectively.
+
pname
+
+ Specifies the material parameter to return.
+ Accepted symbolic names are
+ GL_AMBIENT
,
+ GL_DIFFUSE
,
+ GL_SPECULAR
,
+ GL_EMISSION
, and
+ GL_SHININESS
.
+
params
+ + Returns the requested data. +
+ glGetMaterial
+ returns in params
the value or values of
+ parameter pname
of material face
.
+
Five parameters are defined:
GL_AMBIENT
+
+ params
+ returns four fixed-point or floating-point values that
+ specify the ambient RGBA reflectance of the material.
+ The values are not clamped. The initial ambient reflectance
+
+ is (0.2, 0.2, 0.2, 1.0).
+
GL_DIFFUSE
+
+ params
+ returns four fixed-point or floating-point values that
+ specify the diffuse RGBA reflectance of the material.
+ The values are not clamped. The initial diffuse reflectance
+
+ is (0.8, 0.8, 0.8, 1.0).
+
GL_SPECULAR
+
+ params
+ returns four fixed-point or floating-point values that
+ specify the specular RGBA reflectance of the material.
+ The values are not clamped. The initial specular reflectance
+
+ is (0, 0, 0, 1).
+
GL_EMISSION
+
+ params
+ returns four fixed-point or floating-point values that
+ specify the RGBA emitted light intensity of the material.
+ The values are not clamped. The initial emission intensity
+
+ is (0, 0, 0, 1).
+
GL_SHININESS
+
+ params
+ returns a single fixed-point or floating-point value that
+ specifies the RGBA specular exponent of the material.
+ The initial specular exponent
+
+ is 0.
+
+ If an error is generated, no change is made to the contents
+ of params
.
+
+ In OpenGL ES there is only one material shared by the front and back.
+ Therefore querying
+ GL_FRONT
+ and querying
+ GL_BACK
+ will always return the
+ same value.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetPointerv — return the address of the specified pointer
void glGetPointerv( | GLenum pname, |
GLvoid ** params) ; |
pname
+
+ Specifies the array or buffer pointer to be returned.
+ Accepted symbolic names are
+ GL_COLOR_ARRAY_POINTER
,
+
+ GL_NORMAL_ARRAY_POINTER
,
+ GL_POINT_SIZE_ARRAY_POINTER_OES
,
+ GL_TEXTURE_COORD_ARRAY_POINTER
, and
+ GL_VERTEX_ARRAY_POINTER
.
+
+
params
+
+ Returns the pointer value specified by pname
.
+
+ glGetPointerv
+ returns pointer information.
+ pname
is a
+ symbolic constant indicating the pointer to be returned, and
+ params
is a pointer to a
+ location in which to place the returned data.
+
+ Querying the GL_TEXTURE_COORD_ARRAY_POINTER returns the value for + the active client texture unit. +
+ If a non-zero + named buffer object was bound to the GL_ARRAY_BUFFER target + (see + glBindBuffer) + when the desired pointer was previously specified, the pointer + returned is a byte offset into the buffer object's data store. +
+ glGetPointerv
is only supported
+ if the OpenGL ES version number is 1.1 or greater.
+
+ The pointers are all client-side state. +
+ The initial value for each pointer is 0. +
+ glBindBuffer, + glClientActiveTexture, + glColorPointer, + glDrawArrays, + glMatrixIndexPointer, + glNormalPointer, + glTexCoordPointer, + glPointSizePointerOES, + glVertexPointer + +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetString — return a string describing the current GL + connection
const GLubyte * glGetString( | GLenum name) ; |
name
+ Specifies a symbolic constant, one of
+ GL_VENDOR
,
+ GL_RENDERER
,
+ GL_VERSION
, or
+ GL_EXTENSIONS
.
glGetString
+ returns a pointer to a static string describing some aspect of
+ the current GL connection. name
+ can be one of the following:
GL_VENDOR
+ Returns the company responsible for this GL + implementation. This name does not change from release to + release.
GL_RENDERER
+ Returns the name of the renderer. This name is + typically specific to a particular configuration of a + hardware platform. It does not change from release to + release.
GL_VERSION
+ Returns a version or release number.
GL_EXTENSIONS
+ Returns a space-separated list of supported + extensions to GL.
Because the GL does not include queries for the
+ performance characteristics of an implementation, some
+ applications are written to recognize known platforms and
+ modify their GL usage based on known performance
+ characteristics of these platforms. Strings
+ GL_VENDOR
and
+ GL_RENDERER
+ together uniquely specify a platform. They do not change from
+ release to release and should be used by platform-recognition
+ algorithms.
Some applications want to make use of features that are
+ not part of the standard GL. These features may be implemented
+ as extensions to the standard GL. The GL_EXTENSIONS
+ string is a space-separated list of supported GL extensions.
+ (Extension names never contain a space character.)
The GL_VERSION
string identifies both the version number
+ and the profile. The form of the string is "OpenGL ES-<profile>
+ <major>.<minor>", where <profile> is either "CM"
+ (Common) or "CL" (Common-Lite), and <major> and <minor> are
+ integers. OpenGL ES 1.0 and OpenGL ES 1.1 will both have <major> of 1 but
+ 0 or 1 for <minor>, respectively.
All strings are null-terminated.
If an error is generated, glGetString
+ returns NULL
.
The client and server may support different versions or
+ extensions. glGetString
+ always returns a compatible version number or list of
+ extensions. The release number always describes the
+ server.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetTexEnv — return texture environment parameters
void glGetTexEnvfv( | GLenum target, |
GLenum pname, | |
GLfloat * params) ; |
void glGetTexEnviv( | GLenum target, |
GLenum pname, | |
GLint * params) ; |
void glGetTexEnvxv( | GLenum target, |
GLenum pname, | |
GLfixed * params) ; |
target
+ Specifies a texture environment. May be
+ GL_TEXTURE_ENV
or
+ GL_POINT_SPRITE_OES
.
+
pname
+ Specifies the symbolic name of a texture environment parameter.
+ Accepted values are GL_TEXTURE_ENV_MODE
,
+ GL_TEXTURE_ENV_COLOR
,
+ GL_COMBINE_RGB
,
+ GL_COMBINE_ALPHA
,
+ GL_SRC0_RGB
,
+ GL_SRC1_RGB
,
+ GL_SRC2_RGB
,
+ GL_SRC0_ALPHA
,
+ GL_SRC1_ALPHA
,
+ GL_SRC2_ALPHA
,
+ GL_OPERAND0_RGB
,
+ GL_OPERAND1_RGB
,
+ GL_OPERAND2_RGB
,
+ GL_OPERAND0_ALPHA
,
+ GL_OPERAND1_ALPHA
,
+ GL_OPERAND2_ALPHA
,
+ GL_RGB_SCALE
,
+ GL_ALPHA_SCALE
, or
+ GL_COORD_REPLACE_OES
.
+
params
+ Returns the requested data. +
+ glGetTexEnv
returns in params
selected values of a texture environment that
+ was specified with glTexEnv.
+ target
specifies a texture environment.
+
+ When target
is GL_POINT_SPRITE_OES
,
+ pname
must be GL_COORD_REPLACE_OES
.
+ When target
is
+ GL_TEXTURE_ENV
, pname
can be GL_TEXTURE_ENV_MODE
,
+ GL_TEXTURE_ENV_COLOR
, GL_COMBINE_RGB
, GL_COMBINE_ALPHA
,
+ GL_RGB_SCALE
, GL_ALPHA_SCALE
,
+ GL_OPERAND0_RGB
, GL_OPERAND1_RGB
, GL_OPERAND2_RGB
,
+ GL_OPERAND0_ALPHA
, GL_OPERAND1_ALPHA
, GL_OPERAND2_ALPHA
,
+ GL_SRC0_RGB
, GL_SRC1_RGB
, GL_SRC2_RGB
,
+ GL_SRC0_ALPHA
, GL_SRC1_ALPHA
, or GL_SRC2_ALPHA
.
+
+ pname
names a specific texture environment parameter, as follows:
+
GL_TEXTURE_ENV_MODE
+ params
returns the single-valued texture environment mode,
+ a symbolic constant. The initial value is GL_MODULATE
.
+
GL_TEXTURE_ENV_COLOR
+ params
returns four integer or floating-point values that are the
+ texture environment color.
+ Integer values,
+ when requested,
+ are linearly mapped from the internal floating-point representation
+ such that 1.0 maps to the most positive representable integer,
+ and
+
GL_COMBINE_RGB
+ params
returns a single symbolic constant value representing the current
+ RGB combine mode. The initial value is GL_MODULATE
.
+
GL_COMBINE_ALPHA
+ params
returns a single symbolic constant value representing the current
+ alpha combine mode. The initial value is GL_MODULATE
.
+
GL_SRC0_RGB
+ params
returns a single symbolic constant value representing the texture
+ combiner zero's RGB source. The initial value is GL_TEXTURE
.
+
GL_SRC1_RGB
+ params
returns a single symbolic constant value representing the texture
+ combiner one's RGB source. The initial value is GL_PREVIOUS
.
+
GL_SRC2_RGB
+ params
returns a single symbolic constant value representing the texture
+ combiner two's RGB source. The initial value is GL_CONSTANT
.
+
GL_SRC0_ALPHA
+ params
returns a single symbolic constant value representing the texture
+ combiner zero's alpha source. The initial value is GL_TEXTURE
.
+
GL_SRC1_ALPHA
+ params
returns a single symbolic constant value representing the texture
+ combiner one's alpha source. The initial value is GL_PREVIOUS
.
+
GL_SRC2_ALPHA
+ params
returns a single symbolic constant value representing the texture
+ combiner two's alpha source. The initial value is GL_CONSTANT
.
+
GL_OPERAND0_RGB
+ params
returns a single symbolic constant value representing the texture
+ combiner zero's RGB operand. The initial value is GL_SRC_COLOR
.
+
GL_OPERAND1_RGB
+ params
returns a single symbolic constant value representing the texture
+ combiner one's RGB operand. The initial value is GL_SRC_COLOR
.
+
GL_OPERAND2_RGB
+ params
returns a single symbolic constant value representing the texture
+ combiner two's RGB operand. The initial value is GL_SRC_ALPHA
.
+
GL_OPERAND0_ALPHA
+ params
returns a single symbolic constant value representing the texture
+ combiner zero's alpha operand. The initial value is GL_SRC_ALPHA
.
+
GL_OPERAND1_ALPHA
+ params
returns a single symbolic constant value representing the texture
+ combiner one's alpha operand. The initial value is GL_SRC_ALPHA
.
+
GL_OPERAND2_ALPHA
+ params
returns a single symbolic constant value representing the texture
+ combiner two's alpha operand. The initial value is GL_SRC_ALPHA
.
+
GL_RGB_SCALE
+ params
returns a single floating-point value representing the current RGB
+ texture combiner scaling factor. The initial value is 1.0.
+
GL_ALPHA_SCALE
+ params
returns a single floating-point value representing the current alpha
+ texture combiner scaling factor. The initial value is 1.0.
+
GL_COORD_REPLACE_OES
+ params
returns a single boolean value representing the current point sprite
+ texture coordinate replacement enable state. The initial value is GL_FALSE
.
+
+ If an error is generated,
+ no change is made to the contents of params
.
+
+ glGetTexEnv
returns
+ the texture environment parameters for the active texture unit.
+
+ GL_POINT_SPRITE_OES
and GL_COORD_REPLACE_OES
are available
+ only if the OpenGL ES version is 1.1 or greater.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetTexParameter — return texture parameter values
void glGetTexParameterfv( | GLenum target, |
GLenum pname, | |
GLfloat * params) ; |
void glGetTexParameteriv( | GLenum target, |
GLenum pname, | |
GLint * params) ; |
void glGetTexParameterxv( | GLenum target, |
GLenum pname, | |
GLfixed * params) ; |
target
+ Specifies the target texture, which must be
+ GL_TEXTURE_2D
.
pname
+
+ Specifies the symbolic name of a texture parameter.
+ Which can be one of the following:
+ GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_WRAP_S
,
+ GL_TEXTURE_WRAP_T
, or
+ GL_GENERATE_MIPMAP
.
+
params
+ Returns texture parameters.
+ glGetTexParameter
+ returns in param
the value of
+ the texture parameter specified as pname
.
+ target
defines the target texture,
+ which must be GL_TEXTURE_2D
+ which specifies two-dimensional texturing.
+ pname
accepts the same symbols as
+ glTexParameter,
+ with the same interpretations:
+
GL_TEXTURE_MIN_FILTER
+
+ Returns the single-valued texture minifying function, a symbolic
+ constant, which can be one of the following:
+ GL_NEAREST
,
+ GL_LINEAR
,
+ GL_NEAREST_MIPMAP_NEAREST
,
+ GL_LINEAR_MIPMAP_NEAREST
,
+ GL_NEAREST_MIPMAP_LINEAR
, or
+ GL_LINEAR_MIPMAP_LINEAR
.
+ The initial value is
+ GL_NEAREST_MIPMAP_LINEAR
.
+
GL_TEXTURE_MAG_FILTER
+
+ Returns the single-valued texture magnification function,
+ a symbolic constant, which can be either
+ GL_NEAREST
or
+ GL_LINEAR
.
+ The initial value is
+ GL_LINEAR
.
+
GL_TEXTURE_WRAP_S
+
+ Returns the single-valued wrapping function for texture coordinate
+ s
, a symbolic constant, which can be
+ either:
+ GL_CLAMP_TO_EDGE
, or
+ GL_REPEAT
.
+ The initial value is
+ GL_REPEAT
.
+
GL_TEXTURE_WRAP_T
+
+ Returns the single-valued wrapping function for texture coordinate
+ t
, a symbolic constant, which can be
+ either:
+ GL_CLAMP_TO_EDGE
, or
+ GL_REPEAT
.
+ The initial value is
+ GL_REPEAT
.
+
GL_GENERATE_MIPMAP
+
+ Returns a single boolean value indicating if automatic mipmap level
+ updates are enabled. The initial value is
+ GL_FALSE
.
+ See glTexParameter.
+
GL_INVALID_ENUM
is generated if
+ target
or
+ pname
+ is not one of the accepted defined values.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glHint — specify implementation-specific hints
void glHint( | GLenum target, |
GLenum mode) ; |
target
+ Specifies a symbolic constant indicating the
+ behavior to be controlled.
+ GL_FOG_HINT
,
+ GL_GENERATE_MIPMAP_HINT
,
+ GL_LINE_SMOOTH_HINT
,
+ GL_PERSPECTIVE_CORRECTION_HINT
, and
+ GL_POINT_SMOOTH_HINT
are accepted.
mode
+ Specifies a symbolic constant indicating the
+ desired behavior.
+ GL_FASTEST
,
+ GL_NICEST
, and
+ GL_DONT_CARE
are accepted.
Certain aspects of GL behavior, when there is room for
+ interpretation, can be controlled with hints. A hint is
+ specified with two arguments. target
+ is a symbolic constant indicating the behavior to be
+ controlled, and mode
+ is another symbolic constant indicating the desired behavior.
+ The initial value for each target
is
+ GL_DONT_CARE
.
+ mode
can be one of the following:
GL_FASTEST
+ The most efficient option should be chosen.
GL_NICEST
+ The most correct, or highest quality, option should + be chosen.
GL_DONT_CARE
+ No preference.
Though the implementation aspects that can be hinted are
+ well defined, the interpretation of the hints depends on the
+ implementation. The hint aspects that can be specified with
+ target
,
+ along with suggested semantics, are as follows:
GL_FOG_HINT
+ Indicates the accuracy of fog calculation. If
+ per-pixel fog calculation is not efficiently supported by
+ the GL implementation, hinting
+ GL_DONT_CARE
or
+ GL_FASTEST
+ can result in per-vertex calculation of fog effects.
GL_GENERATE_MIPMAP_HINT
+ + Indicates the desired quality and performance of automatic mipmap level generation. +
GL_LINE_SMOOTH_HINT
+ Indicates the sampling quality of antialiased
+ lines. If a larger filter function is applied, hinting
+ GL_NICEST
+
+ can result in more pixel fragments being generated during
+ rasterization.
GL_PERSPECTIVE_CORRECTION_HINT
+ Indicates the quality of color and texture
+ coordinate interpolation. If perspective-corrected
+ parameter interpolation is not efficiently supported by
+ the GL implementation, hinting GL_DONT_CARE
or
+ GL_FASTEST
+ can result in simple linear interpolation of colors
+ and/or texture coordinates.
GL_POINT_SMOOTH_HINT
+ Indicates the sampling quality of antialiased
+ points. If a larger filter function is applied, hinting
+ GL_NICEST
+ can result in more pixel fragments being generated during
+ rasterization.
The interpretation of hints depends on the
+ implementation. Some implementations ignore
+ glHint
+ settings.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glIsBuffer — determine if a name corresponds to a buffer object
GLboolean glIsBuffer( | GLuint buffer) ; |
+ glIsBuffer
+ returns GL_TRUE
if buffer
+ is currently the name
+ of a buffer object. If buffer
is zero
,
+ or is a non-zero value
+ that is not currently the name of a buffer object,
+ glIsBuffer
returns GL_FALSE
.
+
A name returned by glGenBuffers, + but not yet associated with a buffer object by calling + glBindBuffer, is not the + name of a buffer object.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glIsEnabled — test whether a capability is enabled
GLboolean glIsEnabled( | GLenum cap) ; |
+ glIsEnabled
+ returns GL_TRUE
if cap is an enabled
+ capability and returns GL_FALSE
otherwise.
+
+ The following capabilities are accepted for cap
:
+
Constant | See function: | |
---|---|---|
GL_ALPHA_TEST | + glAlphaFunc + | |
GL_BLEND | + glBlendFunc, + glLogicOp + | |
+ GL_CLIP_PLANE
+ | + glClipPlane + | |
GL_COLOR_ARRAY | + glColorPointer + | |
GL_COLOR_LOGIC_OP | + glLogicOp + | |
GL_COLOR_MATERIAL | + glMaterial + | |
GL_CULL_FACE | + glCullFace + | |
GL_DEPTH_TEST | + glDepthFunc, + glDepthRange + | |
GL_DITHER | + glEnable + | |
GL_FOG | + glFog + | |
+ GL_LIGHT
+ | + glLight, + glLightModel + | |
GL_LIGHTING | + glLight, + glLightModel, + glMaterial + | |
GL_LINE_SMOOTH | + glLineWidth + | |
GL_MULTISAMPLE | + glEnable + | |
GL_NORMAL_ARRAY | + glNormalPointer + | |
GL_NORMALIZE | + glNormal + | |
GL_POINT_SIZE_ARRAY_OES | + glEnableClientState + | |
GL_POINT_SMOOTH | + glPointSize + | |
GL_POINT_SPRITE_OES | + glTexEnv + | |
GL_POLYGON_OFFSET_FILL | + glPolygonOffset + | |
GL_RESCALE_NORMAL | + glNormal + | |
GL_SAMPLE_ALPHA_TO_COVERAGE | + glSampleCoverage + | |
GL_SAMPLE_ALPHA_TO_ONE | + glSampleCoverage + | |
GL_SAMPLE_COVERAGE | + glSampleCoverage + | |
GL_SCISSOR_TEST | + glScissor + | |
GL_STENCIL_TEST | + glStencilFunc, + glStencilOp + | |
GL_TEXTURE_2D | + glTexImage2D + | |
GL_TEXTURE_COORD_ARRAY | + glTexCoordPointer + | |
GL_VERTEX_ARRAY | + glVertexPointer + |
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glIsTexture — determine if a name corresponds to a texture
GLboolean glIsTexture( | GLuint texture) ; |
+ glIsTexture
+ returns GL_TRUE
if texture
is currently the name
+ of a texture. If texture
is zero
,
+ or is a non-zero value
+ that is not currently the name of a texture,
+ glIsTexture
returns GL_FALSE
.
+
A name returned by glGenTextures, + but not yet associated with a texture by calling + glBindTexture, is not the + name of a texture.
+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glGenTextures, + glTexImage2D, + glTexParameter +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glLight — set light source parameters
void glLightf( | GLenum light, |
GLenum pname, | |
GLfloat param) ; |
void glLightx( | GLenum light, |
GLenum pname, | |
GLfixed param) ; |
light
+ Specifies a light. The number of lights depends on
+ the implementation, but at least eight lights are
+ supported. They are identified by symbolic names of the
+ form GL_LIGHT
i
+ where
+
pname
+ Specifies a single-valued light source parameter for
+ light
.
+ GL_SPOT_EXPONENT
,
+ GL_SPOT_CUTOFF
,
+ GL_CONSTANT_ATTENUATION
,
+ GL_LINEAR_ATTENUATION
, and
+ GL_QUADRATIC_ATTENUATION
+ are accepted.
param
+ Specifies the value that parameter pname
+ of light source light
will be set to.
void glLightfv( | GLenum light, |
GLenum pname, | |
const GLfloat * params) ; |
void glLightxv( | GLenum light, |
GLenum pname, | |
const GLfixed * params) ; |
light
+ Specifies a light. The number of lights depends on
+ the implementation, but at least eight lights are
+ supported. They are identified by symbolic names of the
+ form
+ GL_LIGHT
i
+ where
+
pname
+ Specifies a light source parameter for
+ light
.
+ GL_AMBIENT
,
+ GL_DIFFUSE
,
+ GL_SPECULAR
,
+ GL_POSITION
,
+ GL_SPOT_CUTOFF
,
+ GL_SPOT_DIRECTION
,
+ GL_SPOT_EXPONENT
,
+ GL_CONSTANT_ATTENUATION
,
+ GL_LINEAR_ATTENUATION
, and
+ GL_QUADRATIC_ATTENUATION
are accepted.
params
+ Specifies a pointer to the value or values that parameter
+ pname
of light source
+ light
will be set to.
glLight
+ sets the values of individual light source parameters.
+ light
+ names the light and is a symbolic name of the form
+ GL_LIGHT
i
,
+ where
+ pname
+ specifies one of ten light source parameters, again by symbolic
+ name. params
+ is either a single value or a pointer to an array that contains
+ the new values.
To enable and disable lighting calculation, call
+ glEnable and
+ glDisable
+ with argument GL_LIGHTING
.
+ Lighting is initially disabled. When it is enabled, light
+ sources that are enabled contribute to the lighting
+ calculation. Light source i
+ is enabled and disabled using
+ glEnable and
+ glDisable
+ with argument GL_LIGHT
i
.
+
The ten light parameters are as follows:
GL_AMBIENT
+ params
+ contains four fixed-point or floating-point values that
+ specify the ambient RGBA intensity of the light. Both
+ fixed-point and floating-point values are mapped
+ directly. Neither fixed-point nor floating-point values
+ are clamped. The initial ambient light intensity is (0,
+ 0, 0, 1).
GL_DIFFUSE
+ params
+ contains four fixed-point or floating-point values that
+ specify the diffuse RGBA intensity of the light. Both
+ fixed-point and floating-point values are mapped
+ directly. Neither fixed-point nor floating-point values
+ are clamped. The initial value for GL_LIGHT0
+ is (1, 1, 1, 1). For other lights, the initial value is
+ (0, 0, 0, 0).
GL_SPECULAR
+ params
+ contains four fixed-point or floating-point values that
+ specify the specular RGBA intensity of the light. Both
+ fixed-point and floating-point values are mapped
+ directly. Neither fixed-point nor floating-point values
+ are clamped. The initial value for GL_LIGHT0
+ is (1, 1, 1, 1). For other lights, the initial value is
+ (0, 0, 0, 0).
GL_POSITION
+ params
contains four fixed-point or floating-point values that specify
+ the position of the light in homogeneous object coordinates.
+ Both fixed-point and floating-point values are mapped directly.
+ Neither fixed-point nor floating-point values are clamped.
+
+ The position is transformed by the modelview matrix when
+ glLight
is called (just as if it were a point),
+ and it is stored in eye coordinates.
+ If the
+
GL_SPOT_DIRECTION
+ params
+ contains three fixed-point or floating-point values that
+ specify the direction of the light in homogeneous object
+ coordinates. Both fixed-point and floating-point values
+ are mapped directly. Neither fixed-point nor
+ floating-point values are clamped.
The spot direction is transformed by the upper 3x3 of the
+ modelview matrix when glLight
+ is called, and it is stored in
+ eye coordinates. It is significant only when
+ GL_SPOT_CUTOFF
+ is not 180, which it is initially. The initial direction is (0,
+ 0, -1).
GL_SPOT_EXPONENT
+ params
+ is a single fixed-point or floating-point value that
+ specifies the intensity distribution of the light.
+ Fixed-point and floating-point values are mapped
+ directly. Only values in the range [0, 128] are
+ accepted.
Effective light intensity is attenuated by the cosine of
+ the angle between the direction of the light and the direction
+ from the light to the vertex being lighted, raised to the power
+ of the spot exponent. Thus, higher spot exponents result in a
+ more focused light source, regardless of the spot cutoff angle
+ (see GL_SPOT_CUTOFF
,
+ next paragraph). The initial spot exponent is 0, resulting in
+ uniform light distribution.
GL_SPOT_CUTOFF
+ params
+ is a single fixed-point or floating-point value that
+ specifies the maximum spread angle of a light source.
+ Fixed-point and floating-point values are mapped
+ directly. Only values in the range [0, 90] and the special
+ value 180 are accepted. If the angle between the
+ direction of the light and the direction from the light
+ to the vertex being lighted is greater than the spot
+ cutoff angle, the light is completely masked.
+ Otherwise, its intensity is controlled by the spot
+ exponent and the attenuation factors. The initial spot
+ cutoff is 180, resulting in uniform light
+ distribution.
GL_CONSTANT_ATTENUATION
,
+ GL_LINEAR_ATTENUATION
,
+ GL_QUADRATIC_ATTENUATION
+ params
+ is a single fixed-point or floating-point value that
+ specifies one of the three light attenuation factors.
+ Fixed-point and floating-point values are mapped
+ directly. Only nonnegative values are accepted. If the
+ light is positional, rather than directional, its
+ intensity is attenuated by the reciprocal of the sum of
+ the constant factor, the linear factor times the distance
+ between the light and the vertex being lighted, and the
+ quadratic factor times the square of the same distance.
+ The initial attenuation factors are (1, 0, 0), resulting
+ in no attenuation.
GL_INVALID_ENUM
is generated if either
+ light
or
+ pname
is not an accepted value.
GL_INVALID_VALUE
+ is generated if a spot exponent value is specified outside the
+ range [0, 128], or if spot cutoff is specified outside the range
+ [0, 90] (except for the special value 180), or if a negative
+ attenuation factor is specified.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glLightModel — set the lighting model parameters
void glLightModelf( | GLenum pname, |
GLfloat param) ; |
void glLightModelx( | GLenum pname, |
GLfixed param) ; |
pname
+ Specifies a single-valued lighting model parameter. Must be
+ GL_LIGHT_MODEL_TWO_SIDE
.
param
+ Specifies the value that param
+ will be set to.
void glLightModelfv( | GLenum pname, |
const GLfloat * params) ; |
void glLightModelxv( | GLenum pname, |
const GLfixed * params) ; |
pname
+ Specifies a lighting model parameter.
+ GL_LIGHT_MODEL_AMBIENT
and
+ GL_LIGHT_MODEL_TWO_SIDE
are accepted.
params
+ Specifies a pointer to the value or values that
+ params
will be set to.
glLightModel
sets the lighting model parameter.
+ pname
names a parameter and
+ params
+ gives the new value. There are two lighting model parameters:
GL_LIGHT_MODEL_AMBIENT
+ params
+ contains four fixed-point or floating-point values that
+ specify the ambient intensity of the entire scene.
+ The values are not clamped. The initial value is
+ (0.2, 0.2, 0.2, 1.0).
GL_LIGHT_MODEL_TWO_SIDE
+ params
+ is a single fixed-point or floating-point value that
+ specifies whether one- or two-sided lighting calculations
+ are done for polygons. It has no effect on the lighting
+ calculations for points or lines. If
+ params
+ is 0, one-sided lighting is specified, and both front- and
+ back-facing polygons are assigned the same computed color.
+ Otherwise, two-sided lighting is specified. In this case,
+ vertices of back-facing polygons have their normals reversed
+ before the lighting equation is evaluated. Vertices of
+ front-facing polygons are always lighted with no change to
+ their normals. The initial value is 0. Note that there is
+ only one set of material properties shared by both
+ front- and back-facing polygons.
The lighted color of a vertex is the sum of the material + emission intensity, the product of the material ambient + reflectance and the lighting model full-scene ambient + intensity, and the contribution of each enabled light source. + Each light source contributes the sum of three terms: ambient, + diffuse, and specular. The ambient light source contribution is + the product of the material ambient reflectance and the light's + ambient intensity. The diffuse light source contribution is the + product of the material diffuse reflectance, the light's + diffuse intensity, and the dot product of the vertex's normal + with the normalized vector from the vertex to the light source. + The specular light source contribution is the product of the + material specular reflectance, the light's specular intensity, + and the dot product of the normalized vertex-to-eye and + vertex-to-light vectors, raised to the power of the shininess + of the material. All three light source contributions are + attenuated equally based on the distance from the vertex to the + light source and on light source direction, spread exponent, + and spread cutoff angle. All dot products are replaced with 0 + if they evaluate to a negative value.
The alpha component of the resulting lighted color is set + to the alpha value of the material diffuse reflectance.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glLineWidth — specify the width of rasterized lines
void glLineWidth( | GLfloat width) ; |
void glLineWidthx( | GLfixed width) ; |
+ glLineWidth
+ specifies the rasterized width of both aliased and antialiased
+ lines. Using a line width other than 1 has different effects,
+ depending on whether line antialiasing is enabled. To enable
+ and disable line antialiasing, call
+ glEnable and
+ glDisable
+ with argument GL_LINE_SMOOTH
.
+ Line antialiasing is initially disabled.
If line antialiasing is disabled, the actual width is
+ determined by rounding the supplied width to the nearest
+ integer. (If the rounding results in the value 0, it is as if
+ the line width were 1.) If
+ i
+ pixels are filled in each column that is rasterized, where
+ i
is the rounded value of
+ width
. Otherwise, i
+ pixels are filled in each row that is rasterized.
If antialiasing is enabled, line rasterization produces a + fragment for each pixel square that intersects the region lying + within the rectangle having width equal to the current line + width, length equal to the actual length of the line, and + centered on the mathematical line segment. The coverage value + for each fragment is the window coordinate area of the + intersection of the rectangular region with the corresponding + pixel square. This value is saved and used in the final + rasterization step.
Not all widths can be supported when line antialiasing is
+ enabled. If an unsupported width is requested, the nearest
+ supported width is used. Only width 1 is guaranteed to be
+ supported; others depend on the implementation. Likewise, there
+ is a range for aliased line widths as well. To query the range
+ of supported widths, call
+ glGet
+ with arguments
+ GL_ALIASED_LINE_WIDTH_RANGE
or
+ GL_SMOOTH_LINE_WIDTH_RANGE
.
Nonantialiased line width may be clamped to an
+ implementation-dependent maximum. Call
+ glGet
+ with GL_ALIASED_LINE_WIDTH_RANGE
+ to determine the maximum width.
+ glGet
+ with argument GL_ALIASED_LINE_WIDTH_RANGE
+ glGet
+ with argument GL_SMOOTH_LINE_WIDTH_RANGE
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glLoadIdentity — replace the current matrix with the identity + matrix
void glLoadIdentity( | void) ; |
+ glLoadIdentity
+ replaces the current matrix with the identity matrix. It is
+ semantically equivalent to calling
+ glLoadMatrix
+ with the identity matrix
but in some cases it is more efficient.
+ glGet with argument GL_MATRIX_MODE
+
+ glGet with argument GL_MODELVIEW_MATRIX
+
+ glGet with argument GL_PROJECTION_MATRIX
+
+ glGet with argument GL_TEXTURE_MATRIX
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glLoadMatrix — replace the current matrix with the specified + matrix
void glLoadMatrixf( | const GLfloat * m) ; |
void glLoadMatrixx( | const GLfixed * m) ; |
m
+ Specifies a pointer to 16 consecutive values, which
+ are used as the elements of a
+
glLoadMatrix
+ replaces the current matrix with the one whose elements are
+ specified by m
.
+ The current matrix is the projection matrix, modelview
+ matrix, or texture matrix, depending on the current matrix mode (see
+ glMatrixMode).
The current matrix, M, defines a transformation of
+ coordinates. For instance, assume M refers to the modelview
+ matrix. If
+ m
points to an array of 16
+ fixed-point or single-precision floating-point values
+
Where
+ ``
Projection and texture transformations are similarly + defined.
While the elements of the matrix may be specified with + fixed point or single precision, the GL implementation may store or + operate on these values in less than single precision.
+ glGet with argument GL_MATRIX_MODE
+
+ glGet with argument GL_MODELVIEW_MATRIX
+
+ glGet with argument GL_PROJECTION_MATRIX
+
+ glGet with argument GL_TEXTURE_MATRIX
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glLogicOp — specify a logical pixel operation
void glLogicOp( | GLenum opcode) ; |
opcode
+ Specifies a symbolic constant that selects a
+ logical operation. The following symbols are accepted:
+ GL_CLEAR
,
+ GL_SET
,
+ GL_COPY
,
+ GL_COPY_INVERTED
,
+ GL_NOOP
,
+ GL_INVERT
,
+ GL_AND
,
+ GL_NAND
,
+ GL_OR
,
+ GL_NOR
,
+ GL_XOR
,
+ GL_EQUIV
,
+ GL_AND_REVERSE
,
+ GL_AND_INVERTED
,
+ GL_OR_REVERSE
, and
+ GL_OR_INVERTED
. The initial value is
+ GL_COPY
.
glLogicOp
+ specifies a logical operation that, when enabled, is applied
+ between the incoming color and the color at the corresponding
+ location in the frame buffer.
+ To enable or disable the logical operation, call
+ glEnable and
+ glDisable
+ with argument GL_COLOR_LOGIC_OP
.
+ Logical operation is initially disabled.
+
Opcode | Resulting Operation |
---|---|
GL_CLEAR | 0 |
GL_SET | 1 |
GL_COPY | s |
GL_COPY_INVERTED |
+ |
GL_NOOP | d |
GL_INVERT |
+ |
GL_AND |
+ |
GL_NAND |
+ |
GL_OR |
+ |
GL_NOR |
+ |
GL_XOR |
+ |
GL_EQUIV |
+ |
GL_AND_REVERSE |
+ |
GL_AND_INVERTED |
+ |
GL_OR_REVERSE |
+ |
GL_OR_INVERTED |
+ |
+ opcode
+ is a symbolic constant chosen from the list above. In the
+ explanation of the logical operations, s
+ represents the incoming color and d
+ represents the color in the frame buffer. Standard C-language
+ operators are used. As these bitwise operators suggest, the
+ logical operation is applied independently to each bit pair of
+ the source and destination indices or colors.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glMaterial — specify material parameters for the lighting model
void glMaterialf( | GLenum face, |
GLenum pname, | |
GLfloat param) ; |
void glMaterialx( | GLenum face, |
GLenum pname, | |
GLfixed param) ; |
face
+ Specifies which face or faces are being updated. Must be
+ GL_FRONT_AND_BACK
.
pname
+ Specifies the single-valued material parameter of
+ the face or faces that is being updated. Must be
+ GL_SHININESS
.
param
+ Specifies the value that parameter
+ GL_SHININESS
will be set to.
void glMaterialfv( | GLenum face, |
GLenum pname, | |
const GLfloat * params) ; |
void glMaterialxv( | GLenum face, |
GLenum pname, | |
const GLfixed * params) ; |
face
+ Specifies which face or faces are being updated.
+ Must be GL_FRONT_AND_BACK
.
+
pname
+ Specifies the material parameter of the face or
+ faces that is being updated. Must be one of
+ GL_AMBIENT
,
+ GL_DIFFUSE
,
+ GL_SPECULAR
,
+ GL_EMISSION
,
+ GL_SHININESS
, or
+ GL_AMBIENT_AND_DIFFUSE
.
params
+ Specifies a pointer to the value or values that
+ pname
+
+ will be set to.
+ glMaterial
+ assigns values to material parameters. There are two matched
+ sets of material parameters. One, the front-facing
+ set, is used to shade points, lines, and all polygons (when
+ two-sided lighting is disabled), or just front-facing polygons
+ (when two-sided lighting is enabled). The other set,
+ back-facing
,
+ is used to shade back-facing polygons only when two-sided
+ lighting is enabled. Refer to the
+ glLightModel
+ reference page for details concerning one- and two-sided
+ lighting calculations.
+
+ glMaterial
+ takes three arguments. The first, face
,
+ must be GL_FRONT_AND_BACK
and specifies that both
+ front and back materials will be modified.
+ The second, pname
,
+ specifies which of several parameters in one or both sets
+ will be modified. The third, params
,
+ specifies what value or values will be assigned to the
+ specified parameter.
+
+ Material parameters are used in the lighting equation
+ that is optionally applied to each vertex. The equation is
+ discussed in the
+ glLightModel
+ reference page. The parameters that can be specified using
+ glMaterial
,
+ and their interpretations by the lighting equation, are as follows:
+
GL_AMBIENT
+ params
+ contains four fixed-point or floating-point values that
+ specify the ambient RGBA reflectance of the material.
+ The values are not clamped. The initial ambient
+ reflectance is
+ (0.2, 0.2, 0.2, 1.0).
GL_DIFFUSE
+ params
+ contains four fixed-point or floating-point values that
+ specify the diffuse RGBA reflectance of the material.
+ The values are not clamped. The initial diffuse
+ reflectance is
+ (0.8, 0.8, 0.8, 1.0).
GL_SPECULAR
+ params
+ contains four fixed-point or floating-point values that
+ specify the specular RGBA reflectance of the material.
+ The values are not clamped. The initial specular
+ reflectance is
+ (0, 0, 0, 1).
GL_EMISSION
+ params
+ contains four fixed-point or floating-point values that
+ specify the RGBA emitted light intensity of the material.
+ The values are not clamped. The initial emission
+ intensity is
+ (0, 0, 0, 1).
GL_SHININESS
+ params
+ is a single fixed-point or floating-point value that
+ specifies the RGBA specular exponent of the material.
+ Only values in the range [0, 128] are accepted. The
+ initial specular exponent is 0.
GL_AMBIENT_AND_DIFFUSE
+ Equivalent to calling glMaterial
+ twice with the same parameter values, once with
+ GL_AMBIENT
+ and once with GL_DIFFUSE
.
To change the diffuse and ambient material per vertex,
+ color material can be used.
+ To enable and disable
+ GL_COLOR_MATERIAL
, call
+ glEnable and
+ glDisable with
+ argument GL_COLOR_MATERIAL
.
+ Color material is initially disabled.
+
While the ambient, diffuse, specular and emission + material parameters all have alpha components, only the diffuse + alpha component is used in the lighting computation.
+ GL_INVALID_ENUM
is generated if either
+ face
or pname
+ is not an accepted value.
+
+ GL_INVALID_VALUE
+ is generated if a specular exponent outside the range [0, 128]
+ is specified.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glMatrixMode — specify which matrix is the current matrix
void glMatrixMode( | GLenum mode) ; |
mode
+
+ Specifies which matrix stack is the target for
+ subsequent matrix operations.
+ These values are accepted:
+ GL_MODELVIEW
,
+ GL_PROJECTION
, and
+ GL_TEXTURE
.
+
+ The initial value is GL_MODELVIEW
.
+
+ glMatrixMode
sets the current matrix mode.
+ mode
can assume one of these values:
+
GL_MODELVIEW
+ Applies subsequent matrix operations to the + modelview matrix stack.
GL_PROJECTION
+ Applies subsequent matrix operations to the + projection matrix stack.
GL_TEXTURE
+ Applies subsequent matrix operations to the texture + matrix stack.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glMultMatrix — multiply the current matrix with the specified + matrix
void glMultMatrixf( | const GLfloat * m) ; |
void glMultMatrixx( | const GLfixed * m) ; |
m
+ Points to 16 consecutive values that are used as
+ the elements of a
+
glMultMatrix
+ multiplies the current matrix with the one specified using
+ m
,
+ and replaces the current matrix with the product.
The current matrix is determined by the current matrix mode (see + glMatrixMode). + It is either the projection matrix, modelview matrix, or the + texture matrix.
If the current matrix is C
,
+ and the coordinates to be transformed are,
+
Calling
+ glMultMatrix
+ with an argument of
+
Where
+ ``v
+ is represented as a
+
While the elements of the matrix may be specified with + fixed point or single precision, the GL may store or operate on + these values in less than single precision.
In many computer languages
+ glMultMatrix
+ is called with a translation matrix, the translation is done
+ directly on the coordinates to be transformed, while the
+ rotation is done on the results of that translation.
+ glGet with argument GL_MATRIX_MODE
+
+ glGet with argument GL_MODELVIEW_MATRIX
+
+ glGet with argument GL_PROJECTION_MATRIX
+
+ glGet with argument GL_TEXTURE_MATRIX
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glMultiTexCoord — set the current texture coordinates
void glMultiTexCoord4f( | GLenum target, |
GLfloat s, | |
GLfloat t, | |
GLfloat r, | |
GLfloat q) ; |
void glMultiTexCoord4x( | GLenum target, |
GLfixed s, | |
GLfixed t, | |
GLfixed r, | |
GLfixed q) ; |
target
+ Specifies the texture unit whose coordinates should be
+ modified. The number of texture units is implementation
+ dependent, but must be at least
+ two.
+ Symbolic constant must be one of
+ GL_TEXTURE
GL_MAX_TEXTURE_UNITS
- 1,
+ which is an implementation-dependent value.
s
,
+ t
,
+ r
,
+ q
+ Specify
+ s
,
+ t
,
+ r
, and
+ q
texture coordinates for
+ target
texture unit.
+ glMultiTexCoord
+ specifies the four texture coordinates as
+ (s
,
+ t
,
+ r
,
+ q
).
The current texture coordinates are part of the data that
+ is associated with each vertex.
+ Initially, the values for
+
+ glGet with argument GL_CURRENT_TEXTURE_COORDS
with appropriate
+ texture unit selected.
+
+ glGet
+ with argument GL_MAX_TEXTURE_UNITS
+
+ glActiveTexture, + glClientActiveTexture, + glColor, + glGet, + glNormal, + glTexCoordPointer +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glNormal — set the current normal vector
void glNormal3f( | GLfloat nx, |
GLfloat ny, | |
GLfloat nz) ; |
void glNormal3x( | GLfixed nx, |
GLfixed ny, | |
GLfixed nz) ; |
nx
,
+ ny
,
+ nz
+ Specify the
+ x
,
+ y
, and
+ z
coordinates of the
+ new current normal. The initial value is (0, 0, 1).
The current normal is set to the given coordinates whenever
+ glNormal
+ is issued.
Normals specified with glNormal
+ need not have unit length. If GL_NORMALIZE
+ is enabled, then normals of any length specified with
+ glNormal
+ are normalized after transformation. If
+ GL_RESCALE_NORMAL
+ is enabled, normals are scaled by a scaling factor derived from
+ the modelview matrix. GL_RESCALE_NORMAL
+ requires that the originally specified normals were of unit
+ length, and that the modelview matrix contain only uniform
+ scales for proper results. To enable and disable normalization,
+ call
+ glEnable and
+ glDisable
+ with either
+ GL_NORMALIZE
or GL_RESCALE_NORMAL
.
+ Normalization is initially disabled.
+ glGet with argument GL_CURRENT_NORMAL
+
+ glIsEnabled with argument GL_NORMALIZE
+
+ glIsEnabled with argument GL_RESCALE_NORMAL
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glNormalPointer — define an array of normals
void glNormalPointer( | GLenum type, |
GLsizei stride, | |
const GLvoid * pointer) ; |
type
+ Specifies the data type of each coordinate in the
+ array. Symbolic constants
+ GL_BYTE
,
+ GL_SHORT
, and
+ GL_FIXED
are accepted.
+ However, the initial value is
+ GL_FLOAT
.
+ The common profile accepts the symbolic constant
+ GL_FLOAT
as well.
+
stride
+ Specifies the byte offset between consecutive
+ normals. If stride
+ is 0, the normals are understood to be
+ tightly packed in the array. The initial value is
+ 0.
pointer
+ Specifies a pointer to the first coordinate of the + first normal in the array. The initial value is 0.
glNormalPointer
+ specifies the location and data of an array of normals to use
+ when rendering. type
+ specifies the data type of the normal coordinates and
+ stride
+ gives the byte stride from one normal to the next, allowing
+ vertices and attributes to be packed into a single array or
+ stored in separate arrays. (Single-array storage may be more
+ efficient on some implementations.) When a normal array is
+ specified,
+ type
,
+ stride
, and
+ pointer
+ are saved as client-side state.
+ If the normal array is enabled, it is used when
+ glDrawArrays or
+ glDrawElements
+ is called.
+ To enable and disable the normal array, call
+ glEnableClientState
+ and
+ glDisableClientState
+ with the argument GL_NORMAL_ARRAY
.
+ The normal array is initially disabled and isn't accessed when
+ glDrawArrays or
+ glDrawElements
+ is called.
Use + glDrawArrays + to construct a sequence of primitives (all of the same type) + from prespecified vertex and vertex attribute arrays. Use + glDrawElements + to construct a sequence of primitives by indexing vertices and + vertex attributes.
GL_INVALID_ENUM
is generated if
+ type
is not an accepted value.
GL_INVALID_VALUE
is generated if
+ stride
is negative.
+ glColorPointer, + glDrawArrays, + glDrawElements, + glEnable, + glTexCoordPointer, + glVertexPointer +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glOrtho — multiply the current matrix with an orthographic + matrix
void glOrthof( | GLfloat left, |
GLfloat right, | |
GLfloat bottom, | |
GLfloat top, | |
GLfloat near, | |
GLfloat far) ; |
void glOrthox( | GLfixed left, |
GLfixed right, | |
GLfixed bottom, | |
GLfixed top, | |
GLfixed near, | |
GLfixed far) ; |
left
,
+ right
+ Specify the coordinates for the left and right + vertical clipping planes.
bottom
,
+ top
+ Specify the coordinates for the bottom and top + horizontal clipping planes.
near
,
+ far
+ Specify the distances to the nearer and farther + depth clipping planes. These values are negative if the + plane is to be behind the viewer.
glOrtho
+ describes a transformation that produces a parallel projection.
+ The current matrix (see
+ glMatrixMode)
+ is multiplied by this matrix and the result replaces the
+ current matrix, as if
+ glMultMatrix
+ were called with the following matrix as its argument:
where
Typically, the matrix mode is
+ GL_PROJECTION
, and
+ (left
, bottom
,
+ -near
) and
+ (right
, top
,
+ -near
)
+ specify the points on the near clipping plane that are mapped
+ to the lower left and upper right corners of the window,
+ respectively, assuming that the eye is located at (0, 0, 0).
+ -far
+ specifies the location of the far clipping plane. Both
+ near
and far
+ can be either positive or negative.
Use + glPushMatrix + and + glPopMatrix + to save and restore the current matrix stack.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glPixelStorei — set pixel storage modes
void glPixelStorei( | GLenum pname, |
GLint param) ; |
pname
+ Specifies the symbolic name of the parameter to be set.
+ GL_PACK_ALIGNMENT
+ affects the packing of pixel data into memory.
+ GL_UNPACK_ALIGNMENT
+ affects the unpacking of pixel data
+ from
memory.
param
+ Specifies the value that pname
+ is set to.
glPixelStorei
+ sets pixel storage modes that affect the operation of
+ subsequent
+ glReadPixels
+ as well as the unpacking of
+ glTexImage2D,
+ and
+ glTexSubImage2D.
+
pname
+ is a symbolic constant indicating the parameter to be set, and
+ param
+ is the new value. The following storage parameter affects how
+ pixel data is returned to client memory. This value is
+ significant for
+ glReadPixels:
+
GL_PACK_ALIGNMENT
+ Specifies the alignment requirements for the start + of each pixel row in memory. The allowable values are 1 + (byte-alignment), 2 (rows aligned to even-numbered + bytes), 4 (word-alignment), and 8 (rows start on + double-word boundaries). The initial value is 4.
The following storage parameter affects how pixel data is + read from client memory. This value is significant for + glTexImage2D + and + glTexSubImage2D: +
GL_UNPACK_ALIGNMENT
+ Specifies the alignment requirements for the start + of each pixel row in memory. The allowable values are 1 + (byte-alignment), 2 (rows aligned to even-numbered + bytes), 4 (word-alignment), and 8 (rows start on + double-word boundaries). The initial value is 4.
Pixel storage modes are client states.
+ glCompressedTexImage2D
+ and
+ glCompressedTexSubImage2D
+ are not affected by glPixelStorei
.
+
GL_INVALID_ENUM
is generated if
+ pname
is not an accepted value.
GL_INVALID_VALUE
+ is generated if alignment is specified as other than 1, 2, 4, or 8.
+ glReadPixels, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glTexImage2D, + glTexSubImage2D +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glPointParameter — specify parameters for point rasterization
void glPointParameterf( | GLenum pname, |
GLfloat param) ; |
void glPointParameterx( | GLenum pname, |
GLfixed param) ; |
pname
+
+ Specifies the single-valued parameter to be updated.
+ Can be either
+ GL_POINT_SIZE_MIN
,
+ GL_POINT_SIZE_MAX
, or
+ GL_POINT_FADE_THRESHOLD_SIZE
.
+
param
+ + Specifies the value that the parameter will be set to. +
void glPointParameterfv( | GLenum pname, |
const GLfloat * params) ; |
void glPointParameterxv( | GLenum pname, |
const GLfixed * params) ; |
pname
+
+ Specifies the parameter to be updated.
+ Can be either
+ GL_POINT_SIZE_MIN
,
+ GL_POINT_SIZE_MAX
,
+ GL_POINT_FADE_THRESHOLD_SIZE
, or
+ GL_POINT_DISTANCE_ATTENUATION
.
+
params
+
+ Specifies a pointer to the value or values that
+ pname
+ will be set to.
+
+ glPointParameter
+ assigns values to point parameters.
+
+ glPointParameter
+ takes two arguments.
+ pname
,
+ specifies which of several parameters will be modified.
+ params
,
+ specifies what value or values will be assigned to the
+ specified parameter.
+
+ The parameters that can be specified using
+ glPointParameter
,
+ and their interpretations are as follows:
+
GL_POINT_SIZE_MIN
+
+ param
specifies,
+ or params
+ points to the lower bound to which
+ the derived point size is clamped.
+
GL_POINT_SIZE_MAX
+
+ param
specifies,
+ or params
+ points to the upper bound to which
+ the derived point size is clamped.
+
GL_POINT_FADE_THRESHOLD_SIZE
+
+ param
specifies,
+ or params
+ points to the point fade threshold.
+
GL_POINT_DISTANCE_ATTENUATION
+
+ params
+ points to the distance attenuation function coefficients
+ a
,
+ b
, and
+ c
.
+
+ If the point size lower bound is greater than the upper bound, + then the point size after clamping is undefined. +
+ GL_INVALID_ENUM
is generated if
+ pname
+ is not an accepted value.
+
+ GL_INVALID_VALUE
is generated
+ if assigned values for
+ GL_POINT_SIZE_MIN
,
+ GL_POINT_SIZE_MAX
, or
+ GL_POINT_FADE_THRESHOLD_SIZE
+ are less then zero
.
+
+ glGet
+ with argument GL_POINT_DISTANCE_ATTENUATION
+ glGet
+ with argument GL_POINT_FADE_THRESHOLD_SIZE
+ glGet
+ with argument GL_POINT_SIZE_MAX
+ glGet
+ with argument GL_POINT_SIZE_MIN
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glPointSize — specify the diameter of rasterized points
void glPointSize( | GLfloat size) ; |
void glPointSizex( | GLfixed size) ; |
glPointSize
+ specifies the rasterized diameter of both aliased and
+ antialiased points. Using a point size other than 1 has
+ different effects, depending on whether point antialiasing is
+ enabled. To enable and disable point antialiasing, call
+ glEnable
+ and
+ glDisable
+ with argument
+ GL_POINT_SMOOTH
.
+ Point antialiasing is initially disabled.
If point antialiasing is disabled, the actual size is
+ determined by rounding the supplied size to the nearest
+ integer. (If the rounding results in the value 0, it is as if
+ the point size were 1.) If the rounded size is odd, then the
+ center point
+
where w
+ subscripts indicate window coordinates. All pixels that lie
+ within the square grid of the rounded size centered at
+
and the rasterized fragment's centers are the
+ half-integer window coordinates within the square of the
+ rounded size centered at
+
If antialiasing is enabled, then point rasterization
+ produces a fragment for each pixel square that intersects the
+ region lying within the circle having diameter equal to the
+ current point size and centered at the point's
+
Not all sizes are supported when point antialiasing is
+ enabled. If an unsupported size is requested, the nearest
+ supported size is used. Only size 1 is guaranteed to be
+ supported; others depend on the implementation. To query the
+ range of supported sizes, call
+ glGet
+ with the argument
+ GL_SMOOTH_POINT_SIZE_RANGE
.
+ For aliased points, query the supported ranges
+ glGet
+ with the argument
+ GL_ALIASED_POINT_SIZE_RANGE
.
A non-antialiased point size may be clamped to an + implementation-dependent maximum. Although this maximum cannot + be queried, it must be no less than the maximum value for + antialiased points, rounded to the nearest integer + value.
+ glGet
+ with argument GL_ALIASED_POINT_SIZE_RANGE
+ glGet
+ with argument GL_SMOOTH_POINT_SIZE_RANGE
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glPointSizePointerOES — define an array of point sizes
void glPointSizePointerOES( | GLenum type, |
GLsizei stride, | |
const GLvoid * pointer) ; |
type
+
+ Specifies the data type of each point size in the
+ array. Symbolic constant
+ GL_FIXED
is accepted.
+ However, the common profile also accepts the symbolic constant
+ GL_FLOAT
.
+ The initial value is
+ GL_FIXED
for the common lite profile,
+ or GL_FLOAT
for the common profile.
+
stride
+
+ Specifies the byte offset between consecutive
+ point sizes. If stride
+ is 0, the point sizes are understood to be tightly packed in
+ the array.
+ The initial value is 0
.
+
pointer
+
+ Specifies a pointer to the point size of the
+ first vertex in the array.
+ The initial value is 0
.
+
+ glPointSizePointerOES
+ specifies the location and data of an array of point sizes
+ to use when rendering points.
+ type
specifies the data type of the coordinates.
+ stride
+ specifies the byte stride from one point size to the next, allowing
+ vertices and attributes to be packed into a single array or
+ stored in separate arrays. (Single-array storage may be more
+ efficient on some implementations.)
+
+ The point sizes supplied in the + point size arrays will be the sizes used to render + both points and point sprites. +
+ Distance-based attenuation works in conjunction with
+ GL_POINT_SIZE_ARRAY_OES
.
+ If distance-based attenuation is enabled
+ the point size from the point size array will be attenuated as defined by
+ glPointParameter,
+ to compute the final point size.
+
+ When a point size array is
+ specified,
+ type
,
+ stride
, and
+ pointer
are saved as client-side state.
+
+ If the point size array is enabled, it is used to control
+ the sizes used to render points and point sprites.
+ To enable and disable the point size array, call
+ glEnableClientState
+ and
+ glDisableClientState
+ with the argument
+ GL_POINT_SIZE_ARRAY_OES
.
+ The point size array is initially disabled.
+
+ glPointSizePointerOES
is only supported
+ if the OpenGL ES version number is 1.1 or greater.
+
+ If point size array is enabled, the point
+ size defined by
+ glPointSize
+ is ignored.
+
+ glPointSizePointerOES
+ is typically implemented on the client side.
+
+ GL_INVALID_ENUM
is generated if
+ type
is is not an accepted value.
+
+ GL_INVALID_VALUE
is generated if
+ stride
is negative.
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glPolygonOffset — set the scale and units used to calculate depth + values
void glPolygonOffset( | GLfloat factor, |
GLfloat units) ; |
void glPolygonOffsetx( | GLfixed factor, |
GLfixed units) ; |
factor
+ Specifies a scale factor that is used to create a + variable depth offset for each polygon. The initial value + is 0.
units
+ Is multiplied by an implementation-specific value + to create a constant depth offset. The initial value is 0.
When GL_POLYGON_OFFSET_FILL
+ is enabled, each fragment's depth
+ value will be offset after it is interpolated from the
+ depth
+ values of the appropriate vertices. The value of the offset is
+ m
+ is a measurement of the change in depth relative to the screen
+ area of the polygon, and r
+ is the smallest value that is guaranteed to produce a
+ resolvable offset for a given implementation. The offset is
+ added before the depth test is performed and before the value
+ is written into the depth buffer.
+ glPolygonOffset
+ is useful for for applying decals to surfaces.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glPushMatrix, glPopMatrix — push and pop the current matrix stack
void glPushMatrix( | void) ; |
void glPopMatrix( | void) ; |
+ There is a stack of matrices for each of the matrix modes. In
+ GL_MODELVIEW
+ mode, the stack depth is at least 16. In the other modes,
+ GL_PROJECTION
, and
+ GL_TEXTURE
,
+ the depth is at least 2. The current matrix in any mode is
+ the matrix on the top of the stack for that mode.
glPushMatrix
+ pushes the current matrix stack down by one, duplicating the
+ current matrix. That is, after a glPushMatrix
+ call, the matrix on top of the stack is identical to the one
+ below it.
glPopMatrix
+ pops the current matrix stack, replacing the current matrix
+ with the one below it on the stack.
Initially, each of the stacks contains one matrix, an + identity matrix.
It is an error to push a full matrix stack, or to pop a + matrix stack that contains only a single matrix. In either + case, the error flag is set and no other change is made to GL + state.
+ Each texture unit has its own texture matrix stack. Use + glActiveTexture + to select the desired texture matrix stack. +
GL_STACK_OVERFLOW
is generated if
+ glPushMatrix
+ is called while the current matrix stack is full.
GL_STACK_UNDERFLOW
is generated if
+ glPopMatrix
+ is called while the current matrix stack contains only a single
+ matrix.
+ glGet
+ with argument GL_MAX_MODELVIEW_STACK_DEPTH
+
+ glGet
+ with argument GL_MAX_PROJECTION_STACK_DEPTH
+
+ glGet
+ with argument GL_MAX_TEXTURE_STACK_DEPTH
+
+ glGet
+ with argument GL_MAX_TEXTURE_UNITS
+
+ glActiveTexture, + glFrustum, + glGet, + glLoadIdentity, + glLoadMatrix, + glMatrixMode, + glMultMatrix, + glOrtho, + glRotate, + glScale, + glTranslate, + glViewport +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glReadPixels — read a block of pixels from the color buffer
void glReadPixels( | GLint x, |
GLint y, | |
GLsizei width, | |
GLsizei height, | |
GLenum format, | |
GLenum type, | |
GLvoid * pixels) ; |
x
, y
+ Specify the window coordinates of the first pixel + that is read from the color buffer. This location is the + lower left corner of a rectangular block of pixels.
width
, height
+ Specify the dimensions of the pixel rectangle.
+ width
and height
+ of one correspond to a single pixel.
format
+ Specifies the format of the pixel data. Must be either
+ GL_RGBA
or the value of
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
.
type
+ Specifies the data type of the pixel data. Must be either
+ GL_UNSIGNED_BYTE
or the value of
+ GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
.
pixels
+ Returns the pixel data.
glReadPixels
+ returns pixel data from the color buffer, starting with the
+ pixel whose lower left corner is at location
+ (x
, y
),
+ into client memory starting at location
+ pixels
.
+ The processing of the pixel data before it is placed into
+ client memory can be controlled with
+ glPixelStorei.
+
glReadPixels
+ returns values from each pixel with lower left corner at
+ i
th pixel
+ in the j
th row.
+ Pixels are returned in row order from the lowest to the
+ highest row, left to right in each row.
format
+ specifies the format of the returned pixel values; accepted values are:
GL_ALPHA
GL_RGB
GL_RGBA
+ RGBA color components are read from the color buffer. + Each color component is converted to floating point such that zero intensity + maps to 0.0 and full intensity maps to 1.0. +
Unneeded data is then discarded. For example,
+ GL_ALPHA
+ discards the red, green, and blue components, while
+ GL_RGB
+ discards only the alpha component.
+ GL_LUMINANCE
+ computes a single-component value as the sum of the red, green,
+ and blue components, and
+ GL_LUMINANCE_ALPHA
+ does the same, while keeping alpha as a second value. The final
+ values are clamped to the range [0, 1].
Finally, the components are converted to the proper, as
+ specified by type
where each
+ component is multiplied by
+ n
is the number of bits
+ per component.
Return values are placed in memory as follows. If
+ format
is
+ GL_ALPHA
,
+ a single value is returned and the data for the
+ i
th pixel in the
+ j
th row is placed in location
+ GL_RGB
returns three values and
+ GL_RGBA
returns four values for each pixel, with all values
+ corresponding to a single pixel occupying contiguous space in
+ pixels
.
+ Storage parameter GL_PACK_ALIGNMENT
set by
+ glPixelStorei,
+ affects the way that data is written into memory. See
+ glPixelStorei
+ for a description.
+ Only two format
/type
parameter pairs are
+ accepted. GL_RGBA
/GL_UNSIGNED_BYTE
is
+ always accepted, and the other acceptable pair can be discovered by querying
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
and
+ GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
.
+
Values for pixels that lie outside the window connected + to the current GL context are undefined.
If an error is generated, no change is made to the
+ contents of pixels
.
GL_INVALID_ENUM
is generated if
+ format
is not
+ GL_RGBA
or the value of
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
.
GL_INVALID_ENUM
is generated if
+ type
is not
+ GL_UNSIGNED_BYTE
or the value of
+ GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
.
GL_INVALID_VALUE
is generated if either
+ width
or
+ height
is negative.
+ GL_INVALID_OPERATION
is generated if type
is
+ GL_UNSIGNED_SHORT_5_6_5
+ and format
is not GL_RGB
.
+
+ GL_INVALID_OPERATION
is generated if type
is
+ GL_UNSIGNED_SHORT_4_4_4_4
or
+ GL_UNSIGNED_SHORT_5_5_5_1
+ and format
is not GL_RGBA
.
+
+ GL_INVALID_OPERATION
is generated if format
+ and type
are neither GL_RGBA
and
+ GL_UNSIGNED_BYTE
, respectively, nor the format/type pair
+ returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
+ and GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
.
+
+ glGet
+ with argument GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
+ glGet
+ with argument GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
+ glGet with argument GL_PACK_ALIGNMENT
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glRotate — multiply the current matrix by a rotation matrix
void glRotatef( | GLfloat angle, |
GLfloat x, | |
GLfloat y, | |
GLfloat z) ; |
void glRotatex( | GLfixed angle, |
GLfixed x, | |
GLfixed y, | |
GLfixed z) ; |
angle
+ Specifies the angle of rotation, in degrees.
x
,
+ y
,
+ z
+ Specify the
+ x
,
+ y
, and
+ z
+ coordinates of a vector, respectively.
glRotate
produces a rotation of
+ angle
degrees around the vector
+
Where
+
If the matrix mode is either GL_MODELVIEW
or
+ GL_PROJECTION
, all objects drawn after
+ glRotate
is called are rotated. Use
+ glPushMatrix
+ and
+ glPopMatrix
+ to save and restore the unrotated coordinate system.
This rotation follows the right-hand rule, so if the vector
+
+ glGet with argument GL_MATRIX_MODE
+
+ glGet with argument GL_MODELVIEW_MATRIX
+
+ glGet with argument GL_PROJECTION_MATRIX
+
+ glGet with argument GL_TEXTURE_MATRIX
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glSampleCoverage — specify mask to modify multisampled pixel fragments
void glSampleCoverage( | GLclampf value, |
GLboolean invert) ; |
void glSampleCoveragex( | GLclampx value, |
GLboolean invert) ; |
value
+ Specifies the coverage of the modification mask. + The value is clamped to the range [0, 1], where 0 represents + no coverage and 1 full coverage. The initial value is 1.
invert
+ Specifies whether the modification mask implied by
+ value
is inverted or not.
+ The initial value is GL_FALSE
.
+
glSampleCoverage
defines a mask to modify
+ the coverage of multisampled pixel fragments. This capability is used
+ for antialiased screen-door transparency and smooth transitions between
+ two renderings of an object (often for level-of-detail management in
+ simulation systems).
+ When multisampling is enabled (see
+ glEnable
+ with argument
+ GL_MULTISAMPLE
) a ``fragment mask'' is computed for
+ each fragment
+ generated by a primitive. This mask reflects the amount of the pixel
+ covered by the fragment, and determines the frame buffer samples that may
+ be affected by the fragment.
+ If conversion of alpha values to masks is enabled
+ (glEnable
+ with argument
+ GL_SAMPLE_ALPHA_TO_COVERAGE
),
+ the fragment alpha value is used to
+ generate a temporary modification mask which is then ANDed with the
+ fragment mask. One way to interpret this is as a form of dithering: a
+ multivalued alpha (coverage or opacity) for the whole fragment is
+ converted to simple binary values of coverage at many locations (the
+ samples).
+ After conversion of alpha values to masks, if replacement of alpha values
+ is enabled
+ (glEnable
+ with argument
+ GL_SAMPLE_ALPHA_TO_ONE
), the
+ fragment's alpha is set to the maximum allowable value.
+ Finally, if fragment mask modification is enabled
+ (glEnable
+ with argument
+ GL_SAMPLE_COVERAGE
),
+ glSampleCoverage
defines an additional modification
+ mask. value is used to generate a modification mask in much the same way
+ alpha was used above. If invert is GL_TRUE
,
+ then the modification mask
+ specified by value will be inverted. The final modification mask will
+ then be ANDed with the fragment mask resulting from the previous steps.
+ This can be viewed as an ``override'' control that selectively fades the
+ effects of multisampled fragments.
Note that
+ glSampleCoverage
(value, GL_TRUE
)
+ is not necessarily equivalent to
+ glSampleCoverage
(1.0 - value, GL_FALSE
);
+ due to round-off and other
+ issues, complementing the coverage will not necessarily yield an inverted
+ modification mask.
+ glGet with argument GL_SAMPLE_COVERAGE_VALUE
+
+ glGet with argument GL_SAMPLE_COVERAGE_INVERT
+
+ glIsEnabled with argument GL_SAMPLE_ALPHA_TO_COVERAGE
+
+ glIsEnabled with argument GL_SAMPLE_COVERAGE
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glScale — multiply the current matrix by a general scaling + matrix
void glScalef( | GLfloat x, |
GLfloat y, | |
GLfloat z) ; |
void glScalex( | GLfixed x, |
GLfixed y, | |
GLfixed z) ; |
+ glScale
produces a nonuniform scaling along the
+ x
,
+ y
, and
+ z
+ axes. The three parameters indicate the desired scale factor
+ along each of the three axes.
The current matrix (see
+ glMatrixMode)
+ is multiplied by this scale matrix, and the product replaces
+ the current matrix as if glScale
+ were called with the following matrix as its argument:
If the matrix mode is either GL_MODELVIEW
or
+ GL_PROJECTION
, all objects drawn after
+ glScale
is called are scaled.
Use + glPushMatrix + and + glPopMatrix + to save and restore the unscaled coordinate system.
If scale factors other than 1 are applied to the
+ modelview matrix and lighting is enabled, lighting often
+ appears wrong. In that case, enable automatic normalization of
+ normals by calling
+ glEnable
+ with the argument GL_NORMALIZE
.
+ glGet with argument GL_MATRIX_MODE
+
+ glGet with argument GL_MODELVIEW_MATRIX
+
+ glGet with argument GL_PROJECTION_MATRIX
+
+ glGet with argument GL_TEXTURE_MATRIX
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glScissor — define the scissor box
void glScissor( | GLint x, |
GLint y, | |
GLsizei width, | |
GLsizei height) ; |
x
, y
+ Specify the lower left corner of the scissor box, in pixels. + The initial value is (0, 0).
width
, height
+ Specify the width and height of the scissor box.
+ When a GL context is first attached to a surface (e.g. window),
+ width
and height
+ are set to the dimensions of that surface.
+ glScissor
+ defines a rectangle, called the scissor box, in window
+ coordinates. The first two arguments,
+ x
and
+ y
, specify the lower left corner of the box.
+ width
and height
+ specify the width and height of the box.
To enable and disable the scissor test, call
+ glEnable and
+ glDisable
+ with argument GL_SCISSOR_TEST
.
+ The scissor test is initially disabled. While scissor test is enabled,
+ only pixels that lie within the scissor box can be modified by
+ drawing commands. Window coordinates have integer values at the
+ shared corners of frame buffer pixels.
+ glScissor
(0, 0, 1, 1)
+ allows modification of only the lower left pixel in the window,
+ and glScissor
(0, 0, 0, 0)
+ doesn't allow modification of any pixels in the window.
When the scissor test is disabled, it is as though the + scissor box includes the entire window.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glShadeModel — select flat or smooth shading
void glShadeModel( | GLenum mode) ; |
mode
+ Specifies a symbolic value representing a shading
+ technique. Accepted values are GL_FLAT
and
+ GL_SMOOTH
. The initial value is
+ GL_SMOOTH
.
GL primitives can have either flat or smooth shading. + Smooth shading, the default, causes the computed colors of + vertices to be interpolated as the primitive is rasterized, + typically assigning different colors to each resulting pixel + fragment. Flat shading selects the computed color of just one + vertex and assigns it to all the pixel fragments generated by + rasterizing a single primitive. In either case, the computed + color of a vertex is the result of lighting if lighting is + enabled, or it is the current color at the time the vertex was + specified if lighting is disabled.
+ Flat and smooth shading are indistinguishable for points.
+ Starting when glDrawArrays
+ or glDrawElements
+ is issued and counting vertices and
+ primitives from 1, the GL gives each flat-shaded line segment
+
+
+ Primitive Type of Polygon
+ | + Vertex + |
---|---|
+ Triangle strip + |
+ |
+ Triangle fan + |
+ |
+ Independent triangle + |
+ |
Flat and smooth shading are specified by
+ glShadeModel
with
+ mode
set to
+ GL_FLAT
and
+ GL_SMOOTH
, respectively.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glStencilFunc — set function and reference value for stencil + testing
void glStencilFunc( | GLenum func, |
GLint ref, | |
GLuint mask) ; |
func
+ Specifies the test function. Eight tokens are valid:
+ GL_NEVER
,
+ GL_LESS
,
+ GL_LEQUAL
,
+ GL_GREATER
,
+ GL_GEQUAL
,
+ GL_EQUAL
,
+ GL_NOTEQUAL
, and
+ GL_ALWAYS
. The initial value is
+ GL_ALWAYS
.
ref
+ Specifies the reference value for the stencil test.
+ ref
+ is clamped to the range
+ n
is
+ the number of bitplanes in the stencil buffer. The
+ initial value is 0.
mask
+ Specifies a mask that is ANDed with both the + reference value and the stored stencil value when the + test is done. The initial value is all 1's.
Stenciling, like depth-buffering, enables and disables + drawing on a per-pixel basis. + Stencil planes are first drawn into using GL drawing primitives, then + geometry and images are rendered using the stencil planes to mask out + portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, such as decals, outlining, and + constructive solid geometry rendering.
The stencil test conditionally eliminates a pixel based
+ on the outcome of a comparison between the reference value and
+ the value in the stencil buffer. To enable and disable stencil
+ test, call
+ glEnable and
+ glDisable
+ with argument
+ GL_STENCIL_TEST
.
+ Stencil test is initially disabled.
+ To specify actions based on the outcome of the stencil test, call
+ glStencilOp.
+
+ func
+ is a symbolic constant that determines the stencil comparison
+ function. It accepts one of eight values, shown in the
+ following list. ref
+ is an integer reference value that is used in the stencil
+ comparison. It is clamped to the range
+ n
+ is the number of bitplanes in the stencil buffer.
+ mask
+ is bitwise ANDed with both the reference value and the stored
+ stencil value, with the ANDed values participating in the
+ comparison.
If stencil
+ represents the value stored in the corresponding stencil buffer
+ location, the following list shows the effect of each
+ comparison function that can be specified by
+ func
.
+ Only if the comparison succeeds is the pixel passed through
+ to the next stage in the rasterization process (see
+ glStencilOp).
+ All tests treat stencil
+ values as unsigned integers in the range
+ n
+ is the number of bitplanes in the stencil buffer.
The following values are accepted by
+ func
:
GL_NEVER
+ Always fails.
GL_LESS
+ Passes if
+
GL_LEQUAL
+ Passes if
+
GL_GREATER
+ Passes if
+
GL_GEQUAL
+ Passes if
+
GL_EQUAL
+ Passes if
+
GL_NOTEQUAL
+ Passes if
+
GL_ALWAYS
+ Always passes.
Initially, the stencil test is disabled. If there is no + stencil buffer, no stencil modification can occur and it is as + if the stencil test always passes.
+ glAlphaFunc, + glBlendFunc, + glDepthFunc, + glEnable, + glGet, + glLogicOp, + glStencilOp +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glStencilMask — control the writing of individual bits in the + stencil planes
void glStencilMask( | GLuint mask) ; |
mask
+ Specifies a bit mask to enable and disable writing + of individual bits in the stencil planes. The initial value + is all 1's.
glStencilMask
+ controls the writing of individual bits in the stencil planes.
+ The least significant n
+ bits of mask
, where
+ n
+ is the number of bits in the stencil buffer, specify a mask.
+ Where a 1 appears in the mask, it's possible to write to the
+ corresponding bit in the stencil buffer. Where a 0 appears, the
+ corresponding bit is write-protected. Initially, all bits are
+ enabled for writing.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glStencilOp — set stencil test actions
void glStencilOp( | GLenum fail, |
GLenum zfail, | |
GLenum zpass) ; |
fail
+ Specifies the action to take when the stencil test
+ fails. Six symbolic constants are accepted:
+ GL_KEEP
,
+ GL_ZERO
,
+ GL_REPLACE
,
+ GL_INCR
,
+ GL_DECR
, and
+ GL_INVERT
. The initial value is
+ GL_KEEP
.
zfail
+ Specifies the stencil action when the stencil test
+ passes, but the depth test fails.
+ zfail
accepts the same symbolic constants as
+ fail
. The initial value is
+ GL_KEEP
.
zpass
+ Specifies the stencil action when both the stencil
+ test and the depth test pass, or when the stencil test
+ passes and either there is no depth buffer or depth
+ testing is not enabled.
+ zpass
accepts the same symbolic constants as
+ fail
. The initial value is
+ GL_KEEP
.
Stenciling, like depth-buffering, enables and disables + drawing on a per-pixel basis. You draw into the stencil planes + using GL drawing primitives, then render geometry and images, + using the stencil planes to mask out portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, such as decals, outlining, and + constructive solid geometry rendering.
The stencil test conditionally eliminates a pixel based
+ on the outcome of a comparison between the value in the stencil
+ buffer and a reference value. To enable and disable stencil test, call
+ glEnable and
+ glDisable
+ with argument GL_STENCIL_TEST
.
+ To control it, call
+ glStencilFunc.
+ Stenciling is initially disabled.
+
glStencilOp
+ takes three arguments that indicate what happens to the stored
+ stencil value while stenciling is enabled. If the stencil test
+ fails, no change is made to the pixel's color or depth buffers,
+ and fail
+ specifies what happens to the stencil buffer contents. The
+ following six actions are possible.
GL_KEEP
+ Keeps the current value.
GL_ZERO
+ Sets the stencil buffer value to 0.
GL_REPLACE
+ Sets the stencil buffer value to
+ ref
, as specified by
+ glStencilFunc.
GL_INCR
+ Increments the current stencil buffer value. Clamps + to the maximum representable unsigned value.
GL_DECR
+ Decrements the current stencil buffer value. Clamps + to 0.
GL_INVERT
+ Bitwise inverts the current stencil buffer value.
Stencil buffer values are treated as unsigned integers.
+ When incremented and decremented, values are clamped to 0 and
+ n
is the value returned by querying
+ GL_STENCIL_BITS
.
The other two arguments to glStencilOp
+ specify stencil buffer actions that depend on whether
+ subsequent depth buffer tests succeed (zpass
)
+ or fail
+ (zfail
) (see
+ glDepthFunc).
+ The actions are specified using the same six symbolic constants as
+ fail
. Note that zfail
+ is ignored when there is no depth buffer, or when the depth
+ buffer is not enabled. In these cases, fail
and
+ zpass
+ specify stencil action when the stencil test fails and passes,
+ respectively.
If there is no
+ stencil buffer, no stencil modification can occur and it is as
+ if the stencil tests always pass, regardless of any call to
+ glStencilOp
.
GL_INVALID_ENUM
is generated if
+ fail
,
+ zfail
, or
+ zpass
+ is any value other than the six defined constant values.
+ glAlphaFunc, + glBlendFunc, + glDepthFunc, + glEnable, + glGet, + glLogicOp, + glStencilFunc +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glTexCoordPointer — define an array of texture coordinates
void glTexCoordPointer( | GLint size, |
GLenum type, | |
GLsizei stride, | |
const GLvoid * pointer) ; |
size
+ Specifies the number of coordinates per array + element. Must be 2, 3 or 4. The initial value is 4.
type
+ Specifies the data type of each texture coordinate.
+ Symbolic constants
+ GL_BYTE
,
+ GL_SHORT
, and
+ GL_FIXED
are accepted.
+ However, the initial value is
+ GL_FLOAT
.
+ The common profile accepts the symbolic constant
+ GL_FLOAT
as well.
+
stride
+ Specifies the byte offset between consecutive array
+ elements. If stride
+ is 0, the array elements are understood to be tightly
+ packed. The initial value is 0.
pointer
+ Specifies a pointer to the first coordinate of the + first element in the array. The initial value is 0.
glTexCoordPointer
+ specifies the location and data of an array of texture
+ coordinates to use when rendering. size
+ specifies the number of coordinates per element, and must be 2,
+ 3, or 4. type
+ specifies the data type of each texture coordinate and
+ stride
+ specifies the byte stride from one array element to the next
+ allowing vertices and attributes to be packed into a single
+ array or stored in separate arrays. (Single-array storage may
+ be more efficient on some implementations.)
When a texture coordinate array is specified,
+ size
,
+ type
,
+ stride
, and
+ pointer
are saved as client-side state.
+ If the texture coordinate array is enabled, it is used when
+ glDrawArrays,
+ or
+ glDrawElements
+ is called.
+ To enable and disable the texture coordinate array for the client-side
+ active texture unit, call
+ glEnableClientState
+ and
+ glDisableClientState
+ with the argument
+ GL_TEXTURE_COORD_ARRAY
.
+ The texture coordinate array is initially disabled for all client-side
+ active texture units and isn't accessed when
+ glDrawArrays or
+ glDrawElements
+ is called.
Use + glDrawArrays + to construct a sequence of primitives (all of the same type) + from prespecified vertex and vertex attribute arrays. Use + glDrawElements + to construct a sequence of primitives by indexing vertices and + vertex attributes.
+ glTexCoordPointer
+ is typically implemented on the client side.
+ glTexCoordPointer
+ updates the texture coordinate array state of the client-side active
+ texture unit, specified with
+ glClientActiveTexture.
GL_INVALID_VALUE
is generated if
+ size
is not 2, 3, or 4.
GL_INVALID_ENUM
is generated if
+ type
is not an accepted value.
GL_INVALID_VALUE
is generated if
+ stride
is negative.
+ glClientActiveTexture, + glColorPointer, + glDrawArrays, + glDrawElements, + glEnable, + glMultiTexCoord, + glNormalPointer, + glVertexPointer +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glTexEnv — set texture environment parameters
void glTexEnvf( | GLenum target, |
GLenum pname, | |
GLfloat param) ; |
void glTexEnvi( | GLenum target, |
GLenum pname, | |
GLint param) ; |
void glTexEnvx( | GLenum target, |
GLenum pname, | |
GLfixed param) ; |
target
+ Specifies a texture environment.
+ May be GL_TEXTURE_ENV
or GL_POINT_SPRITE_OES
.
+
pname
+ Specifies the symbolic name of a single-valued texture environment parameter.
+ May be either GL_TEXTURE_ENV_MODE
,
+ GL_COMBINE_RGB
,
+ GL_COMBINE_ALPHA
,
+ GL_SRC0_RGB
,
+ GL_SRC1_RGB
,
+ GL_SRC2_RGB
,
+ GL_SRC0_ALPHA
,
+ GL_SRC1_ALPHA
,
+ GL_SRC2_ALPHA
,
+ GL_OPERAND0_RGB
,
+ GL_OPERAND1_RGB
,
+ GL_OPERAND2_RGB
,
+ GL_OPERAND0_ALPHA
,
+ GL_OPERAND1_ALPHA
,
+ GL_OPERAND2_ALPHA
,
+ GL_RGB_SCALE
,
+ GL_ALPHA_SCALE
, or
+ GL_COORD_REPLACE_OES
.
+
param
+ Specifies a single symbolic constant, one of GL_ADD
, GL_ADD_SIGNED
,
+ GL_DOT3_RGB
, GL_DOT3_RGBA
, GL_INTERPOLATE
, GL_MODULATE
, GL_DECAL
,
+ GL_BLEND
, GL_REPLACE
, GL_SUBTRACT
, GL_COMBINE
,
+ GL_TEXTURE
, GL_CONSTANT
, GL_PRIMARY_COLOR
, GL_PREVIOUS
,
+ GL_SRC_COLOR
, GL_ONE_MINUS_SRC_COLOR
, GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ a single boolean value for the point sprite texture coordinate replacement,
+ or 1.0, 2.0, or 4.0 when specifying the GL_RGB_SCALE
or GL_ALPHA_SCALE
.
+
void glTexEnvfv( | GLenum target, |
GLenum pname, | |
const GLfloat * params) ; |
void glTexEnviv( | GLenum target, |
GLenum pname, | |
const GLint * params) ; |
void glTexEnvxv( | GLenum target, |
GLenum pname, | |
const GLfixed * params) ; |
target
+ Specifies a texture environment.
+ May be GL_TEXTURE_ENV
or GL_POINT_SPRITE_OES
.
+
pname
+ Specifies the symbolic name of a single-valued texture environment parameter.
+ May be either GL_TEXTURE_ENV_MODE
,
+ GL_TEXTURE_ENV_COLOR
,
+ GL_COMBINE_RGB
,
+ GL_COMBINE_ALPHA
,
+ GL_SRC0_RGB
,
+ GL_SRC1_RGB
,
+ GL_SRC2_RGB
,
+ GL_SRC0_ALPHA
,
+ GL_SRC1_ALPHA
,
+ GL_SRC2_ALPHA
,
+ GL_OPERAND0_RGB
,
+ GL_OPERAND1_RGB
,
+ GL_OPERAND2_RGB
,
+ GL_OPERAND0_ALPHA
,
+ GL_OPERAND1_ALPHA
,
+ GL_OPERAND2_ALPHA
,
+ GL_RGB_SCALE
,
+ GL_ALPHA_SCALE
, or
+ GL_COORD_REPLACE_OES
.
+
params
+ Specifies a pointer to a parameter array that contains either an RGBA color,
+ a single symbolic constant, one of GL_ADD
, GL_ADD_SIGNED
,
+ GL_DOT3_RGB
, GL_DOT3_RGBA
, GL_INTERPOLATE
, GL_MODULATE
, GL_DECAL
,
+ GL_BLEND
, GL_REPLACE
, GL_SUBTRACT
, GL_COMBINE
,
+ GL_TEXTURE
, GL_CONSTANT
, GL_PRIMARY_COLOR
, GL_PREVIOUS
,
+ GL_SRC_COLOR
, GL_ONE_MINUS_SRC_COLOR
, GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ a single boolean value for the point sprite texture coordinate replacement,
+ or 1.0, 2.0, or 4.0 when specifying the GL_RGB_SCALE
or GL_ALPHA_SCALE
.
+
+ A texture environment specifies how texture values are interpreted when a
+ fragment is textured. When target
is GL_POINT_SPRITE_OES
,
+ pname
must be GL_COORD_REPLACE_OES
. When target
is
+ GL_TEXTURE_ENV
, pname
can be GL_TEXTURE_ENV_MODE
,
+ GL_TEXTURE_ENV_COLOR
, GL_COMBINE_RGB
, GL_COMBINE_ALPHA
,
+ GL_RGB_SCALE
, GL_ALPHA_SCALE
,
+ GL_OPERAND0_RGB
, GL_OPERAND1_RGB
, GL_OPERAND2_RGB
,
+ GL_OPERAND0_ALPHA
, GL_OPERAND1_ALPHA
, GL_OPERAND2_ALPHA
,
+ GL_SRC0_RGB
, GL_SRC1_RGB
, GL_SRC2_RGB
,
+ GL_SRC0_ALPHA
, GL_SRC1_ALPHA
, or GL_SRC2_ALPHA
.
+
+ If pname
is GL_TEXTURE_ENV_MODE
,
+ then params
is (or points to) the symbolic name of a texture function.
+ Six texture functions may be specified:
+ GL_ADD
,
+ GL_MODULATE
,
+ GL_DECAL
,
+ GL_BLEND
,
+ GL_REPLACE
, or
+ GL_COMBINE
.
+
+ The following table shows the correspondence of filtered texture
+ values
+
+
+ Texture Base Internal Format + |
+ |
+ |
---|---|---|
+ GL_ALPHA
+ | + (0, 0, 0) + |
+ |
+ GL_LUMINANCE
+ |
+ (
+ | + 1 + |
+ GL_LUMINANCE_ALPHA
+ |
+ (
+ |
+ |
+ GL_RGB
+ |
+ (
+ | + 1 + |
+ GL_RGBA
+ |
+ (
+ |
+ |
+ A texture function acts on the fragment to be textured using
+ the texture image value that applies to the fragment
+ (see glTexParameter)
+ and produces an RGBA color for that fragment.
+ The following table shows how the RGBA color is produced for each
+ of the first five texture functions that can be chosen.
+
+
+ Texture Base Internal Format + |
+ Value
+ |
+ GL_REPLACE Function
+ |
+ GL_MODULATE Function
+ |
+ GL_DECAL Function
+ |
+ GL_BLEND Function
+ |
+ GL_ADD Function
+ |
---|---|---|---|---|---|---|
+ GL_ALPHA
+ |
+ |
+ |
+ | + undefined + |
+ |
+ |
+ |
+ |
+ |
+ | + |
+ |
+ |
+ GL_LUMINANCE
+ |
+ |
+ |
+ | + undefined + |
+ |
+ |
+ (or 1) + |
+ |
+ |
+ | + |
+ |
+ |
+ GL_LUMINANCE_ALPHA
+ |
+ |
+ |
+ | + undefined + |
+ |
+ |
+ (or 2) + |
+ |
+ |
+ | + |
+ |
+ |
+ GL_RGB
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ (or 3) + |
+ |
+ |
+ |
+ |
+ |
+ |
+ GL_RGBA
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ (or 4) + |
+ |
+ |
+ |
+ |
+ |
+ |
+ If pname
is GL_TEXTURE_ENV_MODE
, and params
is GL_COMBINE
, the
+ form of the texture function depends on the values of GL_COMBINE_RGB
+ and GL_COMBINE_ALPHA
.
+
+ The following describes how the texture sources, as specified by
+ GL_SRC0_RGB
, GL_SRC1_RGB
, GL_SRC2_RGB
,
+ GL_SRC0_ALPHA
, GL_SRC1_ALPHA
, and GL_SRC2_ALPHA
,
+ are combined to produce a final texture color. In the following tables,
+ GL_SRC0_c
is represented by
+ GL_SRC1_c
is
+ represented by
+ GL_SRC2_c
is represented by
+
+ GL_COMBINE_RGB
accepts any of GL_REPLACE
, GL_MODULATE
,
+ GL_ADD
, GL_ADD_SIGNED
, GL_INTERPOLATE
, GL_SUBTRACT
,
+ GL_DOT3_RGB
, or GL_DOT3_RGBA
.
+
+
+ GL_COMBINE_RGB
+ | + Texture Function + |
---|---|
+ GL_REPLACE
+ |
+ |
+ GL_MODULATE
+ |
+ |
+ GL_ADD
+ |
+ |
+ GL_ADD_SIGNED
+ |
+ |
+ GL_INTERPOLATE
+ |
+ |
+ GL_SUBTRACT
+ |
+ |
+ GL_DOT3_RGB
+ or
+ GL_DOT3_RGBA
+ |
+
+ |
+ The scalar results for GL_DOT3_RGB
and GL_DOT3_RGBA
are placed
+ into each of the 3 (RGB) or 4 (RGBA) components on output.
+
+ Likewise, GL_COMBINE_ALPHA
accepts any of GL_REPLACE
,
+ GL_MODULATE
, GL_ADD
, GL_ADD_SIGNED
, GL_INTERPOLATE
, or
+ GL_SUBTRACT
. The following table describes how alpha values are
+ combined:
+
+
+ GL_COMBINE_ALPHA
+ | + Texture Function + |
---|---|
+ GL_REPLACE
+ |
+ |
+ GL_MODULATE
+ |
+ |
+ GL_ADD
+ |
+ |
+ GL_ADD_SIGNED
+ |
+ |
+ GL_INTERPOLATE
+ |
+ |
+ GL_SUBTRACT
+ |
+ |
+ In the following tables, the value
+
+ The following table describes the values assigned to
+
+
+ GL_SRCn_RGB
+ |
+ GL_OPERANDn_RGB
+ | + Argument Value + |
---|---|---|
+ GL_TEXTURE
+ |
+ GL_SRC_COLOR
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ |
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_TEXTUREn
+ |
+ GL_SRC_COLOR
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ |
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_CONSTANT
+ |
+ GL_SRC_COLOR
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ |
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_PRIMARY_COLOR
+ |
+ GL_SRC_COLOR
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ |
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_PREVIOUS
+ |
+ GL_SRC_COLOR
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ |
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ For GL_TEXTUREn
sources,
+
+ The follow table describes the values assigned to
+
+
+ GL_SRCn_ALPHA
+ |
+ GL_OPERANDn_ALPHA
+ | + Argument Value + |
---|---|---|
+ GL_TEXTURE
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_TEXTUREn
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_CONSTANT
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_PRIMARY_COLOR
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_PREVIOUS
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ The RGB and alpha results of the texture function are multipled by the
+ values of GL_RGB_SCALE
and GL_ALPHA_SCALE
, respectively, and
+ clamped to the range
+
+ If pname
is GL_TEXTURE_ENV_COLOR
,
+ params
is a pointer to an array that holds an RGBA color consisting of four
+ values.
+ Integer color components are interpreted linearly such that the most
+ positive integer maps to 1.0,
+ and the most negative integer maps to -1.0.
+ The values are clamped to the range [0,1] when they are specified.
+
+ GL_TEXTURE_ENV_MODE
defaults to GL_MODULATE
and
+ GL_TEXTURE_ENV_COLOR
defaults to (0, 0, 0, 0).
+
+ If target
is GL_POINT_SPRITE_OES
and pname
is GL_COORD_REPLACE_OES
, the boolean value specified
+ is used to either enable or disable point sprite texture coordinate replacement. The default value is GL_FALSE
.
+
+ glTexEnv
controls
+ the texture environment for the current active texture unit, selected by
+ glActiveTexture.
+
+ GL_POINT_SPRITE_OES
and GL_COORD_REPLACE_OES
are available
+ only if the OpenGL ES version is 1.1 or greater.
+
+ GL_INVALID_ENUM
is generated when target
or pname
is not
+ one of the accepted defined values,
+ or when params
should have a defined constant value
+ (based on the value of pname
)
+ and does not.
+
+ GL_INVALID_VALUE
is generated if the params
value for
+ GL_RGB_SCALE
or GL_ALPHA_SCALE
are not one of 1.0, 2.0,
+ or 4.0.
+
+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glTexImage2D, + glTexParameter, + glTexSubImage2D +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glTexImage2D — specify a two-dimensional texture image
void glTexImage2D( | GLenum target, |
GLint level, | |
GLint internalformat, | |
GLsizei width, | |
GLsizei height, | |
GLint border, | |
GLenum format, | |
GLenum type, | |
const GLvoid * pixels) ; |
target
+ Specifies the target texture. Must be
+ GL_TEXTURE_2D
.
level
+ Specifies the level-of-detail number. Level 0 is
+ the base image level. Level n
is the
+ n
th mipmap reduction image.
+ Must be greater or equal 0.
internalformat
+ Specifies the color components in the
+ texture. Must be same as format
.
+ The following symbolic values are accepted:
+ GL_ALPHA
,
+ GL_RGB
,
+ GL_RGBA
,
+ GL_LUMINANCE
, or
+ GL_LUMINANCE_ALPHA
.
width
+ Specifies the width of the texture image. Must be
+ n
.
+ All implementations support texture images that are at
+ least 64 texels wide.
height
+ Specifies the height of the texture image. Must be
+ m
.
+ All implementations support texture images that are at
+ least 64 texels high.
border
+ Specifies the width of the border. Must be 0.
format
+ Specifies the format of the pixel data. Must be same
+ as internalformat
. The following
+ symbolic values are accepted:
+ GL_ALPHA
,
+ GL_RGB
,
+ GL_RGBA
,
+ GL_LUMINANCE
, and
+ GL_LUMINANCE_ALPHA
.
type
+ Specifies the data type of the pixel data. The
+ following symbolic values are accepted:
+ GL_UNSIGNED_BYTE
,
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
, and
+ GL_UNSIGNED_SHORT_5_5_5_1
.
pixels
+ Specifies a pointer to the image data in memory.
Texturing maps a portion of a specified texture image
+ onto each graphical primitive for which texturing is enabled.
+ To enable and disable two-dimensional texturing, call
+ glEnable and
+ glDisable
+ with argument GL_TEXTURE_2D
.
+ Two-dimensional texturing is initially disabled.
+
To define texture images, call
+ glTexImage2D
.
+ The arguments describe the parameters of the texture image,
+ such as height, width, width of the border, level-of-detail
+ number (see
+ glTexParameter),
+ and number of color components provided. The last three
+ arguments describe how the image is represented in memory.
Data is read from pixels
+ as a sequence of unsigned bytes or shorts, depending on
+ type
.
+ These values are grouped into sets of one, two, three, or
+ four values, depending on format
,
+ to form elements.
When type
is
+ GL_UNSIGNED_BYTE
, each of these bytes is
+ interpreted as one color component, depending on
+ format
.
+ When type
is one of
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
,
+ GL_UNSIGNED_SHORT_5_5_5_1
,
+ each unsigned value is interpreted as containing all the components
+ for a single pixel, with the color components arranged according to
+ format.
The first element corresponds to the lower left corner of + the texture image. Subsequent elements progress left-to-right + through the remaining texels in the lowest row of the texture + image, and then in successively higher rows of the texture + image. The final element corresponds to the upper right corner + of the texture image.
By default, adjacent pixels are taken from adjacent memory
+ locations, except that after all width
pixels are
+ read, the read pointer is advanced to the next four-byte boundary.
+ The four-byte row alignment is specified by
+ glPixelStorei
+ with argument GL_UNPACK_ALIGNMENT
, and it can be set
+ to one, two, four, or eight bytes.
format
+ determines the composition of each element in
+ pixels
.
+ It can assume one of the following symbolic values:
GL_ALPHA
+ Each element is a single alpha component. The GL + converts it to floating point and assembles it into an + RGBA element by attaching 0 for red, green, and blue.
GL_RGB
+ Each element is an RGB triple. The GL converts it + to fixed-point or floating-point and assembles it into an + RGBA element by attaching 1 for alpha.
GL_RGBA
+ Each element contains all four components. The GL + converts it to fixed-point or floating-point.
GL_LUMINANCE
+ Each element is a single luminance value. The GL + converts it to fixed-point or floating-point, then + assembles it into an RGBA element by replicating the + luminance value three times for red, green, and blue and + attaching 1 for alpha.
GL_LUMINANCE_ALPHA
+ Each element is a luminance/alpha pair. The GL + converts it to fixed-point or floating point, then + assembles it into an RGBA element by replicating the + luminance value three times for red, green, and blue.
pixels
+ may be NULL
. In this case texture memory is allocated
+ to accommodate a texture of width width
and height
+ height
.
+ You can then download subtextures to initialize this texture
+ memory. The image is undefined if the user tries to apply an
+ uninitialized portion of the texture image to a primitive.
glTexImage2D
+ specifies the two-dimensional texture for the currently bound texture
+ specified with
+ glBindTexture,
+ and the current texture
+ unit, specified with
+ glActiveTexture.
+
GL_INVALID_ENUM
is generated if
+ target
is not
+ GL_TEXTURE_2D
.
GL_INVALID_ENUM
is generated if
+ format
is not an accepted constant.
GL_INVALID_ENUM
is generated if
+ type
is not an accepted constant.
GL_INVALID_VALUE
is generated if
+ level
is less than 0.
GL_INVALID_VALUE
may be generated if
+ level
is greater than
+ max
is the returned value of
+ GL_MAX_TEXTURE_SIZE
.
GL_INVALID_VALUE
is generated if
+ internalformat
+ is not an accepted constant.
GL_INVALID_VALUE
is generated if
+ width
or height
+ is less than 0 or greater than GL_MAX_TEXTURE_SIZE
,
+ or if either cannot be represented as
+ k
.
GL_INVALID_VALUE
is generated if
+ border
is not 0.
GL_INVALID_OPERATION
is generated if
+ internalformat
and
+ format
are not the same.
GL_INVALID_OPERATION
is generated if
+ type
is
+ GL_UNSIGNED_SHORT_5_6_5
and
+ format
is not
+ GL_RGB
.
GL_INVALID_OPERATION
is generated if
+ type
is one of
+ GL_UNSIGNED_SHORT_4_4_4_4
, or
+ GL_UNSIGNED_SHORT_5_5_5_1
and
+ format
is not
+ GL_RGBA
.
+ glActiveTexture, + glBindTexture, + glCopyTexImage2D, + glCopyTexSubImage2D, + glGet, + glMatrixMode, + glPixelStorei, + glTexEnv, + glTexSubImage2D, + glTexParameter +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glTexParameter — set texture parameters
void glTexParameterf( | GLenum target, |
GLenum pname, | |
GLfloat param) ; |
void glTexParameteri( | GLenum target, |
GLenum pname, | |
GLint param) ; |
void glTexParameterx( | GLenum target, |
GLenum pname, | |
GLfixed param) ; |
target
+ Specifies the target texture, which must be
+ GL_TEXTURE_2D
.
pname
+ Specifies the symbolic name of a single-valued texture
+ parameter. Which can be one of the following:
+ GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_WRAP_S
,
+ GL_TEXTURE_WRAP_T
, or
+ GL_GENERATE_MIPMAP
.
param
+ Specifies the value of pname
.
void glTexParameterfv( | GLenum target, |
GLenum pname, | |
GLfloat * params) ; |
void glTexParameteriv( | GLenum target, |
GLenum pname, | |
GLint * params) ; |
void glTexParameterxv( | GLenum target, |
GLenum pname, | |
GLfixed * params) ; |
target
+ Specifies the target texture, which must be
+ GL_TEXTURE_2D
.
pname
+ Specifies the symbolic name of a texture parameter. Which can
+ be one of the following: GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_WRAP_S
,
+ GL_TEXTURE_WRAP_T
, or
+ GL_GENERATE_MIPMAP
.
params
+ Specifies a pointer to an array where the value or values of
+ pname
are stored.
Texture mapping is a technique that applies an image onto an
+ object's surface as if the image were a decal or cellophane shrink-wrap.
+ The image is created in texture space, with an
glTexParameter
assigns the value in
+ param
or params
to the
+ texture parameter specified as pname
.
+ target
defines the target texture, which must be
+ GL_TEXTURE_2D
.
The following symbols are accepted in
+ pname
:
GL_TEXTURE_MIN_FILTER
+ The texture minifying function is used whenever the pixel + being textured maps to an area greater than one texture element. + There are six defined minifying functions. Two of them use the + nearest one or nearest four texture elements to compute the texture + value. The other four use mipmaps.
A mipmap is an ordered set of arrays representing the same
+ image at progressively lower resolutions. If the texture has
+ dimensions level
argument
+ indicating the order of the mipmaps. Level 0 is the original
+ texture. Level
param
supplies a function for minifying
+ the texture as one of the following:
+
GL_NEAREST
+ Returns the value of the texture element that is nearest (in + Manhattan distance) to the center of the pixel being + textured.
GL_LINEAR
+ Returns the weighted average of the four texture elements
+ that are closest to the center of the pixel being textured. These
+ can include repeated or wrapped elements, depending on the values
+ of GL_TEXTURE_WRAP_S
and
+ GL_TEXTURE_WRAP_T
, and on the exact
+ mapping.
GL_NEAREST_MIPMAP_NEAREST
+ Chooses the mipmap that most closely matches the size of the
+ pixel being textured and uses the GL_NEAREST
+ criterion (the texture element nearest to the center of the pixel)
+ to produce a texture value.
GL_LINEAR_MIPMAP_NEAREST
+ Chooses the mipmap that most closely matches the size of the
+ pixel being textured and uses the GL_LINEAR
+ criterion (a weighted average of the four texture elements that
+ are closest to the center of the pixel) to produce a texture
+ value.
GL_NEAREST_MIPMAP_LINEAR
+ Chooses the two mipmaps that most closely match the size of
+ the pixel being textured and uses the
+ GL_NEAREST
criterion (the texture element
+ nearest to the center of the pixel) to produce a texture value
+ from each mipmap. The final texture value is a weighted average of
+ those two values.
GL_LINEAR_MIPMAP_LINEAR
+ Chooses the two mipmaps that most closely match the size of
+ the pixel being textured and uses the
+ GL_LINEAR
criterion (a weighted average of
+ the four texture elements that are closest to the center of the
+ pixel) to produce a texture value from each mipmap. The final
+ texture value is a weighted average of those two values.
As more texture elements are sampled in the minification
+ process, fewer aliasing artifacts will be apparent. While the
+ GL_NEAREST
and GL_LINEAR
+ minification functions can be faster than the other four, they
+ sample only one or four texture elements to determine the texture
+ value of the pixel being rendered and can produce moire patterns
+ or ragged transitions.
+
The initial value of GL_TEXTURE_MIN_FILTER
is
+ GL_NEAREST_MIPMAP_LINEAR
.
GL_TEXTURE_MAG_FILTER
+ The texture magnification function is used when the pixel
+ being textured maps to an area less than or equal to one texture
+ element. It sets the texture magnification function to either
+ GL_NEAREST
or GL_LINEAR
+ (see below). GL_NEAREST
is generally faster
+ than GL_LINEAR
, but it can produce textured
+ images with sharper edges because the transition between texture
+ elements is not as smooth.
+
GL_NEAREST
+ Returns the value of the texture element that is nearest (in + Manhattan distance) to the center of the pixel being + textured.
GL_LINEAR
+ Returns the weighted average of the four texture elements
+ that are closest to the center of the pixel being textured. These
+ can include repeated or wrapped elements, depending on the values
+ of GL_TEXTURE_WRAP_S
and
+ GL_TEXTURE_WRAP_T
, and on the exact
+ mapping.
+
The initial value of GL_TEXTURE_MAG_FILTER
is
+ GL_LINEAR
.
GL_TEXTURE_WRAP_S
+ Sets the wrap parameter for texture coordinate
+ s
to either
+ GL_CLAMP_TO_EDGE
or
+ GL_REPEAT
.
+
GL_CLAMP_TO_EDGE
+ causes s
coordinates to be
+ clamped to the range N
is the
+ size of the texture in the direction of clamping.
GL_REPEAT
+ causes the integer part of the
+ s
coordinate to be ignored; the GL
+ uses only the fractional part, thereby creating a repeating
+ pattern.
+
The initial value of GL_TEXTURE_WRAP_S
is
+ GL_REPEAT
.
GL_TEXTURE_WRAP_T
+ Sets the wrap parameter for texture coordinate
+ t
to either
+ GL_CLAMP_TO_EDGE
or
+ GL_REPEAT
. See the discussion under
+ GL_TEXTURE_WRAP_S
.
The initial value of GL_TEXTURE_WRAP_T
is
+ GL_REPEAT
.
GL_GENERATE_MIPMAP
+ Sets the automatic mipmap generation parameter. If set to
+ GL_TRUE
, making any change to the interior
+ texels of the
The initial value of GL_GENERATE_MIPMAP
+ is GL_FALSE
.
Suppose that a program has enabled texturing (by calling
+ glEnable with argument GL_TEXTURE_2D
and has
+ set GL_TEXTURE_MIN_FILTER
to one of the functions
+ that requires a mipmap. If either the dimensions of the texture images
+ currently defined (with previous calls to glTexImage2D, or glCopyTexImage2D) do not follow the proper sequence for mipmaps
+ (described above), or there are fewer texture images defined than are
+ needed, or the set of texture images have differing numbers of texture
+ components, then it is as if texture mapping were disabled.
Linear filtering accesses the four nearest texture elements.
glTexParameter
specifies the texture parameters
+ for the texture bound to the active texture unit, specified by calling glActiveTexture.
GL_INVALID_ENUM
is generated if
+ target
or pname
is not one
+ of the accepted defined values.
GL_INVALID_ENUM
is generated if
+ param
should have a defined constant value (based
+ on the value of pname
) and does not.
glActiveTexture, glBindTexture, glCopyTexImage2D, glCopyTexSubImage2D, glEnable, glPixelStorei, glTexEnv, glTexImage2D, glTexSubImage2D
Copyright © 2003-2004 Silicon + Graphics, Inc. This document is licensed under the SGI Free Software B + License. For details, see http://oss.sgi.com/projects/FreeB/.
glTexSubImage2D — specify a two-dimensional texture subimage
void glTexSubImage2D( | GLenum target, |
GLint level, | |
GLint xoffset, | |
GLint yoffset, | |
GLsizei width, | |
GLsizei height, | |
GLenum format, | |
GLenum type, | |
const GLvoid * pixels) ; |
target
+ Specifies the target texture. Must be
+ GL_TEXTURE_2D
.
level
+ Specifies the level-of-detail number. Level 0 is
+ the base image level. Level n
is the
+ n
th mipmap reduction image.
xoffset
+ Specifies a texel offset in the x direction within + the texture array.
yoffset
+ Specifies a texel offset in the y direction within + the texture array.
width
+ Specifies the width of the texture subimage.
height
+ Specifies the height of the texture subimage.
format
+ Specifies the of the pixel data. The following
+ symbolic values are accepted:
+ GL_ALPHA
,
+ GL_RGB
,
+ GL_RGBA
,
+ GL_LUMINANCE
, and
+ GL_LUMINANCE_ALPHA
.
type
+ Specifies the data type of the pixel data. The
+ following symbolic values are accepted:
+ GL_UNSIGNED_BYTE
,
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
, and
+ GL_UNSIGNED_SHORT_5_5_5_1
.
pixels
+ Specifies a pointer to the image data in + memory.
Texturing maps a portion of a specified texture image
+ onto each graphical primitive for which texturing is enabled.
+ To enable and disable two-dimensional texturing, call
+ glEnable and
+ glDisable
+ with argument GL_TEXTURE_2D
.
+ Two-dimensional texturing is initially disabled.
+
+ glTexSubImage2D
+ redefines a contiguous subregion of an existing two-dimensional
+ texture image. The texels referenced by pixels
+ replace the portion of the existing texture array with x indices
+ xoffset
and
+ yoffset
and
+
+ glPixelStorei + affects texture images in exactly the way it affects + glTexImage2D. +
+ glTexSubImage2D
+ specifies a two-dimensional sub texture for the currently bound texture,
+ specified with
+ glBindTexture
+ and current texture
+ unit, specified with
+ glActiveTexture.
+
GL_INVALID_ENUM
is generated if
+ target
is not GL_TEXTURE_2D
.
+
GL_INVALID_OPERATION
+ is generated if the texture array has not been defined by a previous
+ glTexImage2D or
+ glCopyTexImage2D
+ operation.
GL_INVALID_VALUE
is generated if
+ level
is less than 0.
GL_INVALID_VALUE
may be generated if
+ level
is greater than
+ max
is the returned value of
+ GL_MAX_TEXTURE_SIZE
.
GL_INVALID_VALUE
is generated if
+ w
is the texture width and
+ h
is the texture height.
GL_INVALID_VALUE
is generated if
+ width
or
+ height
is less than 0.
GL_INVALID_ENUM
is generated if
+ format
is not an accepted constant.
GL_INVALID_ENUM
is generated if
+ type
is not an accepted constant.
GL_INVALID_OPERATION
is generated if
+ type
is
+ GL_UNSIGNED_SHORT_5_6_5
and
+ format
is not
+ GL_RGB
.
GL_INVALID_OPERATION
is generated if
+ type
is one of
+ GL_UNSIGNED_SHORT_4_4_4_4
, or
+ GL_UNSIGNED_SHORT_5_5_5_1
and
+ format
is not
+ GL_RGBA
.
+ glActiveTexture, + glBindTexture, + glCompressedTexSubImage2D, + glCopyTexSubImage2D, + glGet, + glPixelStorei, + glTexEnv, + glTexImage2D, + glTexParameter +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glTranslate — multiply the current matrix by a translation matrix
void glTranslatef( | GLfloat x, |
GLfloat y, | |
GLfloat z) ; |
void glTranslatex( | GLfixed x, |
GLfixed y, | |
GLfixed z) ; |
glTranslate
produces a translation by
+
If the matrix mode is either
+ GL_MODELVIEW
or
+ GL_PROJECTION
, all objects drawn after a call to
+ glTranslate
are translated.
Use + glPushMatrix + and + glPopMatrix + to save and restore the untranslated coordinate system.
+ glGet with argument GL_MATRIX_MODE
+
+ glGet with argument GL_MODELVIEW_MATRIX
+
+ glGet with argument GL_PROJECTION_MATRIX
+
+ glGet with argument GL_TEXTURE_MATRIX
+
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glVertexPointer — define an array of vertex coordinates
void glVertexPointer( | GLint size, |
GLenum type, | |
GLsizei stride, | |
const GLvoid * pointer) ; |
size
+ Specifies the number of coordinates per vertex. + Must be 2, 3, or 4. The initial value is 4.
type
+ Specifies the data type of each vertex coordinate in the
+ array. Symbolic constants
+ GL_BYTE
,
+ GL_SHORT
, and
+ GL_FIXED
, are accepted.
+ However, the initial value is
+ GL_FLOAT
.
+ The common profile accepts the symbolic constant
+ GL_FLOAT
as well.
+
stride
+ Specifies the byte offset between consecutive
+ vertices. If stride
+ is 0, the vertices are understood to be tightly packed in
+ the array. The initial value is 0.
pointer
+ Specifies a pointer to the first coordinate of the + first vertex in the array. The initial value is 0.
+ glVertexPointer
+ specifies the location and data of an array of vertex
+ coordinates to use when rendering. size
+ specifies the number of coordinates per vertex and
+ type
the data type of the coordinates.
+ stride
+ specifies the byte stride from one vertex to the next allowing
+ vertices and attributes to be packed into a single array or
+ stored in separate arrays. (Single-array storage may be more
+ efficient on some implementations.)
+
+ When a vertex array is
+ specified,
+ size
,
+ type
,
+ stride
, and
+ pointer
are saved as client-side state.
If the vertex array is enabled, it is used when
+ glDrawArrays,
+ or
+ glDrawElements
+ is called.
+ To enable and disable the vertex array, call
+ glEnableClientState
+ and
+ glDisableClientState
+ with the argument
+ GL_VERTEX_ARRAY
.
+ The vertex array is initially disabled and isn't accessed when
+ glDrawArrays or
+ glDrawElements
+ is called.
Use + glDrawArrays + to construct a sequence of primitives (all of the same type) + from prespecified vertex and vertex attribute arrays. Use + glDrawElements + to construct a sequence of primitives by indexing vertices and + vertex attributes.
GL_INVALID_VALUE
is generated if
+ size
is not 2, 3, or 4.
GL_INVALID_ENUM
is generated if
+ type
is is not an accepted value.
GL_INVALID_VALUE
is generated if
+ stride
is negative.
+ glColorPointer, + glDrawArrays, + glDrawElements, + glEnable, + glNormalPointer, + glTexCoordPointer +
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glViewport — set the viewport
void glViewport( | GLint x, |
GLint y, | |
GLsizei width, | |
GLsizei height) ; |
x
,
+ y
+ Specify the lower left corner of the viewport + rectangle, in pixels. The initial value is (0, 0).
width
,
+ height
+ Specify the width and height of the viewport. When
+ a GL context is first attached to a surface (e.g. window),
+ width
+ and
+ height
+ are set to the dimensions of that surface.
+ glViewport
+
+ specifies the affine transformation of
+ x
and
+ y
+ from normalized device coordinates to window coordinates. Let
+
Viewport width and height are silently clamped to a range
+ that depends on the implementation. To query this range, call
+ glGet
+ with argument GL_MAX_VIEWPORT_DIMS
.
+ Copyright © 2003-2004 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glActiveTexture — select active texture unit
void glActiveTexture( | GLenum texture) ; |
texture
+ Specifies which texture unit to make active. The number
+ of texture units is implementation dependent, but must be at least
+ 8. texture
must be one of
+ GL_TEXTURE
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
- 1).
+ The initial value is GL_TEXTURE0
.
+
+ glActiveTexture
selects which texture unit subsequent texture state calls will
+ affect. The number of texture units an implementation supports is
+ implementation dependent, but must be at least 8.
+
+ GL_INVALID_ENUM
is generated if texture
is not one of
+ GL_TEXTURE
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
- 1).
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glAttachShader — attach a shader object to a program object
void glAttachShader( | GLuint program, |
GLuint shader) ; |
program
Specifies the program object to which a shader + object will be attached.
shader
Specifies the shader object that is to be attached.
In order to create an executable, there must be a way to
+ specify the list of things that will be linked together. Program
+ objects provide this mechanism. Shaders that are to be linked
+ together in a program object must first be attached to that
+ program object. glAttachShader
attaches the
+ shader object specified by shader
to the
+ program object specified by program
. This
+ indicates that shader
will be included in
+ link operations that will be performed on
+ program
.
All operations that can be performed on a shader object + are valid whether or not the shader object is attached to a + program object. It is permissible to attach a shader object to a + program object before source code has been loaded into the + shader object or before the shader object has been compiled. + Multiple shader objects of the same type may not be attached to + a single program object. However, a single shader object may be + attached to more than one program object. + If a shader object is deleted while it is + attached to a program object, it will be flagged for deletion, + and deletion will not occur until + glDetachShader + is called to detach it from all program objects to which it is + attached.
GL_INVALID_VALUE
is generated if either
+ program
or shader
+ is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_OPERATION
is generated if
+ shader
is already attached to
+ program
, or if another shader object of
+ the same type as shader
is already attached
+ to program
.
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glBindAttribLocation — associate a generic vertex attribute index with a named attribute variable
void glBindAttribLocation( | GLuint program, |
GLuint index, | |
const GLchar *name) ; |
program
Specifies the handle of the program object in + which the association is to be made.
index
Specifies the index of the generic vertex + attribute to be bound.
name
Specifies a null terminated string containing
+ the name of the vertex shader attribute variable to
+ which index
is to be
+ bound.
glBindAttribLocation
is used to
+ associate a user-defined attribute variable in the program
+ object specified by program
with a
+ generic vertex attribute index. The name of the user-defined
+ attribute variable is passed as a null terminated string in
+ name
. The generic vertex attribute index
+ to be bound to this variable is specified by
+ index
. When
+ program
is made part of current state,
+ values provided via the generic vertex attribute
+ index
will modify the value of the
+ user-defined attribute variable specified by
+ name
.
If name
refers to a matrix
+ attribute variable, index
refers to the
+ first column of the matrix. Other matrix columns are then
+ automatically bound to locations index+1
+ for a matrix of type mat2; index+1
and
+ index+2
for a matrix of type mat3; and
+ index+1
, index+2
,
+ and index+3
for a matrix of type
+ mat4.
This command makes it possible for vertex shaders to use
+ descriptive names for attribute variables rather than generic
+ variables that are numbered from 0 to
+ GL_MAX_VERTEX_ATTRIBS
-1. The values sent
+ to each generic attribute index are part of current state, just
+ like standard vertex attributes such as color, normal, and
+ vertex position. If a different program object is made current
+ by calling
+ glUseProgram,
+ the generic vertex attributes are tracked in such a way that the
+ same values will be observed by attributes in the new program
+ object that are also bound to
+ index
.
Attribute variable
+ name-to-generic attribute index bindings for a program object
+ can be explicitly assigned at any time by calling
+ glBindAttribLocation
. Attribute bindings do
+ not go into effect until
+ glLinkProgram
+ is called. After a program object has been linked successfully,
+ the index values for generic attributes remain fixed (and their
+ values can be queried) until the next link command
+ occurs.
Applications are not allowed to bind any of the standard + OpenGL vertex attributes using this command, as they are bound + automatically when needed. Any attribute binding that occurs + after the program object has been linked will not take effect + until the next time the program object is linked.
glBindAttribLocation
can be called
+ before any vertex shader objects are bound to the specified
+ program object. It is also permissible to bind a generic
+ attribute index to an attribute variable name that is never used
+ in a vertex shader.
If name
was bound previously, that
+ information is lost. Thus you cannot bind one user-defined
+ attribute variable to multiple indices, but you can bind
+ multiple user-defined attribute variables to the same
+ index.
Applications are allowed to bind more than one + user-defined attribute variable to the same generic vertex + attribute index. This is called aliasing, + and it is allowed only if just one of the aliased attributes is + active in the executable program, or if no path through the + shader consumes more than one attribute of a set of attributes + aliased to the same location. The compiler and linker are + allowed to assume that no aliasing is done and are free to + employ optimizations that work only in the absence of aliasing. + OpenGL implementations are not required to do error checking to + detect aliasing. Because there is no way to bind standard + attributes, it is not possible to alias generic attributes with + conventional ones (except for generic attribute 0).
Active attributes that are not explicitly bound will be + bound by the linker when + glLinkProgram + is called. The locations assigned can be queried by calling + glGetAttribLocation.
OpenGL copies the name
string when
+ glBindAttribLocation
is called, so an
+ application may free its copy of the name
+ string immediately after the function returns.
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to
+ GL_MAX_VERTEX_ATTRIBS
.
GL_INVALID_OPERATION
is generated if
+ name
starts with the reserved prefix
+ "gl_".
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
glGetActiveAttrib
+ with argument program
glGetAttribLocation
+ with arguments program
and
+ name
glDisableVertexAttribArray, + glEnableVertexAttribArray, + glUseProgram, + glVertexAttrib, + glVertexAttribPointer
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glBindBuffer — bind a named buffer object
void glBindBuffer( | GLenum target, |
GLuint buffer) ; |
target
+ Specifies the target to which the buffer object is bound.
+ The symbolic constant must be
+ GL_ARRAY_BUFFER
or
+ GL_ELEMENT_ARRAY_BUFFER
.
+
buffer
+ Specifies the name of a buffer object. +
+ glBindBuffer
lets you create or use a named buffer object. Calling glBindBuffer
with
+ target
set to
+ GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
+ and buffer
set to the name
+ of the new buffer object binds the buffer object name to the target.
+ When a buffer object is bound to a target, the previous binding for that
+ target is automatically broken.
+
+ Buffer object names are unsigned integers. The value zero is reserved, but
+ there is no default buffer object for each buffer object target. Instead, buffer
set to zero
+ effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target.
+ Buffer object names and the corresponding buffer object contents are local to
+ the shared object space of the current GL rendering context.
+
+ You may use glGenBuffers to generate a set of new buffer object names. +
+ The state of a buffer object immediately after it is first bound is a zero-sized memory buffer with
+ GL_STATIC_DRAW
usage.
+
+ While a non-zero buffer object name is bound, GL operations on the target to which it is
+ bound affect the bound buffer object, and queries of the target to which it is bound return state
+ from the bound buffer object. While buffer object name zero is bound, as in the initial state,
+ attempts to modify or query state on the target to which it is bound generates an
+ GL_INVALID_OPERATION
error.
+
+ When vertex array pointer state is changed by a call to
+ glVertexAttribPointer,
+ the current buffer object binding (GL_ARRAY_BUFFER_BINDING
) is copied into the
+ corresponding client state for the vertex attrib array being changed, one of the indexed
+ GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
s. While a non-zero buffer object is bound to the
+ GL_ARRAY_BUFFER
target, the vertex array pointer parameter that is traditionally
+ interpreted as a pointer to client-side memory is instead interpreted as an offset within the
+ buffer object measured in basic machine units.
+
+ While a non-zero buffer object is bound to the GL_ELEMENT_ARRAY_BUFFER
target,
+ the indices parameter of glDrawElements that is traditionally
+ interpreted as a pointer to client-side memory is instead interpreted as an offset within the
+ buffer object measured in basic machine units.
+
+ A buffer object binding created with glBindBuffer
remains active until a different
+ buffer object name is bound to the same target, or until the bound buffer object is
+ deleted with glDeleteBuffers.
+
+ Once created, a named buffer object may be re-bound to any target as often as needed. However, + the GL implementation may make choices about how to optimize the storage of a buffer object based + on its initial binding target. +
+ glGet with argument GL_ARRAY_BUFFER_BINDING
+
+ glGet with argument GL_ELEMENT_ARRAY_BUFFER_BINDING
+
+ Copyright © 2005 Addison-Wesley. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glBindFramebuffer — bind a named framebuffer object
void glBindFramebuffer( | GLenum target, |
GLuint framebuffer) ; |
target
+ Specifies the target to which the framebuffer object is bound.
+ The symbolic constant must be
+ GL_FRAMEBUFFER
.
+
framebuffer
+ Specifies the name of a framebuffer object. +
+ glBindFramebuffer
lets you create or use a named framebuffer object. Calling glBindFramebuffer
with
+ target
set to GL_FRAMEBUFFER
+ and framebuffer
set to the name
+ of the new framebuffer object binds the framebuffer object name.
+ When a framebuffer object is bound, the previous binding
+ is automatically broken.
+
+ Framebuffer object names are unsigned integers. The value zero is reserved to represent the default framebuffer + provided by the windowing system. Framebuffer object names and the corresponding framebuffer object contents are local to + the shared object space of the current GL rendering context. +
+ You may use glGenFramebuffers to generate a set of new framebuffer object names. +
+ The state of a framebuffer object immediately after it is first bound is
+ three attachment points (GL_COLOR_ATTACHMENT0
,
+ GL_DEPTH_ATTACHMENT
, and
+ GL_STENCIL_ATTACHMENT
) each with
+ GL_NONE
as the object type.
+
+ While a non-zero framebuffer object name is bound, GL operations on
+ target GL_FRAMEBUFFER
affect the bound framebuffer
+ object, and queries of target GL_FRAMEBUFFER
or of
+ framebuffer details such as GL_DEPTH_BITS
+ return state from the bound framebuffer object. While framebuffer object
+ name zero is bound, as in the initial state, attempts to modify or query
+ state on target GL_FRAMEBUFFER
generates an
+ GL_INVALID_OPERATION
error.
+
+ While a non-zero framebuffer object name is bound, all rendering to the + framebuffer (with glDrawArrays + and glDrawElements) + and reading from the framebuffer (with + glReadPixels, + glCopyTexImage2D, + or glCopyTexSubImage2D) + use the images attached to the application-created framebuffer object rather than the default + window-system-provided framebuffer. +
+ Application created framebuffer objects (i.e. those with a non-zero name)
+ differ from the default window-system-provided framebuffer in a few
+ important ways. First, they have modifiable attachment points for
+ a color buffer, a depth buffer, and a stencil buffer to which framebuffer
+ attachable images may be attached and detached. Second, the size and format of the
+ attached images are controlled entirely within the GL and are not
+ affected by window-system events, such as pixel format selection,
+ window resizes, and display mode changes. Third, when rendering to or
+ reading from an application created framebuffer object, the pixel
+ ownership test always succeeds (i.e. they own all their pixels). Fourth,
+ there are no visible color buffer bitplanes, only a single "off-screen"
+ color image attachment, so there is no sense of front and back buffers
+ or swapping. Finally, there is no multisample buffer, so the value of
+ the implementation-dependent state variables
+ GL_SAMPLES
and GL_SAMPLE_BUFFERS
+ are both zero for application created framebuffer objects.
+
+ A framebuffer object binding created with glBindFramebuffer
remains active until a different
+ framebuffer object name is bound, or until the bound framebuffer object is
+ deleted with glDeleteFramebuffers.
+
+ Queries of implementation-dependent pixel depths and related state are
+ derived from the currently bound framebuffer object. These include
+ GL_RED_BITS
, GL_GREEN_BITS
,
+ GL_BLUE_BITS
, GL_ALPHA_BITS
,
+ GL_DEPTH_BITS
, GL_STENCIL_BITS
,
+ GL_IMPLEMENTATION_COLOR_READ_TYPE
,
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT
,
+ GL_SAMPLES
, and GL_SAMPLE_BUFFERS
.
+
+ glDeleteFramebuffers, + glFramebufferRenderbuffer, + glFramebufferTexture2D, + glGenFramebuffers, + glGet, + glGetFramebufferAttachmentParameteriv, + glIsFramebuffer +
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glBindRenderbuffer — bind a named renderbuffer object
void glBindRenderbuffer( | GLenum target, |
GLuint renderbuffer) ; |
target
+ Specifies the target to which the renderbuffer object is bound.
+ The symbolic constant must be
+ GL_RENDERBUFFER
.
+
renderbuffer
+ Specifies the name of a renderbuffer object. +
+ A renderbuffer is a data storage object containing a single + image of a renderable internal format. A renderbuffer's image + may be attached to a framebuffer object to use as a destination + for rendering and as a source for reading. +
+ glBindRenderbuffer
lets you create or use a named renderbuffer object. Calling glBindRenderbuffer
with
+ target
set to GL_RENDERBUFFER
+ and renderbuffer
set to the name
+ of the new renderbuffer object binds the renderbuffer object name.
+ When a renderbuffer object is bound, the previous binding
+ is automatically broken.
+
+ Renderbuffer object names are unsigned integers. The value zero is reserved, but there is no default renderbuffer object.
+ Instead, renderbuffer
set to zero effectively unbinds any renderbuffer object previously bound.
+ Renderbuffer object names and the corresponding renderbuffer object contents are local to
+ the shared object space of the current GL rendering context.
+
+ You may use glGenRenderbuffers to generate a set of new renderbuffer object names. +
+ The state of a renderbuffer object immediately after it is first bound is
+ a zero-sized memory buffer with format GL_RGBA4
and
+ zero-sized red, green, blue, alpha, depth, and stencil pixel depths.
+
+ While a non-zero renderbuffer object name is bound, GL operations on
+ target GL_RENDERBUFFER
affect the bound renderbuffer
+ object, and queries of target GL_RENDERBUFFER
+ return state from the bound renderbuffer object. While renderbuffer object
+ name zero is bound, as in the initial state, attempts to modify or query
+ state on target GL_RENDERBUFFER
generates an
+ GL_INVALID_OPERATION
error.
+
+ A renderbuffer object binding created with glBindRenderbuffer
remains active until a different
+ renderbuffer object name is bound, or until the bound renderbuffer object is
+ deleted with glDeleteRenderbuffers.
+
+ glDeleteRenderbuffers, + glFramebufferRenderbuffer, + glGenRenderbuffers, + glGet, + glGetRenderbufferParameteriv, + glIsRenderbuffer, + glRenderbufferStorage +
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glBindTexture — bind a named texture to a texturing target
void glBindTexture( | GLenum target, |
GLuint texture) ; |
target
+ Specifies the target of the active texture unit to which the texture is bound.
+ Must be either
+ GL_TEXTURE_2D
or
+ GL_TEXTURE_CUBE_MAP
.
+
texture
+ Specifies the name of a texture. +
+ glBindTexture
lets you create or use a named texture. Calling glBindTexture
with
+ target
set to
+ GL_TEXTURE_2D
or
+ GL_TEXTURE_CUBE_MAP
and texture
set to the name
+ of the new texture binds the texture name to the target of the current active texture unit.
+ When a texture is bound to a target, the previous binding for that
+ target is automatically broken.
+
+ Texture names are unsigned integers. The value zero is reserved to + represent the default texture for each texture target. + Texture names and the corresponding texture contents are local to + the shared object space of the current GL rendering context. +
+ You may use glGenTextures to generate a set of new texture names. +
+ When a texture is first bound, it assumes the specified target:
+ A texture first bound to GL_TEXTURE_2D
becomes a two-dimensional texture and a
+ texture first bound to GL_TEXTURE_CUBE_MAP
+ becomes a cube-mapped texture. The state of a two-dimensional texture
+ immediately after it is first bound is equivalent to the state of the
+ default GL_TEXTURE_2D
at GL initialization, and similarly for cube-mapped textures.
+
+ While a texture is bound, GL operations on the target to which it is + bound affect the bound texture, and queries of the target to which it + is bound return state from the bound texture. + In effect, the texture targets become aliases for the textures currently + bound to them, and the texture name zero refers to the default textures + that were bound to them at initialization. +
+ A texture binding created with glBindTexture
remains active until a different
+ texture is bound to the same target, or until the bound texture is
+ deleted with glDeleteTextures.
+
+ Once created, a named texture may be re-bound to its same original target as often as needed.
+ It is usually much faster to use glBindTexture
to bind an existing named
+ texture to one of the texture targets than it is to reload the texture image
+ using glTexImage2D.
+
+ GL_INVALID_ENUM
is generated if target
is not one of the allowable
+ values.
+
+ GL_INVALID_OPERATION
is generated if texture
was previously created with a target
+ that doesn't match that of target
.
+
+ glDeleteTextures, + glGenTextures, + glGet, + glGetTexParameter, + glIsTexture, + glTexImage2D, + glTexParameter +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBlendColor — set the blend color
void glBlendColor( | GLclampf red, |
GLclampf green, | |
GLclampf blue, | |
GLclampf alpha) ; |
+ The GL_BLEND_COLOR
may be used to calculate the source and destination
+ blending factors. The color components are clamped to the range
+ GL_BLEND_COLOR
is set to (0, 0, 0, 0).
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBlendEquation — specify the equation used for both the RGB blend equation and the Alpha blend equation
void glBlendEquation( | GLenum mode) ; |
mode
+ specifies how source and destination colors are combined.
+ It must be GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or
+ GL_FUNC_REVERSE_SUBTRACT
.
+
+ The blend equations determine how a new pixel (the ''source'' color) + is combined with a pixel already in the framebuffer (the ''destination'' + color). This function sets both the RGB blend equation and the alpha + blend equation to a single equation. +
+ These equations use the source and destination blend factors + specified by either glBlendFunc or + glBlendFuncSeparate. + See glBlendFunc or glBlendFuncSeparate + for a description of the various blend factors. +
+ In the equations that follow, source and destination
+ color components are referred to as
+
+ Mode + | + RGB Components + | + Alpha Component + |
---|---|---|
+ GL_FUNC_ADD
+ |
+ |
+ |
+ GL_FUNC_SUBTRACT
+ |
+ |
+ |
+ GL_FUNC_REVERSE_SUBTRACT
+ |
+ |
+ |
+
+ The results of these equations are clamped to the range
+
+ The GL_FUNC_ADD
equation is useful
+ for antialiasing and transparency, among other things.
+
+ Initially, both the RGB blend equation and the alpha blend equation are set to GL_FUNC_ADD
.
+
+
+ GL_INVALID_ENUM
is generated if mode
is not one of
+ GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or GL_FUNC_REVERSE_SUBTRACT
.
+
+ glGet with an argument of GL_BLEND_EQUATION_RGB
+
+ glGet with an argument of GL_BLEND_EQUATION_ALPHA
+
+ glGetString, + glBlendColor, + glBlendEquationSeparate, + glBlendFunc + glBlendFuncSeparate +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBlendEquationSeparate — set the RGB blend equation and the alpha blend equation separately
void glBlendEquationSeparate( | GLenum modeRGB, |
GLenum modeAlpha) ; |
modeRGB
+ specifies the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined.
+ It must be GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or
+ GL_FUNC_REVERSE_SUBTRACT
.
+
modeAlpha
+ specifies the alpha blend equation, how the alpha component of the source and destination colors are combined.
+ It must be GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or
+ GL_FUNC_REVERSE_SUBTRACT
.
+
+ The blend equations determines how a new pixel (the ''source'' color) + is combined with a pixel already in the framebuffer (the ''destination'' + color). This function specifies one blend equation for the RGB-color + components and one blend equation for the alpha component. +
+ The blend equations use the source and destination blend factors + specified by either glBlendFunc or + glBlendFuncSeparate. + See glBlendFunc or glBlendFuncSeparate + for a description of the various blend factors. +
+ In the equations that follow, source and destination
+ color components are referred to as
+
+ Mode + | + RGB Components + | + Alpha Component + |
---|---|---|
+ GL_FUNC_ADD
+ |
+ |
+ |
+ GL_FUNC_SUBTRACT
+ |
+ |
+ |
+ GL_FUNC_REVERSE_SUBTRACT
+ |
+ |
+ |
+
+ The results of these equations are clamped to the range
+
+ The GL_FUNC_ADD
equation is useful
+ for antialiasing and transparency, among other things.
+
+ Initially, both the RGB blend equation and the alpha blend equation are set to GL_FUNC_ADD
.
+
+
+ GL_INVALID_ENUM
is generated if either modeRGB
or modeAlpha
is not one of
+ GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or GL_FUNC_REVERSE_SUBTRACT
.
+
+ glGet with an argument of GL_BLEND_EQUATION_RGB
+
+ glGet with an argument of GL_BLEND_EQUATION_ALPHA
+
+ Copyright © 2006 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glBlendFunc — specify pixel arithmetic
void glBlendFunc( | GLenum sfactor, |
GLenum dfactor) ; |
sfactor
+ Specifies how the red, green, blue,
+ and alpha source blending factors are computed.
+ The following symbolic constants are accepted:
+ GL_ZERO
,
+ GL_ONE
,
+ GL_SRC_COLOR
,
+ GL_ONE_MINUS_SRC_COLOR
,
+ GL_DST_COLOR
,
+ GL_ONE_MINUS_DST_COLOR
,
+ GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ GL_DST_ALPHA
,
+ GL_ONE_MINUS_DST_ALPHA
,
+ GL_CONSTANT_COLOR
,
+ GL_ONE_MINUS_CONSTANT_COLOR
,
+ GL_CONSTANT_ALPHA
,
+ GL_ONE_MINUS_CONSTANT_ALPHA
, and
+ GL_SRC_ALPHA_SATURATE
.
+ The initial value is GL_ONE
.
+
dfactor
+ Specifies how the red, green, blue,
+ and alpha destination blending factors are computed.
+ The following symbolic constants are accepted:
+ GL_ZERO
,
+ GL_ONE
,
+ GL_SRC_COLOR
,
+ GL_ONE_MINUS_SRC_COLOR
,
+ GL_DST_COLOR
,
+ GL_ONE_MINUS_DST_COLOR
,
+ GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ GL_DST_ALPHA
,
+ GL_ONE_MINUS_DST_ALPHA
.
+ GL_CONSTANT_COLOR
,
+ GL_ONE_MINUS_CONSTANT_COLOR
,
+ GL_CONSTANT_ALPHA
, and
+ GL_ONE_MINUS_CONSTANT_ALPHA
.
+ The initial value is GL_ZERO
.
+
+ Pixels can be drawn using a function that blends
+ the incoming (source) RGBA values with the RGBA values
+ that are already in the frame buffer (the destination values).
+ Blending is initially disabled.
+ Use glEnable and glDisable with argument GL_BLEND
+ to enable and disable blending.
+
+ glBlendFunc
defines the operation of blending when it is enabled.
+ sfactor
specifies which method is used to scale the
+ source color components.
+ dfactor
specifies which method is used to scale the
+ destination color components.
+ The possible methods are described in the following table.
+ Each method defines four scale factors,
+ one each for red, green, blue, and alpha.
+ In the table and in subsequent equations, source and destination
+ color components are referred to as
+
+
+
+
+ and
+
+ Source and destination scale factors are referred to as
+
+
+ Parameter + |
+ |
---|---|
+ GL_ZERO
+ |
+ |
+ GL_ONE
+ |
+ |
+ GL_SRC_COLOR
+ |
+ |
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ |
+ GL_DST_COLOR
+ |
+ |
+ GL_ONE_MINUS_DST_COLOR
+ |
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ GL_DST_ALPHA
+ |
+ |
+ GL_ONE_MINUS_DST_ALPHA
+ |
+ |
+ GL_CONSTANT_COLOR
+ |
+ |
+ GL_ONE_MINUS_CONSTANT_COLOR
+ |
+ |
+ GL_CONSTANT_ALPHA
+ |
+ |
+ GL_ONE_MINUS_CONSTANT_ALPHA
+ |
+ |
+ GL_SRC_ALPHA_SATURATE
+ |
+ |
+ In the table, +
+
+
+
+ To determine the blended RGBA values of a pixel, + the system uses one of the equations set by + glBlendEquation or + glBlendEquationSeparate. +
+ Blending arithmetic is not exactly specified, + because blending operates with imprecise integer color values. + However, + a blend factor that should be equal to 1 + is guaranteed not to modify its multiplicand, + and a blend factor equal to 0 reduces its multiplicand to 0. +
+ Incoming (source) alpha is correctly thought of as a material opacity,
+ ranging from 1.0
+ (
+ Transparency is best implemented using blend function
+ (GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
)
+ with primitives sorted from farthest to nearest.
+ Note that this transparency calculation does not require
+ the presence of alpha bitplanes in the frame buffer.
+
+ glGet with argument GL_BLEND_SRC_RGB
or GL_BLEND_SRC_ALPHA
+
+ glGet with argument GL_BLEND_DST_RGB
or GL_BLEND_DST_ALPHA
+
+ glIsEnabled with argument GL_BLEND
+
+
+ glBlendColor, + glBlendEquation, + glBlendEquationSeparate, + glBlendFuncSeparate, + glClear, + glEnable, + glStencilFunc +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBlendFuncSeparate — specify pixel arithmetic for RGB and alpha components separately
void glBlendFuncSeparate( | GLenum srcRGB, |
GLenum dstRGB, | |
GLenum srcAlpha, | |
GLenum dstAlpha) ; |
srcRGB
+ Specifies how the red, green, and blue blending factors are computed.
+ The following symbolic constants are accepted:
+ GL_ZERO
,
+ GL_ONE
,
+ GL_SRC_COLOR
,
+ GL_ONE_MINUS_SRC_COLOR
,
+ GL_DST_COLOR
,
+ GL_ONE_MINUS_DST_COLOR
,
+ GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ GL_DST_ALPHA
,
+ GL_ONE_MINUS_DST_ALPHA
,
+ GL_CONSTANT_COLOR
,
+ GL_ONE_MINUS_CONSTANT_COLOR
,
+ GL_CONSTANT_ALPHA
,
+ GL_ONE_MINUS_CONSTANT_ALPHA
, and
+ GL_SRC_ALPHA_SATURATE
.
+ The initial value is GL_ONE
.
+
dstRGB
+ Specifies how the red, green, and blue destination blending factors are
+ computed. The following symbolic constants are accepted:
+ GL_ZERO
,
+ GL_ONE
,
+ GL_SRC_COLOR
,
+ GL_ONE_MINUS_SRC_COLOR
,
+ GL_DST_COLOR
,
+ GL_ONE_MINUS_DST_COLOR
,
+ GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ GL_DST_ALPHA
,
+ GL_ONE_MINUS_DST_ALPHA
.
+ GL_CONSTANT_COLOR
,
+ GL_ONE_MINUS_CONSTANT_COLOR
,
+ GL_CONSTANT_ALPHA
, and
+ GL_ONE_MINUS_CONSTANT_ALPHA
.
+ The initial value is GL_ZERO
.
+
srcAlpha
+ Specified how the alpha source blending factor is computed. The same
+ symbolic constants are accepted as for srcRGB
.
+ The initial value is GL_ONE
.
+
dstAlpha
+ Specified how the alpha destination blending factor is computed. The same
+ symbolic constants are accepted as for dstRGB
.
+ The initial value is GL_ZERO
.
+
+ Pixels can be drawn using a function that blends
+ the incoming (source) RGBA values with the RGBA values
+ that are already in the frame buffer (the destination values).
+ Blending is initially disabled.
+ Use glEnable and glDisable with argument GL_BLEND
+ to enable and disable blending.
+
+ glBlendFuncSeparate
defines the operation of blending when it is enabled.
+ srcRGB
specifies which method is used to scale the
+ source RGB-color components.
+ dstRGB
specifies which method is used to scale the
+ destination RGB-color components.
+ Likewise, srcAlpha
specifies which method is used to scale the source alpha
+ color component, and dstAlpha
specifies which method is used to scale the
+ destination alpha component.
+ The possible methods are described in the following table.
+ Each method defines four scale factors,
+ one each for red, green, blue, and alpha.
+
+ In the table and in subsequent equations, source and destination
+ color components are referred to as
+
+
+
+
+ and
+
+ Source and destination scale factors are referred to as
+
+
+ Parameter + | + RGB Factor + | + Alpha Factor + |
---|---|---|
+ GL_ZERO
+ |
+ |
+ |
+ GL_ONE
+ |
+ |
+ |
+ GL_SRC_COLOR
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ |
+ |
+ GL_DST_COLOR
+ |
+ |
+ |
+ GL_ONE_MINUS_DST_COLOR
+ |
+ |
+ |
+ GL_SRC_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ |
+ |
+ GL_DST_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_DST_ALPHA
+ |
+ |
+ |
+ GL_CONSTANT_COLOR
+ |
+ |
+ |
+ GL_ONE_MINUS_CONSTANT_COLOR
+ |
+ |
+ |
+ GL_CONSTANT_ALPHA
+ |
+ |
+ |
+ GL_ONE_MINUS_CONSTANT_ALPHA
+ |
+ |
+ |
+ GL_SRC_ALPHA_SATURATE
+ |
+ |
+ |
+ In the table, +
+
+
+
+ To determine the blended RGBA values of a pixel, + the system uses one of the equations set by + glBlendEquation or + glBlendEquationSeparate. +
+ Despite the apparent precision of the above equations, blending arithmetic + is not exactly specified, because blending operates with imprecise integer + color values. However, a blend factor that should be equal to 1 is + guaranteed not to modify its multiplicand, and a blend factor equal to 0 + reduces its multiplicand to 0. +
+ Incoming (source) alpha is correctly thought of as a material opacity,
+ ranging from 1.0
+ (
+ GL_INVALID_ENUM
is generated if
+ srcRGB
, dstRGB
,
+ srcAlpha
, or dstAlpha
+ is not an accepted value.
+
+ glGet with argument GL_BLEND_SRC_RGB
+
+ glGet with argument GL_BLEND_SRC_ALPHA
+
+ glGet with argument GL_BLEND_DST_RGB
+
+ glGet with argument GL_BLEND_DST_ALPHA
+
+ glIsEnabled with argument GL_BLEND
+
+
+ glBlendColor, + glBlendEquation, + glBlendEquationSeparate, + glBlendFunc, + glClear, + glEnable, + glStencilFunc +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glBufferData — create and initialize a buffer object's data store
void glBufferData( | GLenum target, |
GLsizeiptr size, | |
const GLvoid * data, | |
GLenum usage) ; |
target
+ Specifies the target buffer object.
+ The symbolic constant must be GL_ARRAY_BUFFER
or
+ GL_ELEMENT_ARRAY_BUFFER
.
+
size
+ Specifies the size in bytes of the buffer object's new data store. +
data
+ Specifies a pointer to data that will be copied into the data store for initialization,
+ or NULL
if no data is to be copied.
+
usage
+ Specifies the expected usage pattern of the data store. The symbolic constant must be
+ GL_STREAM_DRAW
, GL_STATIC_DRAW
, or
+ GL_DYNAMIC_DRAW
.
+
+ glBufferData
creates a new data store for the buffer object currently bound to
+ target
. Any pre-existing data store is deleted. The new data store is created with the
+ specified size
in bytes and usage
. If data
+ is not NULL
, the data store is initialized with data from this pointer.
+
+ usage
is a hint to the GL implementation as to how a buffer object's data store will be
+ accessed. This enables the GL implementation to make more intelligent decisions that may significantly
+ impact buffer object performance. It does not, however, constrain the actual usage of the data store.
+ usage
can be broken down into two parts: first, the frequency of access (modification
+ and usage), and second, the nature of that access. The frequency of access may be one of these:
+
+ The data store contents will be modified once and used at most a few times. +
+ The data store contents will be modified once and used many times. +
+ The data store contents will be modified repeatedly and used many times. +
+ The nature of access must be: +
+ The data store contents are modified by the application, and used as the source for GL drawing and + image specification commands. +
+ If data
is NULL
, a data store of the specified size is still created,
+ but its contents remain uninitialized and thus undefined.
+
+ Clients must align data elements consistent with the requirements of the client
+ platform, with an additional base-level requirement that an offset within a buffer to
+ a datum comprising
+ GL_INVALID_ENUM
is generated if target
is not
+ GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.
+
+ GL_INVALID_ENUM
is generated if usage
is not
+ GL_STREAM_DRAW
,
+ GL_STATIC_DRAW
, or
+ GL_DYNAMIC_DRAW
.
+
+ GL_INVALID_VALUE
is generated if size
is negative.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ GL_OUT_OF_MEMORY
is generated if the GL is unable to create a data store with the specified size
.
+
+ Copyright © 2005 Addison-Wesley. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glBufferSubData — update a subset of a buffer object's data store
void glBufferSubData( | GLenum target, |
GLintptr offset, | |
GLsizeiptr size, | |
const GLvoid * data) ; |
target
+ Specifies the target buffer object.
+ The symbolic constant must be GL_ARRAY_BUFFER
or
+ GL_ELEMENT_ARRAY_BUFFER
.
+
offset
+ Specifies the offset into the buffer object's data store where data replacement will begin, + measured in bytes. +
size
+ Specifies the size in bytes of the data store region being replaced. +
data
+ Specifies a pointer to the new data that will be copied into the data store. +
+ glBufferSubData
redefines some or all of the data store for the buffer object currently
+ bound to target
. Data starting at byte offset offset
and
+ extending for size
bytes is copied to the data store from the memory pointed to by
+ data
. An error is thrown if offset
and size
+ together define a range beyond the bounds of the buffer object's data store.
+
+ When replacing the entire data store, consider using glBufferSubData
rather
+ than completely recreating the data store with glBufferData
. This avoids the cost of
+ reallocating the data store.
+
+ Consider using multiple buffer objects to avoid stalling the rendering pipeline during data store updates.
+ If any rendering in the pipeline makes reference to data in the buffer object being updated by
+ glBufferSubData
, especially from the specific region being updated, that rendering must
+ drain from the pipeline before the data store can be updated.
+
+ Clients must align data elements consistent with the requirements of the client
+ platform, with an additional base-level requirement that an offset within a buffer to
+ a datum comprising
+ GL_INVALID_ENUM
is generated if target
is not
+ GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.
+
+ GL_INVALID_VALUE
is generated if offset
or
+ size
is negative, or if together they define a region of memory
+ that extends beyond the buffer object's allocated data store.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ Copyright © 2005 Addison-Wesley. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glCheckFramebufferStatus — return the framebuffer completeness status of a framebuffer object
GLenum glCheckFramebufferStatus( | GLenum target) ; |
target
+ Specifies the target framebuffer object.
+ The symbolic constant must be GL_FRAMEBUFFER
.
+
+ glCheckFramebufferStatus
returns a symbolic
+ constant that identifies whether or not the currently bound
+ framebuffer is framebuffer complete, and if not, which of the rules
+ of framebuffer completeness is violated.
+
+ If the framebuffer is complete, then
+ GL_FRAMEBUFFER_COMPLETE
is returned.
+ If the framebuffer is not complete, the return values are as follows:
+
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+ Not all framebuffer attachment points are framebuffer + attachment complete. This means that at least one + attachment point with a renderbuffer or texture + attached has its attached object no longer in existence + or has an attached image with a width or height of + zero, or the color attachment point has a + non-color-renderable image attached, or the + depth attachment point has a non-depth-renderable + image attached, or the stencil attachment point has a + non-stencil-renderable image attached. +
+ Color-renderable formats include GL_RGBA4
,
+ GL_RGB5_A1
, and
+ GL_RGB565
.
+ GL_DEPTH_COMPONENT16
is the only
+ depth-renderable format.
+ GL_STENCIL_INDEX8
is the only
+ stencil-renderable format.
+
GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
+ Not all attached images have the same width and height. +
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
+ No images are attached to the framebuffer. +
GL_FRAMEBUFFER_UNSUPPORTED
+ The combination of internal formats of the attached + images violates an implementation-dependent set of + restrictions. +
+ If the currently bound framebuffer is not framebuffer complete,
+ then it is an error to attempt to use the framebuffer for
+ writing or reading. This means that rendering commands
+ (glClear,
+ glDrawArrays, and
+ glDrawElements)
+ as well as commands that read the framebuffer
+ (glReadPixels,
+ glCopyTexImage2D, and
+ glCopyTexSubImage2D)
+ will generate the error GL_INVALID_FRAMEBUFFER_OPERATION
+ if called while the framebuffer is not framebuffer complete.
+
+ It is strongly advised, thought not required, that an application
+ call glCheckFramebufferStatus
to see if the
+ framebuffer is complete prior to rendering. This is because some
+ implementations may not support rendering to particular combinations
+ of internal formats. In this case,
+ GL_FRAMEBUFFER_UNSUPPORTED
+ is returned.
+
+ The default window-system-provided framebuffer is always
+ framebuffer complete, and thus GL_FRAMEBUFFER_COMPLETE
+ is returned when GL_FRAMEBUFFER_BINDING
is 0.
+
+ Additionally, if an error occurs, zero is returned. +
+ glBindRenderbuffer, + glCopyTexImage2D, + glCopyTexSubImage2D, + glDrawArrays, + glDrawElements, + glReadPixels, + glRenderbufferStorage +
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glClear — clear buffers to preset values
void glClear( | GLbitfield mask) ; |
mask
+ Bitwise OR of masks that indicate the buffers to be cleared.
+ The three masks are
+ GL_COLOR_BUFFER_BIT
,
+ GL_DEPTH_BUFFER_BIT
, and
+ GL_STENCIL_BUFFER_BIT
.
+
+ glClear
sets the bitplane area of the window to values previously selected
+ by glClearColor, glClearDepthf, and
+ glClearStencil.
+
+ The pixel ownership test,
+ the scissor test,
+ dithering, and the buffer writemasks affect the operation of glClear
.
+ The scissor box bounds the cleared region.
+ Blend function,
+ stenciling,
+ fragment shading,
+ and depth-buffering are ignored by glClear
.
+
+ glClear
takes a single argument that is the bitwise OR of several
+ values indicating which buffer is to be cleared.
+
+ The values are as follows: +
GL_COLOR_BUFFER_BIT
+ Indicates the buffers currently enabled for color + writing. +
GL_DEPTH_BUFFER_BIT
+ Indicates the depth buffer. +
GL_STENCIL_BUFFER_BIT
+ Indicates the stencil buffer. +
+ The value to which each buffer is cleared depends on the setting of the + clear value for that buffer. +
+ GL_INVALID_VALUE
is generated if any bit other than the three defined
+ bits is set in mask
.
+
+ glGet with argument GL_DEPTH_CLEAR_VALUE
+
+ glGet with argument GL_COLOR_CLEAR_VALUE
+
+ glGet with argument GL_STENCIL_CLEAR_VALUE
+
+ glClearColor, + glClearDepthf, + glClearStencil, + glColorMask, + glDepthMask, + glScissor, + glStencilMask +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glClearColor — specify clear values for the color buffers
void glClearColor( | GLclampf red, |
GLclampf green, | |
GLclampf blue, | |
GLclampf alpha) ; |
red
, green
, blue
, alpha
+ Specify the red, green, blue, and alpha values used when the + color buffers are cleared. + The initial values are all 0. +
+ glClearColor
specifies the red,
+ green,
+ blue,
+ and alpha values used by glClear to clear the color buffers.
+ Values specified by glClearColor
are clamped to the range
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glClearDepthf — specify the clear value for the depth buffer
void glClearDepthf( | GLclampf depth) ; |
depth
+ Specifies the depth value used when the depth buffer is cleared. The + initial value is 1. +
+ glClearDepthf
specifies the depth value used by glClear to clear the depth buffer.
+ Values specified by glClearDepthf
are clamped to the range
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glClearStencil — specify the clear value for the stencil buffer
void glClearStencil( | GLint s) ; |
s
+ Specifies the index used when the stencil buffer is cleared. + The initial value is 0. +
+ glClearStencil
specifies the index used by glClear to clear the stencil buffer.
+ s
is masked with
+
+ glGet with argument GL_STENCIL_CLEAR_VALUE
+
+ glGet with argument GL_STENCIL_BITS
+
+ glClear, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glColorMask — enable and disable writing of frame buffer color components
void glColorMask( | GLboolean red, |
GLboolean green, | |
GLboolean blue, | |
GLboolean alpha) ; |
red
, green
, blue
, alpha
+ Specify whether red, green, blue, and alpha can or cannot be written
+ into the frame buffer.
+ The initial values are all GL_TRUE
,
+ indicating that the color components can be written.
+
+ glColorMask
specifies whether the individual color components in the frame buffer
+ can or cannot be written.
+ If red
is GL_FALSE
,
+ for example,
+ no change is made to the red component of any pixel in any of the
+ color buffers,
+ regardless of the drawing operation attempted.
+
+ Changes to individual bits of components cannot be controlled. + Rather, + changes are either enabled or disabled for entire color components. +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCompileShader — compile a shader object
void glCompileShader( | GLuint shader) ; |
For implementations that support a shader compiler,
+ glCompileShader
compiles the source
+ code strings that have been stored in the shader object
+ specified by shader
.
The compilation status will be stored as part of the
+ shader object's state. This value will be set to
+ GL_TRUE
if the shader was compiled without
+ errors and is ready for use, and GL_FALSE
+ otherwise. It can be queried by calling
+ glGetShaderiv
+ with arguments shader
and
+ GL_COMPILE_STATUS
.
Compilation of a shader can fail for a number of reasons + as specified by the OpenGL ES Shading Language Specification. + Whether or not the compilation was successful, information about + the compilation can be obtained from the shader object's + information log by calling + glGetShaderInfoLog.
Shader compiler support is optional, and thus must be queried
+ before use by calling glGet
+ with argument GL_SHADER_COMPILER
. glShaderSource,
+ glCompileShader
, glGetShaderPrecisionFormat, and
+ glReleaseShaderCompiler will
+ each generate GL_INVALID_OPERATION
on implementations
+ that do not support a shader compiler. Such implementations instead offer the
+ glShaderBinary
+ alternative for supplying a pre-compiled shader binary.
GL_INVALID_OPERATION
is generated if
+ a shader compiler is not supported.
GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
glGet
+ with argument GL_SHADER_COMPILER
glGetShaderInfoLog
+ with argument shader
glGetShaderiv
+ with arguments shader
and
+ GL_COMPILE_STATUS
glCreateShader, + glLinkProgram, + glReleaseShaderCompiler, + glShaderSource, + glGetShaderPrecisionFormat
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glCompressedTexImage2D — specify a two-dimensional texture image in a compressed format
void glCompressedTexImage2D( | GLenum target, |
GLint level, | |
GLenum internalformat, | |
GLsizei width, | |
GLsizei height, | |
GLint border, | |
GLsizei imageSize, | |
const GLvoid * data) ; |
target
+ Specifies the target texture of the active texture unit.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+ Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
internalformat
+ Specifies the format of the compressed image data stored at address data
.
+
width
+ Specifies the width of the texture image. + All + implementations support 2D texture images that are at least 64 texels + wide and cube-mapped texture images that are at least 16 texels wide. +
height
+ Specifies the height of the texture image. + All + implementations support 2D texture images that are at least 64 texels + high and cube-mapped texture images that are at least 16 texels high. +
border
+ Specifies the width of the border. + Must be 0. +
imageSize
+ Specifies the number of unsigned bytes of image data starting at the
+ address specified by data
.
+
data
+ Specifies a pointer to the compressed image data in memory. +
+ Texturing maps a portion of a specified texture image + onto each graphical primitive for which texturing is + active. Texturing is active when the current fragment shader or + vertex shader makes use of built-in texture lookup + functions. +
+ glCompressedTexImage2D
defines a two-dimensional texture image
+ or cube-map texture image using compressed image data from client memory. The texture
+ image is decoded according to the extension specification defining the specified
+ internalformat
. OpenGL ES defines no specific compressed
+ texture formats, but does provide a mechanism to obtain symbolic constants for such
+ formats provided by extensions. The number of compressed texture formats supported
+ can be obtained by querying the value of
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS
. The list of specific
+ compressed texture formats supported can be obtained by querying the value of
+ GL_COMPRESSED_TEXTURE_FORMATS
.
+
+ A GL implementation may choose to store the texture + array at any internal resolution it chooses. +
+ glCompressedTexImage2D
+ specifies a two-dimensional or cube-map texture for the current texture unit,
+ specified with glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_ENUM
is generated if
+ internalformat
is not a supported format returned in
+ GL_COMPRESSED_TEXTURE_FORMATS
.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater
+ than
+ GL_MAX_TEXTURE_SIZE
when target
+ is GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when
+ target
is not GL_TEXTURE_2D
.
+
+ GL_INVALID_VALUE
is generated if width
or height
is less than 0
+ or greater than GL_MAX_TEXTURE_SIZE
when target
+ is GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when
+ target
is not GL_TEXTURE_2D
.
+
+ GL_INVALID_VALUE
is generated if border
is not 0.
+
+ GL_INVALID_VALUE
is generated if imageSize
is not consistent with
+ the format, dimensions, and contents of the specified compressed image
+ data.
+
+ GL_INVALID_OPERATION
is generated if parameter combinations are not
+ supported by the specific compressed internal format as specified in the
+ specific texture compression extension.
+
+ Undefined results, including abnormal program termination, are generated if
+ data
is not encoded in a manner consistent with the extension
+ specification defining the internal compression format.
+
+ glGet with arguments
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS
and
+ GL_COMPRESSED_TEXTURE_FORMATS
+
+ glGet
+ with argument GL_MAX_TEXTURE_SIZE
or
+ GL_MAX_CUBE_MAP_TEXTURE_SIZE
+
+ glActiveTexture, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glTexImage2D, + glTexSubImage2D, + glTexParameter +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCompressedTexSubImage2D — specify a two-dimensional texture subimage in a compressed format
void glCompressedTexSubImage2D( | GLenum target, |
GLint level, | |
GLint xoffset, | |
GLint yoffset, | |
GLsizei width, | |
GLsizei height, | |
GLenum format, | |
GLsizei imageSize, | |
const GLvoid * data) ; |
target
+ Specifies the target texture of the active texture unit.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+ Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
xoffset
+ Specifies a texel offset in the x direction within the texture array. +
yoffset
+ Specifies a texel offset in the y direction within the texture array. +
width
+ Specifies the width of the texture subimage. +
height
+ Specifies the height of the texture subimage. +
format
+ Specifies the format of the compressed image data stored at address data
.
+
imageSize
+ Specifies the number of unsigned bytes of image data starting at the
+ address specified by data
.
+
data
+ Specifies a pointer to the compressed image data in memory. +
+ Texturing maps a portion of a specified texture image + onto each graphical primitive for which texturing is + active. Texturing is active when the current fragment shader or + vertex shader makes use of built-in texture lookup + functions. +
+ glCompressedTexSubImage2D
redefines a contiguous subregion of an existing two-dimensional
+ texture image. The texels referenced by data
replace the portion of the
+ existing texture array with x indices xoffset
and
+ yoffset
and
+
+ format
must be the same extension-specified
+ compressed-texture format previously specified by
+ glCompressedTexImage2D.
+
+ glCompressedTexSubImage2D
+ specifies a two-dimensional or cube-map texture for the current texture unit,
+ specified with glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is
+ not GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_ENUM
is generated if
+ format
is not a supported format returned in
+ GL_COMPRESSED_TEXTURE_FORMATS
.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater
+ than
+ GL_MAX_TEXTURE_SIZE
when target
+ is GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when
+ target
is not GL_TEXTURE_2D
.
+
+ GL_INVALID_VALUE
is generated if
+
+ GL_INVALID_VALUE
is generated if width
or height
is less than 0.
+
+ GL_INVALID_VALUE
is generated if imageSize
is not consistent with
+ the format, dimensions, and contents of the specified compressed image
+ data.
+
+ GL_INVALID_OPERATION
is generated if the texture array has not
+ been defined by a previous
+ glCompressedTexImage2D
+ operation whose internalformat
matches the format
+ of glCompressedTexSubImage2D
.
+
+ GL_INVALID_OPERATION
is generated if parameter combinations are not
+ supported by the specific compressed internal format as specified in the
+ specific texture compression extension.
+
+ Undefined results, including abnormal program termination, are generated if
+ data
is not encoded in a manner consistent with the extension
+ specification defining the internal compression format.
+
+ glGet with arguments
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS
and
+ GL_COMPRESSED_TEXTURE_FORMATS
+
+ glGet
+ with argument GL_MAX_TEXTURE_SIZE
or
+ GL_MAX_CUBE_MAP_TEXTURE_SIZE
+
+ glActiveTexture, + glCompressedTexImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glTexImage2D, + glTexSubImage2D, + glTexParameter +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCopyTexImage2D — copy pixels into a 2D texture image
void glCopyTexImage2D( | GLenum target, |
GLint level, | |
GLenum internalformat, | |
GLint x, | |
GLint y, | |
GLsizei width, | |
GLsizei height, | |
GLint border) ; |
target
+ Specifies the target texture of the active texture unit.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+ Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
internalformat
+ Specifies the internal format of the texture.
+ Must be one of the following symbolic constants:
+ GL_ALPHA
,
+ GL_LUMINANCE
,
+ GL_LUMINANCE_ALPHA
,
+ GL_RGB
, or
+ GL_RGBA
.
+
x
, y
+ Specify the window coordinates of the lower left corner + of the rectangular region of pixels to be copied. +
width
+ Specifies the width of the texture image. + All implementations support 2D texture images that are at least 64 texels + wide and cube-mapped texture images that are at least 16 texels wide. +
height
+ Specifies the height of the texture image. + All implementations support 2D texture images that are at least 64 texels + high and cube-mapped texture images that are at least 16 texels high. +
border
+ Specifies the width of the border. + Must be 0. +
+ Texturing maps a portion of a specified texture image + onto each graphical primitive for which texturing is + active. Texturing is active when the current fragment shader or + vertex shader makes use of built-in texture lookup + functions. +
+ glCopyTexImage2D
defines a two-dimensional texture image or cube-map texture image
+ with pixels from the current framebuffer (rather than from
+ client memory, as is the case for glTexImage2D).
+
+ The screen-aligned pixel rectangle with lower left corner at (x
,
+ y
) and with a width of width
+ and a height of height
+ defines the texture array
+ at the mipmap level specified by level
.
+ internalformat
specifies the internal format of the texture array.
+
+ The pixels in the rectangle are processed exactly as if
+ glReadPixels had been called with
+ format
set to GL_RGBA
, but the process stops just after
+ conversion of RGBA values. Subsequent processing is identical to that
+ described for glTexImage2D,
+ beginning with the clamping of the R, G, B, and A values to the range
+
+ The components required for internalformat
must be a subset of
+ those present in the framebuffer's format. For example, a GL_RGBA
+ framebuffer can be used to supply components for any internalformat
.
+ However, a GL_RGB
framebuffer can only be used to supply components for
+ GL_RGB
or GL_LUMINANCE
base internal format textures,
+ not GL_ALPHA
, GL_LUMINANCE_ALPHA
, or
+ GL_RGBA
textures.
+
+ Pixel ordering is such that lower
+
+ If any of the pixels within the specified rectangle are outside the framebuffer associated with the current + rendering context, then the values obtained for those pixels are undefined. +
+ A GL implementation may choose to store the texture + array at any internal resolution it chooses. +
+ An image with height or width of 0 indicates a NULL texture. +
+ glCopyTexImage2D
+ specifies a two-dimensional or cube-map texture for the current texture unit,
+ specified with glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_ENUM
is generated if internalformat
is not an
+ accepted format.
+
+ GL_INVALID_VALUE
is generated if target
is one of the six cube map 2D image targets and the width and height parameters are not equal.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater
+ than
+ GL_MAX_TEXTURE_SIZE
when target
+ is GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when
+ target
is not GL_TEXTURE_2D
.
+
+ GL_INVALID_VALUE
is generated if width
or height
is less than 0
+ or greater than GL_MAX_TEXTURE_SIZE
when target
+ is GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when
+ target
is not GL_TEXTURE_2D
.
+
+ GL_INVALID_VALUE
is generated if border
is not 0.
+
+ GL_INVALID_OPERATION
is generated if
+ the currently bound framebuffer's format does not contain a superset of
+ the components required by the base format of internalformat
.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if
+ the currently bound framebuffer is not framebuffer complete (i.e. the
+ return value from glCheckFramebufferStatus
+ is not GL_FRAMEBUFFER_COMPLETE
).
+
+ glActiveTexture, + glCheckFramebufferStatus, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glCopyTexSubImage2D, + glTexImage2D, + glTexParameter, + glTexSubImage2D +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCopyTexSubImage2D — copy a two-dimensional texture subimage
void glCopyTexSubImage2D( | GLenum target, |
GLint level, | |
GLint xoffset, | |
GLint yoffset, | |
GLint x, | |
GLint y, | |
GLsizei width, | |
GLsizei height) ; |
+
target
+ Specifies the target texture of the active texture unit.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+ Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
xoffset
+ Specifies a texel offset in the x direction within the texture array. +
yoffset
+ Specifies a texel offset in the y direction within the texture array. +
x
, y
+ Specify the window coordinates of the lower left corner + of the rectangular region of pixels to be copied. +
width
+ Specifies the width of the texture subimage. +
height
+ Specifies the height of the texture subimage. +
+ Texturing maps a portion of a specified texture image + onto each graphical primitive for which texturing is + active. Texturing is active when the current fragment shader or + vertex shader makes use of built-in texture lookup + functions. +
+ glCopyTexSubImage2D
replaces a rectangular portion of a two-dimensional texture image or
+ cube-map texture image with pixels from the current framebuffer
+ (rather than from client memory, as is the case for glTexSubImage2D).
+
+ The screen-aligned pixel rectangle with lower left corner at
+ width
and height height
replaces the portion of the
+ texture array with x indices xoffset
through
+ yoffset
through
+ level
.
+
+ The pixels in the rectangle are processed exactly as if
+ glReadPixels had been called with
+ format
set to GL_RGBA
, but the process stops just after
+ conversion of RGBA values. Subsequent processing is identical to that
+ described for glTexSubImage2D,
+ beginning with the clamping of the R, G, B, and A values to the range
+
+ The destination rectangle in the texture array may not include any texels + outside the texture array as it was originally specified. + It is not an error to specify a subtexture with zero width or height, but + such a specification has no effect. +
+ If any of the pixels within the specified rectangle are outside the framebuffer associated with the current + rendering context, then the values obtained for those pixels are undefined. +
+ No change is made to the internalformat, width, or + height parameters of the specified texture + array or to texel values outside the specified subregion. +
+ glCopyTexSubImage2D
+ specifies the two-dimensional or cube-map texture for the current texture unit,
+ specified with glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if
+ GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if
+
+ GL_INVALID_VALUE
is generated if width
or height
is less than 0.
+
+ GL_INVALID_OPERATION
is generated if the texture array has not been
+ defined by a previous glTexImage2D or glCopyTexImage2D operation.
+
+ GL_INVALID_OPERATION
is generated if
+ the currently bound framebuffer's format does not contain a superset of
+ the components required by the texture's base internal format.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if
+ the currently bound framebuffer is not framebuffer complete (i.e. the
+ return value from glCheckFramebufferStatus
+ is not GL_FRAMEBUFFER_COMPLETE
).
+
+ glActiveTexture, + glCheckFramebufferStatus, + glCopyTexImage2D, + glTexImage2D, + glTexParameter, + glTexSubImage2D +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glCreateProgram — create a program object
GLuint glCreateProgram( | void) ; |
glCreateProgram
creates an empty
+ program object and returns a non-zero value by which it can be
+ referenced. A program object is an object to which shader
+ objects can be attached. This provides a mechanism to specify
+ the shader objects that will be linked to create a program. It
+ also provides a means for checking the compatibility of the
+ shaders that will be used to create a program (for instance,
+ checking the compatibility between a vertex shader and a
+ fragment shader). When no longer needed as part of a program
+ object, shader objects can be detached.
One or more executables are created in a program object by + successfully attaching shader objects to it with + glAttachShader, + successfully compiling the shader objects with + glCompileShader, + and successfully linking the program object with + glLinkProgram. + These executables are made part of current state when + glUseProgram + is called. Program objects can be deleted by calling + glDeleteProgram. + The memory associated with the program object will be deleted + when it is no longer part of current rendering state for any + context.
Like texture objects, the name space for + program objects may be shared across a set of contexts, as long + as the server sides of the contexts share the same address + space. If the name space is shared across contexts, any attached + objects and the data associated with those attached objects are + shared as well.
Applications are responsible for providing the + synchronization across API calls when objects are accessed from + different execution threads.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib + with a valid program object and the index of an active attribute + variable
glGetActiveUniform + with a valid program object and the index of an active uniform + variable
glGetAttachedShaders + with a valid program object
glGetAttribLocation + with a valid program object and the name of an attribute + variable
glGetProgramiv + with a valid program object and the parameter to be queried
glGetProgramInfoLog + with a valid program object
glGetUniform + with a valid program object and the location of a uniform + variable
glGetUniformLocation + with a valid program object and the name of a uniform + variable
glAttachShader, + glBindAttribLocation, + glCreateShader, + glDeleteProgram, + glDetachShader, + glLinkProgram, + glUniform, + glUseProgram, + glValidateProgram
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glCreateShader — create a shader object
GLuint glCreateShader( | GLenum shaderType) ; |
shaderType
Specifies the type of shader to be created.
+ Must be either GL_VERTEX_SHADER
+ or GL_FRAGMENT_SHADER
.
glCreateShader
creates an empty
+ shader object and returns a non-zero value by which it can be
+ referenced. A shader object is used to maintain the source code
+ strings that define a shader. shaderType
+ indicates the type of shader to be created. Two types of shaders
+ are supported. A shader of type
+ GL_VERTEX_SHADER
is a shader that is
+ intended to run on the programmable vertex processor. A shader of
+ type GL_FRAGMENT_SHADER
is a shader that is
+ intended to run on the programmable fragment processor.
When created, a shader object's
+ GL_SHADER_TYPE
parameter is set to either
+ GL_VERTEX_SHADER
or
+ GL_FRAGMENT_SHADER
, depending on the value
+ of shaderType
.
Like texture objects, the name space for + shader objects may be shared across a set of contexts, as long + as the server sides of the contexts share the same address + space. If the name space is shared across contexts, any attached + objects and the data associated with those attached objects are + shared as well.
Applications are responsible for providing the + synchronization across API calls when objects are accessed from + different execution threads.
This function returns 0 if an error occurs creating the + shader object.
GL_INVALID_ENUM
is generated if
+ shaderType
is not an accepted value.
glGetShaderiv + with a valid shader object and the parameter to be queried
glGetShaderInfoLog + with a valid shader object
glGetShaderSource + with a valid shader object
glAttachShader, + glCompileShader, + glDeleteShader, + glDetachShader, + glShaderSource, + glShaderBinary +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glCullFace — specify whether front- or back-facing polygons can be culled
void glCullFace( | GLenum mode) ; |
mode
+ Specifies whether front- or back-facing polygons are candidates for culling.
+ Symbolic constants
+ GL_FRONT
, GL_BACK
, and GL_FRONT_AND_BACK
are accepted.
+ The initial value is GL_BACK
.
+
+ glCullFace
specifies whether front- or back-facing polygons are culled
+ (as specified by mode) when polygon culling is enabled. Polygon
+ culling is initially disabled.
+ To enable and disable polygon culling, call the
+ glEnable and glDisable commands
+ with the argument GL_CULL_FACE
.
+
+ glFrontFace specifies which of the clockwise and counterclockwise polygons + are front-facing and back-facing. + See glFrontFace. +
+ If mode
is GL_FRONT_AND_BACK
, no polygons are drawn, but other
+ primitives such as points and lines are drawn.
+
+ glIsEnabled with argument GL_CULL_FACE
+
+ glGet with argument GL_CULL_FACE_MODE
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDeleteBuffers — delete named buffer objects
void glDeleteBuffers( | GLsizei n, |
const GLuint * buffers) ; |
n
+ Specifies the number of buffer objects to be deleted. +
buffers
+ Specifies an array of buffer objects to be deleted. +
+ glDeleteBuffers
deletes n
buffer objects named by the elements of the array buffers
.
+ After a buffer object is deleted, it has no contents,
+ and its name is free for reuse (for example by glGenBuffers).
+ If a buffer object that is currently bound is deleted, the binding reverts
+ to 0 (the absence of any buffer object, which reverts to client memory usage).
+
+ glDeleteBuffers
silently ignores 0's and names that do not correspond to
+ existing buffer objects.
+
+ Copyright © 2005 Addison-Wesley. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glDeleteFramebuffers — delete named framebuffer objects
void glDeleteFramebuffers( | GLsizei n, |
const GLuint * framebuffers) ; |
n
+ Specifies the number of framebuffer objects to be deleted. +
framebuffers
+ Specifies an array of framebuffer objects to be deleted. +
+ glDeleteFramebuffers
deletes n
framebuffer objects named by the elements of the array framebuffers
.
+ After a framebuffer object is deleted, it has no attachments,
+ and its name is free for reuse (for example by glGenFramebuffers).
+ If a framebuffer object that is currently bound is deleted, the binding reverts
+ to 0 (the window-system-provided framebuffer).
+
+ glDeleteFramebuffers
silently ignores 0's and names that do not correspond to
+ existing framebuffer objects.
+
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glDeleteProgram — delete a program object
void glDeleteProgram( | GLuint program) ; |
glDeleteProgram
frees the memory and
+ invalidates the name associated with the program object
+ specified by program.
This command
+ effectively undoes the effects of a call to
+ glCreateProgram.
If a program object is in use as part of current rendering
+ state, it will be flagged for deletion, but it will not be
+ deleted until it is no longer part of current state for any
+ rendering context. If a program object to be deleted has shader
+ objects attached to it, those shader objects will be
+ automatically detached but not deleted unless they have already
+ been flagged for deletion by a previous call to
+ glDeleteShader.
+ A value of 0 for program
will be silently
+ ignored.
To determine whether a program object has been flagged for
+ deletion, call
+ glGetProgramiv
+ with arguments program
and
+ GL_DELETE_STATUS
.
glGet
+ with argument GL_CURRENT_PROGRAM
glGetProgramiv
+ with arguments program
and
+ GL_DELETE_STATUS
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glDeleteRenderbuffers — delete named renderbuffer objects
void glDeleteRenderbuffers( | GLsizei n, |
const GLuint * renderbuffers) ; |
n
+ Specifies the number of renderbuffer objects to be deleted. +
renderbuffers
+ Specifies an array of renderbuffer objects to be deleted. +
+ glDeleteRenderbuffers
deletes n
renderbuffer objects named by the elements of the array renderbuffers
.
+ After a renderbuffer object is deleted, it has no contents,
+ and its name is free for reuse (for example by glGenRenderbuffers).
+
+ If a renderbuffer object that is currently bound is deleted, the binding reverts + to 0 (the absence of any renderbuffer object). Additionally, special care + must be taken when deleting a renderbuffer object if the image of the renderbuffer + is attached to a framebuffer object. In this case, if the deleted renderbuffer object is + attached to the currently bound framebuffer object, it is + automatically detached. However, attachments to any other framebuffer objects are the + responsibility of the application. +
+ glDeleteRenderbuffers
silently ignores 0's and names that do not correspond to
+ existing renderbuffer objects.
+
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glDeleteShader — delete a shader object
void glDeleteShader( | GLuint shader) ; |
glDeleteShader
frees the memory and
+ invalidates the name associated with the shader object specified
+ by shader
. This command effectively
+ undoes the effects of a call to
+ glCreateShader.
If a shader object to be deleted is attached to a program
+ object, it will be flagged for deletion, but it will not be
+ deleted until it is no longer attached to any program object,
+ for any rendering context (i.e., it must be detached from
+ wherever it was attached before it will be deleted). A value of
+ 0 for shader
will be silently
+ ignored.
To determine whether an object has been flagged for
+ deletion, call
+ glGetShaderiv
+ with arguments shader
and
+ GL_DELETE_STATUS
.
glGetAttachedShaders + with the program object to be queried
glGetShaderiv
+ with arguments shader
and
+ GL_DELETE_STATUS
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glDeleteTextures — delete named textures
void glDeleteTextures( | GLsizei n, |
const GLuint * textures) ; |
n
+ Specifies the number of textures to be deleted. +
textures
+ Specifies an array of textures to be deleted. +
+ glDeleteTextures
deletes n
textures named by the elements of the array textures
.
+ After a texture is deleted, it has no contents or dimensionality,
+ and its name is free for reuse (for example by glGenTextures).
+ If a texture that is currently bound is deleted, the binding reverts
+ to 0 (the default texture).
+
+ glDeleteTextures
silently ignores 0's and names that do not correspond to
+ existing textures.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDepthFunc — specify the value used for depth buffer comparisons
void glDepthFunc( | GLenum func) ; |
func
+ Specifies the depth comparison function.
+ Symbolic constants
+ GL_NEVER
,
+ GL_LESS
,
+ GL_EQUAL
,
+ GL_LEQUAL
,
+ GL_GREATER
,
+ GL_NOTEQUAL
,
+ GL_GEQUAL
, and
+ GL_ALWAYS
are accepted.
+ The initial value is GL_LESS
.
+
+ glDepthFunc
specifies the function used to compare each incoming pixel depth value
+ with the depth value present in the depth buffer.
+ The comparison is performed only if depth testing is enabled.
+ (See glEnable and glDisable of GL_DEPTH_TEST
.)
+
+ func
specifies the conditions under which the pixel will be drawn.
+ The comparison functions are as follows:
+
GL_NEVER
+ Never passes. +
GL_LESS
+ Passes if the incoming depth value is less than the stored depth value. +
GL_EQUAL
+ Passes if the incoming depth value is equal to the stored depth value. +
GL_LEQUAL
+ Passes if the incoming depth value is less than or equal to + the stored depth value. +
GL_GREATER
+ Passes if the incoming depth value is greater than the stored depth value. +
GL_NOTEQUAL
+ Passes if the incoming depth value is not equal to the stored depth value. +
GL_GEQUAL
+ Passes if the incoming depth value is greater than or equal to + the stored depth value. +
GL_ALWAYS
+ Always passes. +
+ The initial value of func
is GL_LESS
.
+ Initially, depth testing is disabled. If depth testing is disabled or no depth
+ buffer exists, it is as if the depth test always passes.
+
+ Even if the depth buffer exists and the depth mask is non-zero, the + depth buffer is not updated if the depth test is disabled. +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDepthMask — enable or disable writing into the depth buffer
void glDepthMask( | GLboolean flag) ; |
flag
+ Specifies whether the depth buffer is enabled for writing.
+ If flag
is GL_FALSE
,
+ depth buffer writing is disabled.
+ Otherwise, it is enabled.
+ Initially, depth buffer writing is enabled.
+
+ glDepthMask
specifies whether the depth buffer is enabled for writing.
+ If flag
is GL_FALSE
,
+ depth buffer writing is disabled.
+ Otherwise, it is enabled.
+ Initially, depth buffer writing is enabled.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDepthRangef — specify mapping of depth values from normalized device coordinates to window coordinates
void glDepthRangef( | GLclampf nearVal, |
GLclampf farVal) ; |
nearVal
+ Specifies the mapping of the near clipping plane to window coordinates. + The initial value is 0. +
farVal
+ Specifies the mapping of the far clipping plane to window coordinates. + The initial value is 1. +
+ After clipping and division by w,
+ depth coordinates range from
+ glDepthRangef
specifies a linear mapping of the normalized depth coordinates
+ in this range to window depth coordinates.
+ Regardless of the actual depth buffer implementation,
+ window coordinate depth values are treated as though they range
+ from 0 through 1 (like color components).
+ Thus,
+ the values accepted by glDepthRangef
are both clamped to this range
+ before they are accepted.
+
+ The setting of (0,1) maps the near plane to 0 and + the far plane to 1. + With this mapping, + the depth buffer range is fully utilized. +
+ It is not necessary that nearVal
be less than farVal
.
+ Reverse mappings such as
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDetachShader — detach a shader object from a program object
void glDetachShader( | GLuint program, |
GLuint shader) ; |
program
Specifies the program object from which to + detach the shader object.
shader
Specifies the shader object to be + detached.
glDetachShader
detaches the shader
+ object specified by shader
from the
+ program object specified by program
. This
+ command can be used to undo the effect of the command
+ glAttachShader.
If shader
has already been flagged
+ for deletion by a call to
+ glDeleteShader
+ and it is not attached to any other program object, it will be
+ deleted after it has been detached.
GL_INVALID_VALUE
is generated if either
+ program
or shader
+ is a value that was not generated by OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_OPERATION
is generated if
+ shader
is not attached to
+ program
.
glGetAttachedShaders + with the handle of a valid program object
glGetShaderiv
+ with arguments shader
and
+ GL_DELETE_STATUS
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glDrawArrays — render primitives from array data
void glDrawArrays( | GLenum mode, |
GLint first, | |
GLsizei count) ; |
mode
+ Specifies what kind of primitives to render.
+ Symbolic constants
+ GL_POINTS
,
+ GL_LINE_STRIP
,
+ GL_LINE_LOOP
,
+ GL_LINES
,
+ GL_TRIANGLE_STRIP
,
+ GL_TRIANGLE_FAN
, and
+ GL_TRIANGLES
are accepted.
+
first
+ Specifies the starting index in the enabled arrays. +
count
+ Specifies the number of indices to be rendered. +
+ glDrawArrays
specifies multiple geometric primitives
+ with very few subroutine calls. Instead of calling a GL procedure
+ to pass each individual vertex attribute, you can use
+ glVertexAttribPointer
+ to prespecify separate arrays of vertices, normals, and colors and use them to
+ construct a sequence of primitives with a single
+ call to glDrawArrays
.
+
+ When glDrawArrays
is called, it uses count
sequential elements from each
+ enabled array to construct a sequence of geometric primitives,
+ beginning with element first
. mode
specifies what kind of
+ primitives are constructed and how the array elements
+ construct those primitives.
+
+ To enable and disable a generic vertex attribute array, call + glEnableVertexAttribArray + and + glDisableVertexAttribArray. +
+ If the current program object, as set by + glUseProgram, + is invalid, rendering results are undefined. However, no error is generated + for this case. +
+ GL_INVALID_ENUM
is generated if mode
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated if count
is negative.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if
+ the currently bound framebuffer is not framebuffer complete (i.e. the
+ return value from glCheckFramebufferStatus
+ is not GL_FRAMEBUFFER_COMPLETE
).
+
+ glCheckFramebufferStatus, + glDisableVertexAttribArray, + glDrawElements, + glEnableVertexAttribArray, + glUseProgram, + glVertexAttribPointer +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glDrawElements — render primitives from array data
void glDrawElements( | GLenum mode, |
GLsizei count, | |
GLenum type, | |
const GLvoid * indices) ; |
mode
+ Specifies what kind of primitives to render.
+ Symbolic constants
+ GL_POINTS
,
+ GL_LINE_STRIP
,
+ GL_LINE_LOOP
,
+ GL_LINES
,
+ GL_TRIANGLE_STRIP
,
+ GL_TRIANGLE_FAN
, and
+ GL_TRIANGLES
are accepted.
+
count
+ Specifies the number of elements to be rendered. +
type
+ Specifies the type of the values in indices
. Must be
+ GL_UNSIGNED_BYTE
or GL_UNSIGNED_SHORT
.
+
indices
+ Specifies a pointer to the location where the indices are stored. +
+ glDrawElements
specifies multiple geometric primitives
+ with very few subroutine calls. Instead of calling a GL function
+ to pass each vertex attribute, you can use
+ glVertexAttribPointer
+ to prespecify separate arrays of vertex attributes and use them to
+ construct a sequence of primitives with a single
+ call to glDrawElements
.
+
+ When glDrawElements
is called, it uses count
sequential elements from an
+ enabled array, starting at indices
to construct a sequence of
+ geometric primitives. mode
specifies what kind of primitives are
+ constructed and how the array elements construct these primitives. If
+ more than one array is enabled, each is used.
+
+ To enable and disable a generic vertex attribute array, call + glEnableVertexAttribArray + and + glDisableVertexAttribArray. +
+ If the current program object, as set by + glUseProgram, + is invalid, rendering results are undefined. However, no error is generated + for this case. +
+ GL_INVALID_ENUM
is generated if mode
is not an accepted value.
+
+ GL_INVALID_ENUM
is generated if type
is not
+ GL_UNSIGNED_BYTE
or GL_UNSIGNED_SHORT
.
+
+ GL_INVALID_VALUE
is generated if count
is negative.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if
+ the currently bound framebuffer is not framebuffer complete (i.e. the
+ return value from glCheckFramebufferStatus
+ is not GL_FRAMEBUFFER_COMPLETE
).
+
+ glCheckFramebufferStatus, + glDisableVertexAttribArray, + glDrawArrays, + glEnableVertexAttribArray, + glUseProgram, + glVertexAttribPointer +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glEnable — enable or disable server-side GL capabilities
void glEnable( | GLenum cap) ; |
void glDisable( | GLenum cap) ; |
+ glEnable
and glDisable enable and disable various capabilities.
+ Use glIsEnabled or glGet to determine the current setting
+ of any capability. The initial value for each capability with the
+ exception of GL_DITHER
is GL_FALSE
. The initial value for
+ GL_DITHER
is GL_TRUE
.
+
+ Both glEnable
and glDisable take a single argument, cap
,
+ which can assume one of the following values:
+
GL_BLEND
+ If enabled, + blend the computed fragment color values with the values in the color + buffers. See glBlendFunc. +
GL_CULL_FACE
+ If enabled, + cull polygons based on their winding in window coordinates. + See glCullFace. +
GL_DEPTH_TEST
+ If enabled, + do depth comparisons and update the depth buffer. Note that even if + the depth buffer exists and the depth mask is non-zero, the + depth buffer is not updated if the depth test is disabled. See + glDepthFunc and + glDepthRangef. +
GL_DITHER
+ If enabled, + dither color components or indices before they are written to the + color buffer. +
GL_POLYGON_OFFSET_FILL
+ If enabled, an offset is added to depth values of a polygon's + fragments produced by rasterization. + See glPolygonOffset. +
GL_SAMPLE_ALPHA_TO_COVERAGE
+ If enabled, + compute a temporary coverage value where each bit is determined by the + alpha value at the corresponding sample location. The temporary coverage + value is then ANDed with the fragment coverage value. +
GL_SAMPLE_COVERAGE
+ If enabled,
+ the fragment's coverage is ANDed with the temporary coverage value. If
+ GL_SAMPLE_COVERAGE_INVERT
is set to GL_TRUE
, invert the coverage
+ value.
+ See glSampleCoverage.
+
GL_SCISSOR_TEST
+ If enabled, + discard fragments that are outside the scissor rectangle. + See glScissor. +
GL_STENCIL_TEST
+ If enabled, + do stencil testing and update the stencil buffer. + See glStencilFunc and glStencilOp. +
+ glActiveTexture, + glBlendFunc, + glCullFace, + glDepthFunc, + glDepthRangef, + glGet, + glIsEnabled, + glLineWidth, + glPolygonOffset, + glScissor, + glStencilFunc, + glStencilOp, + glTexImage2D +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glEnableVertexAttribArray — enable or disable a generic vertex attribute array
void glEnableVertexAttribArray( | GLuint index) ; |
void glDisableVertexAttribArray( | GLuint index) ; |
glEnableVertexAttribArray
enables the
+ generic vertex attribute array specified by
+ index
.
+ glDisableVertexAttribArray
disables the
+ generic vertex attribute array specified by
+ index
. By default, all client-side
+ capabilities are disabled, including all generic vertex
+ attribute arrays. If enabled, the values in the generic vertex
+ attribute array will be accessed and used for rendering when
+ calls are made to vertex array commands such as
+ glDrawArrays
+ or
+ glDrawElements.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttrib
+ with arguments index
and
+ GL_VERTEX_ATTRIB_ARRAY_ENABLED
+
glGetVertexAttribPointerv
+ with arguments index
and
+ GL_VERTEX_ATTRIB_ARRAY_POINTER
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glFinish — block until all GL execution is complete
void glFinish( | void) ; |
+ glFinish
does not return until the effects of all previously
+ called GL commands are complete.
+ Such effects include all changes to GL state,
+ all changes to connection state,
+ and all changes to the frame buffer contents.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glFlush — force execution of GL commands in finite time
void glFlush( | void) ; |
+ Different GL implementations buffer commands in several different locations,
+ including network buffers and the graphics accelerator itself.
+ glFlush
empties all of these buffers,
+ causing all issued commands to be executed as quickly as
+ they are accepted by the actual rendering engine.
+ Though this execution may not be completed in any particular
+ time period,
+ it does complete in finite time.
+
+ Because any GL program might be executed over a network,
+ or on an accelerator that buffers commands,
+ all programs should call glFlush
whenever they count on having
+ all of their previously issued commands completed.
+ For example,
+ call glFlush
before waiting for user input that depends on
+ the generated image.
+
+ glFlush
can return at any time.
+ It does not wait until the execution of all previously
+ issued GL commands is complete.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glFramebufferRenderbuffer — attach a renderbuffer object to a framebuffer object
void glFramebufferRenderbuffer( | GLenum target, |
GLenum attachment, | |
GLenum renderbuffertarget, | |
GLuint renderbuffer) ; |
target
Specifies the framebuffer target. The symbolic constant must be
+ GL_FRAMEBUFFER
.
attachment
Specifies the attachment point to which
+ renderbuffer
should be attached. Must be one of the
+ following symbolic constants:
+ GL_COLOR_ATTACHMENT0
,
+ GL_DEPTH_ATTACHMENT
, or
+ GL_STENCIL_ATTACHMENT
.
renderbuffertarget
Specifies the renderbuffer target. The symbolic constant must be
+ GL_RENDERBUFFER
.
renderbuffer
Specifies the renderbuffer object that is to be attached.
glFramebufferRenderbuffer
attaches the
+ renderbuffer specified by renderbuffer
as
+ one of the logical buffers of the currently bound framebuffer object.
+ attachment
specifies whether the renderbuffer
+ should be attached to the framebuffer object's color, depth, or
+ stencil buffer. A renderbuffer may not be attached to the default
+ framebuffer object name 0.
If renderbuffer
is not 0, the value of
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
for the
+ specified attachment point is set to GL_RENDERBUFFER
+ and the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
+ is set to renderbuffer
.
+ GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
and
+ GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
are
+ set to the default values 0 and GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ respectively. Any previous attachment to the attachment
+ logical buffer of the currently bound framebuffer object is broken.
If renderbuffer
is 0, the current image, if any, attached to
+ the attachment
logical buffer of the currently bound
+ framebuffer object is detached. The value of
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is set to
+ GL_NONE
. The value of
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
is set to 0.
+ GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
and
+ GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
are
+ set to the default values 0 and GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ respectively.
+ If a renderbuffer object is deleted while its image is attached to the currently
+ bound framebuffer, then it is as if glFramebufferRenderbuffer
+ had been called with a renderbuffer
of 0 for the attachment
+ point to which this image was attached in the currently bound framebuffer object.
+ In other words, the renderbuffer image is detached from the currently bound
+ framebuffer. Note that the renderbuffer image is specifically not
+ detached from any non-bound framebuffers. Detaching the image from any non-bound
+ framebuffers is the responsibility of the application.
+
GL_INVALID_ENUM
is generated if
+ target
is not GL_FRAMEBUFFER
.
GL_INVALID_ENUM
is generated if
+ renderbuffertarget
is not GL_RENDERBUFFER
and
+ renderbuffer
is not 0.
GL_INVALID_ENUM
is generated if
+ attachment
is not an accepted attachment point.
GL_INVALID_OPERATION
is generated if
+ the default framebuffer object name 0 is bound.
GL_INVALID_OPERATION
is generated if
+ renderbuffer
is neither 0 nor the name of an existing
+ renderbuffer object.
glBindFramebuffer, + glBindRenderbuffer, + glCheckFramebufferStatus, + glDeleteFramebuffers, + glDeleteRenderbuffers, + glFramebufferTexture2D, + glGetFramebufferAttachmentParameteriv, + glRenderbufferStorage
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glFramebufferTexture2D — attach a texture image to a framebuffer object
void glFramebufferTexture2D( | GLenum target, |
GLenum attachment, | |
GLenum textarget, | |
GLuint texture, | |
GLint level) ; |
target
Specifies the framebuffer target. The symbolic constant must be
+ GL_FRAMEBUFFER
.
attachment
Specifies the attachment point to which an image from
+ texture
should be attached. Must be one of the
+ following symbolic constants:
+ GL_COLOR_ATTACHMENT0
,
+ GL_DEPTH_ATTACHMENT
, or
+ GL_STENCIL_ATTACHMENT
.
textarget
Specifies the texture target. Must be one of the
+ following symbolic constants:
+ GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
texture
Specifies the texture object whose image is to be attached.
level
Specifies the mipmap level of the texture image to be attached, + which must be 0.
glFramebufferTexture2D
attaches the
+ texture image specified by texture
and
+ level
as
+ one of the logical buffers of the currently bound framebuffer object.
+ attachment
specifies whether the texture image
+ should be attached to the framebuffer object's color, depth, or
+ stencil buffer. A texture image may not be attached to the default
+ framebuffer object name 0.
If texture
is not 0, the value of
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
for the
+ specified attachment point is set to GL_TEXTURE
,
+ the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
+ is set to texture
, and the value of
+ GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
is set to
+ level
. If texture
is a cube map
+ texture, the value of GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
+ is set to textarget
; otherwise it is set to the default value
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
. Any previous attachment to the
+ attachment
logical buffer of the currently bound framebuffer
+ object is broken.
If texture
is 0, the current image, if any, attached to
+ the attachment
logical buffer of the currently bound
+ framebuffer object is detached. The value of
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is set to
+ GL_NONE
. The value of
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
is set to 0.
+ GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
and
+ GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
are
+ set to the default values 0 and GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ respectively.
+ Special precautions need to be taken to avoid attaching a texture image to the + currently bound framebuffer while the texture object is currently bound and + potentially sampled by the current vertex or fragment shader. Doing so could lead to + the creation of a "feedback loop" between the writing of pixels by rendering operations + and the simultaneous reading of those same pixels when used as texels in the + currently bound texture. In this scenario, the framebuffer will be considered + framebuffer complete, but the values of fragments rendered while in this state will + be undefined. The values of texture samples may be undefined as well. +
+ If a texture object is deleted while its image is attached to the currently
+ bound framebuffer, then it is as if glFramebufferTexture2D
+ had been called with a texture
of 0 for the attachment
+ point to which this image was attached in the currently bound framebuffer object.
+ In other words, the texture image is detached from the currently bound
+ framebuffer. Note that the texture image is specifically not
+ detached from any non-bound framebuffers. Detaching the image from any non-bound
+ framebuffers is the responsibility of the application.
+
GL_INVALID_ENUM
is generated if
+ target
is not GL_FRAMEBUFFER
.
GL_INVALID_ENUM
is generated if
+ textarget
is not an accepted texture target and
+ texture
is not 0.
GL_INVALID_ENUM
is generated if
+ attachment
is not an accepted attachment point.
GL_INVALID_VALUE
is generated if
+ level
is not 0 and
+ texture
is not 0.
GL_INVALID_OPERATION
is generated if
+ the default framebuffer object name 0 is bound.
GL_INVALID_OPERATION
is generated if
+ texture
is neither 0 nor the name of an existing
+ texture object.
GL_INVALID_OPERATION
is generated if
+ texture
is the name of an existing two-dimensional
+ texture object but textarget
is not
+ GL_TEXTURE_2D
or if texture
is
+ the name of an existing cube map texture object but textarget
+ is GL_TEXTURE_2D
.
glBindFramebuffer, + glBindTexture, + glCheckFramebufferStatus, + glDeleteFramebuffers, + glDeleteTextures, + glFramebufferRenderbuffer, + glGenerateMipmap, + glGetFramebufferAttachmentParameteriv, + glTexImage2D
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glFrontFace — define front- and back-facing polygons
void glFrontFace( | GLenum mode) ; |
mode
+ Specifies the orientation of front-facing polygons.
+ GL_CW
and GL_CCW
are accepted.
+ The initial value is GL_CCW
.
+
+ In a scene composed entirely of opaque closed surfaces,
+ back-facing polygons are never visible.
+ Eliminating these invisible polygons has the obvious benefit
+ of speeding up the rendering of the image.
+ To enable and disable elimination of back-facing polygons, call glEnable
+ and glDisable with argument GL_CULL_FACE
.
+
+ The projection of a polygon to window coordinates is said to have
+ clockwise winding if an imaginary object following the path
+ from its first vertex,
+ its second vertex,
+ and so on,
+ to its last vertex,
+ and finally back to its first vertex,
+ moves in a clockwise direction about the interior of the polygon.
+ The polygon's winding is said to be counterclockwise if the imaginary
+ object following the same path moves in a counterclockwise direction
+ about the interior of the polygon.
+ glFrontFace
specifies whether polygons with clockwise winding in window coordinates,
+ or counterclockwise winding in window coordinates,
+ are taken to be front-facing.
+ Passing GL_CCW
to mode
selects counterclockwise polygons as
+ front-facing;
+ GL_CW
selects clockwise polygons as front-facing.
+ By default, counterclockwise polygons are taken to be front-facing.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGenBuffers — generate buffer object names
void glGenBuffers( | GLsizei n, |
GLuint * buffers) ; |
n
+ Specifies the number of buffer object names to be generated. +
buffers
+ Specifies an array in which the generated buffer object names are stored. +
+ glGenBuffers
returns n
buffer object names in buffers
.
+ There is no guarantee that the names form a contiguous set of integers;
+ however, it is guaranteed that none of the returned names was in use
+ immediately before the call to glGenBuffers
.
+
+ Buffer object names returned by a call to glGenBuffers
are not returned by
+ subsequent calls, unless they are first deleted with
+ glDeleteBuffers.
+
+ No buffer objects are associated with the returned buffer object names until they are first bound by calling + glBindBuffer. +
+ Copyright © 2005 Addison-Wesley. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGenFramebuffers — generate framebuffer object names
void glGenFramebuffers( | GLsizei n, |
GLuint * framebuffers) ; |
n
+ Specifies the number of framebuffer object names to be generated. +
framebuffers
+ Specifies an array in which the generated framebuffer object names are stored. +
+ glGenFramebuffers
returns n
framebuffer object names in framebuffers
.
+ There is no guarantee that the names form a contiguous set of integers;
+ however, it is guaranteed that none of the returned names was in use
+ immediately before the call to glGenFramebuffers
.
+
+ Framebuffer object names returned by a call to glGenFramebuffers
are not returned by
+ subsequent calls, unless they are first deleted with
+ glDeleteFramebuffers.
+
+ No framebuffer objects are associated with the returned framebuffer object names until they are first bound by calling + glBindFramebuffer. +
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGenRenderbuffers — generate renderbuffer object names
void glGenRenderbuffers( | GLsizei n, |
GLuint * renderbuffers) ; |
n
+ Specifies the number of renderbuffer object names to be generated. +
renderbuffers
+ Specifies an array in which the generated renderbuffer object names are stored. +
+ glGenRenderbuffers
returns n
renderbuffer object names in renderbuffers
.
+ There is no guarantee that the names form a contiguous set of integers;
+ however, it is guaranteed that none of the returned names was in use
+ immediately before the call to glGenRenderbuffers
.
+
+ Renderbuffer object names returned by a call to glGenRenderbuffers
are not returned by
+ subsequent calls, unless they are first deleted with
+ glDeleteRenderbuffers.
+
+ No renderbuffer objects are associated with the returned renderbuffer object names until they are first bound by calling + glBindRenderbuffer. +
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGenTextures — generate texture names
void glGenTextures( | GLsizei n, |
GLuint * textures) ; |
n
+ Specifies the number of texture names to be generated. +
textures
+ Specifies an array in which the generated texture names are stored. +
+ glGenTextures
returns n
texture names in textures
.
+ There is no guarantee that the names form a contiguous set of integers;
+ however, it is guaranteed that none of the returned names was in use
+ immediately before the call to glGenTextures
.
+
+ The generated textures have no dimensionality; they assume the dimensionality + of the texture target to which they are first bound + (see glBindTexture). +
+ Texture names returned by a call to glGenTextures
are not returned by
+ subsequent calls, unless they are first deleted with
+ glDeleteTextures.
+
+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glGet, + glGetTexParameter, + glTexImage2D, + glTexParameter +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGenerateMipmap — generate a complete set of mipmaps for a texture object
void glGenerateMipmap( | GLenum target) ; |
target
Specifies the texture target of the active texture unit to which the texture object
+ is bound whose mipmaps will be generated. Must be one of the following
+ symbolic constants: GL_TEXTURE_2D
or
+ GL_TEXTURE_CUBE_MAP
.
glGenerateMipmap
computes a complete set
+ of mipmap arrays derived from the zero level array. Array levels up to and
+ including the 1x1 dimension texture image are replaced with the derived arrays,
+ regardless of previous contents. The zero level texture image is left unchanged.
The internal formats of the derived mipmap arrays all match those of + the zero level texture image. The dimensions of the derived arrays are computed by + halving the width and height of the zero level texture image, then in turn halving + the dimensions of each array level until the 1x1 dimension texture image is + reached.
The contents of the derived arrays are computed by repeated filtered reduction + of the zero level array. No particular filter algorithm is required, though a + box filter is recommended. + glHint may be called + to express a preference for speed or quality of filtering.
GL_INVALID_ENUM
is generated if
+ target
is not GL_TEXTURE_2D
or
+ GL_TEXTURE_CUBE_MAP
.
GL_INVALID_OPERATION
is generated if
+ the texture bound to target
is a cube map, but its
+ six faces do not share indentical widths, heights, formats, and types.
GL_INVALID_OPERATION
is generated if
+ either the width or height of the zero level array is not a power of two.
GL_INVALID_OPERATION
is generated if
+ the zero level array is stored in a compressed internal format.
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGet — return the value or values of a selected parameter
void glGetBooleanv( | GLenum pname, |
GLboolean * params) ; |
void glGetFloatv( | GLenum pname, |
GLfloat * params) ; |
void glGetIntegerv( | GLenum pname, |
GLint * params) ; |
pname
+ Specifies the parameter value to be returned. + The symbolic constants in the list below are accepted. +
params
+ Returns the value or values of the specified parameter. +
+ These four commands return values for simple state variables in GL.
+ pname
is a symbolic constant indicating the state variable to be returned,
+ and params
is a pointer to an array of the indicated type in
+ which to place the returned data.
+
+ Type conversion is performed if params
has a different type than
+ the state variable value being requested.
+ If glGetBooleanv
is called,
+ a floating-point (or integer) value is converted to GL_FALSE
if
+ and only if it is 0.0 (or 0).
+ Otherwise,
+ it is converted to GL_TRUE
.
+ If glGetIntegerv
is called, boolean values are returned as
+ GL_TRUE
or GL_FALSE
, and most floating-point values are
+ rounded to the nearest integer value. Floating-point colors and
+ normals, however, are returned with a linear mapping that maps 1.0 to
+ the most positive representable integer value
+ and
+ glGetFloatv
is called,
+ boolean values are returned as GL_TRUE
or GL_FALSE
,
+ and integer values are converted to floating-point values.
+
+ The following symbolic constants are accepted by pname
:
+
GL_ACTIVE_TEXTURE
+ params
returns a single value indicating the active multitexture unit.
+ The initial value is GL_TEXTURE0
.
+ See glActiveTexture.
+
GL_ALIASED_LINE_WIDTH_RANGE
+ params
returns two values,
+ the smallest and largest supported widths for aliased lines.
+ The range must include width 1.
+
GL_ALIASED_POINT_SIZE_RANGE
+ params
returns two values,
+ the smallest and largest supported sizes for aliased points.
+ The range must include size 1.
+
GL_ALPHA_BITS
+ params
returns one value,
+ the number of alpha bitplanes in the color buffer of the
+ currently bound framebuffer.
+
GL_ARRAY_BUFFER_BINDING
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_ARRAY_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindBuffer.
+
GL_BLEND
+ params
returns a single boolean value indicating whether blending is
+ enabled. The initial value is GL_FALSE
.
+ See glBlendFunc.
+
GL_BLEND_COLOR
+ params
returns four values,
+ the red, green, blue, and alpha values which are the components of
+ the blend color.
+ See glBlendColor.
+
GL_BLEND_DST_ALPHA
+ params
returns one value,
+ the symbolic constant identifying the alpha destination blend
+ function. The initial value is GL_ZERO
.
+ See glBlendFunc and glBlendFuncSeparate.
+
GL_BLEND_DST_RGB
+ params
returns one value,
+ the symbolic constant identifying the RGB destination blend
+ function. The initial value is GL_ZERO
.
+ See glBlendFunc and glBlendFuncSeparate.
+
GL_BLEND_EQUATION_ALPHA
+ params
returns one value, a symbolic constant indicating whether
+ the Alpha blend equation is GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or
+ GL_FUNC_REVERSE_SUBTRACT
.
+ See glBlendEquationSeparate.
+
GL_BLEND_EQUATION_RGB
+ params
returns one value, a symbolic constant indicating whether
+ the RGB blend equation is GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or
+ GL_FUNC_REVERSE_SUBTRACT
.
+ See glBlendEquationSeparate.
+
GL_BLEND_SRC_ALPHA
+ params
returns one value,
+ the symbolic constant identifying the alpha source blend function. The initial
+ value is GL_ONE
.
+ See glBlendFunc and glBlendFuncSeparate.
+
GL_BLEND_SRC_RGB
+ params
returns one value,
+ the symbolic constant identifying the RGB source blend function. The initial
+ value is GL_ONE
.
+ See glBlendFunc and glBlendFuncSeparate.
+
GL_BLUE_BITS
+ params
returns one value,
+ the number of blue bitplanes in the color buffer of the
+ currently bound framebuffer.
+
GL_COLOR_CLEAR_VALUE
+ params
returns four values:
+ the red, green, blue, and alpha values used to clear the color buffers.
+ Integer values,
+ if requested,
+ are linearly mapped from the internal floating-point representation such
+ that 1.0 returns the most positive representable integer value,
+ and
+
GL_COLOR_WRITEMASK
+ params
returns four boolean values:
+ the red, green, blue, and alpha write enables for the color
+ buffers. The initial value is (GL_TRUE
, GL_TRUE
,
+ GL_TRUE
, GL_TRUE
).
+ See glColorMask.
+
GL_COMPRESSED_TEXTURE_FORMATS
+ params
returns a list of symbolic
+ constants of length GL_NUM_COMPRESSED_TEXTURE_FORMATS
+ indicating which compressed texture formats are available.
+ See glCompressedTexImage2D.
+
GL_CULL_FACE
+ params
returns a single boolean value indicating whether polygon culling
+ is enabled. The initial value is GL_FALSE
.
+ See glCullFace.
+
GL_CULL_FACE_MODE
+ params
returns one value,
+ a symbolic constant indicating which polygon faces are to be
+ culled. The initial value is GL_BACK
.
+ See glCullFace.
+
GL_CURRENT_PROGRAM
+ params
returns one value,
+ the name of the program object that is currently active, or 0 if no program object is active.
+ See glUseProgram.
+
GL_DEPTH_BITS
+ params
returns one value,
+ the number of bitplanes in the depth buffer of the
+ currently bound framebuffer.
+
GL_DEPTH_CLEAR_VALUE
+ params
returns one value,
+ the value that is used to clear the depth buffer.
+ Integer values,
+ if requested,
+ are linearly mapped from the internal floating-point representation such
+ that 1.0 returns the most positive representable integer value,
+ and
+
GL_DEPTH_FUNC
+ params
returns one value,
+ the symbolic constant that indicates the depth comparison
+ function. The initial value is GL_LESS
.
+ See glDepthFunc.
+
GL_DEPTH_RANGE
+ params
returns two values:
+ the near and far mapping limits for the depth buffer.
+ Integer values,
+ if requested,
+ are linearly mapped from the internal floating-point representation such
+ that 1.0 returns the most positive representable integer value,
+ and
+
GL_DEPTH_TEST
+ params
returns a single boolean value indicating whether depth testing
+ of fragments is enabled. The initial value is GL_FALSE
.
+ See glDepthFunc and glDepthRangef.
+
GL_DEPTH_WRITEMASK
+ params
returns a single boolean value indicating if the depth buffer
+ is enabled for writing. The initial value is GL_TRUE
.
+ See glDepthMask.
+
GL_DITHER
+ params
returns a single boolean value indicating whether dithering of
+ fragment colors and indices is enabled. The initial value is GL_TRUE
.
+
GL_ELEMENT_ARRAY_BUFFER_BINDING
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_ELEMENT_ARRAY_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindBuffer.
+
GL_FRAMEBUFFER_BINDING
+ params
returns a single value, the name of the currently bound
+ framebuffer. The initial value is 0, indicating the default framebuffer.
+ See glBindFramebuffer.
+
GL_FRONT_FACE
+ params
returns one value,
+ a symbolic constant indicating whether clockwise or counterclockwise
+ polygon winding is treated as front-facing. The initial value is
+ GL_CCW
.
+ See glFrontFace.
+
GL_GENERATE_MIPMAP_HINT
+ params
returns one value,
+ a symbolic constant indicating the mode of the mipmap generation filtering
+ hint. The initial value is GL_DONT_CARE
.
+ See glHint.
+
GL_GREEN_BITS
+ params
returns one value,
+ the number of green bitplanes in the color buffer of the
+ currently bound framebuffer.
+
GL_IMPLEMENTATION_COLOR_READ_FORMAT
+ params
returns one value, the format
+ chosen by the implementation in which pixels may be read from the
+ color buffer of the currently bound framebuffer in conjunction with
+ GL_IMPLEMENTATION_COLOR_READ_TYPE
.
+ In addition
+ to this implementation-dependent format/type pair, format
+ GL_RGBA
in conjunction with type
+ GL_UNSIGNED_BYTE
is always allowed by every
+ implementation, regardless of the currently bound render surface.
+ See glReadPixels.
+
GL_IMPLEMENTATION_COLOR_READ_TYPE
+ params
returns one value, the type
+ chosen by the implementation with which pixels may be read from the
+ color buffer of the currently bound framebuffer in conjunction with
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT
.
+ In addition
+ to this implementation-dependent format/type pair, format
+ GL_RGBA
in conjunction with type
+ GL_UNSIGNED_BYTE
is always allowed by every
+ implementation, regardless of the currently bound render surface.
+ See glReadPixels.
+
GL_LINE_WIDTH
+ params
returns one value,
+ the line width as specified with glLineWidth. The initial value is
+ 1.
+
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
+ params
returns one value, the maximum supported texture image units that
+ can be used to access texture maps from the vertex shader and the fragment processor combined.
+ If both the vertex shader and the fragment processing stage access the same texture image
+ unit, then that counts as using two texture image units against this limit.
+ The value must be at least 8.
+ See glActiveTexture.
+
GL_MAX_CUBE_MAP_TEXTURE_SIZE
+ params
returns one value.
+ The value gives a rough estimate of the largest cube-map texture that
+ the GL can handle. The value must be at least 16.
+ See glTexImage2D.
+
GL_MAX_FRAGMENT_UNIFORM_VECTORS
+ params
returns one value,
+ the maximum number of four-element floating-point, integer, or boolean vectors that can be held
+ in uniform variable storage for a fragment shader. The value must be at least 16.
+ See glUniform.
+
GL_MAX_RENDERBUFFER_SIZE
+ params
returns one value.
+ The value indicates the largest renderbuffer width and height
+ that the GL can handle. The value must be at least 1.
+ See glRenderbufferStorage.
+
GL_MAX_TEXTURE_IMAGE_UNITS
+ params
returns one value, the maximum supported texture image units that
+ can be used to access texture maps from the fragment shader.
+ The value must be at least 8.
+ See glActiveTexture.
+
GL_MAX_TEXTURE_SIZE
+ params
returns one value.
+ The value gives a rough estimate of the largest texture that
+ the GL can handle. The value must be at least 64.
+ See glTexImage2D.
+
GL_MAX_VARYING_VECTORS
+ params
returns one value,
+ the maximum number four-element floating-point vectors available for interpolating varying variables used by
+ vertex and fragment shaders. Varying variables declared as matrices or arrays
+ will consume multiple interpolators. The value must be at least 8.
+
GL_MAX_VERTEX_ATTRIBS
+ params
returns one value,
+ the maximum number of 4-component generic vertex attributes accessible to a vertex shader.
+ The value must be at least 8.
+ See glVertexAttrib.
+
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
+ params
returns one value, the maximum supported texture image units that
+ can be used to access texture maps from the vertex shader. The value may be 0.
+ See glActiveTexture.
+
GL_MAX_VERTEX_UNIFORM_VECTORS
+ params
returns one value,
+ the maximum number of four-element floating-point, integer, or boolean vectors that can be held
+ in uniform variable storage for a vertex shader. The value must be at least 128.
+ See glUniform.
+
GL_MAX_VIEWPORT_DIMS
+ params
returns two values:
+ the maximum supported width and height of the viewport.
+ These must be at least as large as the visible dimensions of the display
+ being rendered to.
+ See glViewport.
+
GL_NUM_COMPRESSED_TEXTURE_FORMATS
+ params
returns a single integer value indicating the number of available
+ compressed texture formats. The minimum value is 0.
+ See glCompressedTexImage2D.
+
GL_NUM_SHADER_BINARY_FORMATS
+ params
returns a single integer value indicating the number of available
+ shader binary formats. The minimum value is 0.
+ See glShaderBinary.
+
GL_PACK_ALIGNMENT
+ params
returns one value,
+ the byte alignment used for writing pixel data to memory. The initial
+ value is 4.
+ See glPixelStorei.
+
GL_POLYGON_OFFSET_FACTOR
+ params
returns one value,
+ the scaling factor used to determine the variable offset that is added
+ to the depth value of each fragment generated when a polygon is
+ rasterized. The initial value is 0.
+ See glPolygonOffset.
+
GL_POLYGON_OFFSET_FILL
+ params
returns a single boolean value indicating whether polygon offset
+ is enabled for polygons in fill mode. The initial value is GL_FALSE
.
+ See glPolygonOffset.
+
GL_POLYGON_OFFSET_UNITS
+ params
returns one value.
+ This value is multiplied by an implementation-specific value and then
+ added to the depth value of each fragment
+ generated when a polygon is rasterized. The initial value is 0.
+ See glPolygonOffset.
+
GL_RED_BITS
+ params
returns one value,
+ the number of red bitplanes in the color buffer of the
+ currently bound framebuffer.
+
GL_RENDERBUFFER_BINDING
+ params
returns a single value, the name of the currently bound
+ renderbuffer. The initial value is 0, indicating no renderbuffer is bound.
+ See glBindRenderbuffer.
+
GL_SAMPLE_ALPHA_TO_COVERAGE
+ params
returns a single boolean value indicating if the
+ fragment coverage value should be ANDed with a temporary coverage value based
+ on the fragment's alpha value. The initial value is GL_FALSE
.
+ See glSampleCoverage.
+
GL_SAMPLE_BUFFERS
+ params
returns a single integer value indicating the number of sample buffers
+ associated with the currently bound framebuffer.
+ See glSampleCoverage.
+
GL_SAMPLE_COVERAGE
+ params
returns a single boolean value indicating if the
+ fragment coverage value should be ANDed with a temporary coverage value based
+ on the current sample coverage value. The initial value is GL_FALSE
.
+ See glSampleCoverage.
+
GL_SAMPLE_COVERAGE_INVERT
+ params
returns a single boolean value indicating if the temporary
+ coverage value should be inverted.
+ See glSampleCoverage.
+
GL_SAMPLE_COVERAGE_VALUE
+ params
returns a single positive floating-point value indicating the
+ current sample coverage value.
+ See glSampleCoverage.
+
GL_SAMPLES
+ params
returns a single integer value
+ indicating the coverage mask size of the currently bound framebuffer.
+ See glSampleCoverage.
+
GL_SCISSOR_BOX
+ params
returns four values:
+ the
+
GL_SCISSOR_TEST
+ params
returns a single boolean value indicating whether scissoring is
+ enabled. The initial value is GL_FALSE
.
+ See glScissor.
+
GL_SHADER_BINARY_FORMATS
+ params
returns a list of symbolic
+ constants of length GL_NUM_SHADER_BINARY_FORMATS
+ indicating which shader binary formats are available.
+ See glShaderBinary.
+
GL_SHADER_COMPILER
+ params
returns a single boolean value indicating whether a shader compiler
+ is supported. GL_FALSE
indicates that any call to
+ glShaderSource,
+ glCompileShader, or
+ glReleaseShaderCompiler will result in a
+ GL_INVALID_OPERATION
error being generated.
+
GL_STENCIL_BACK_FAIL
+ params
returns one value,
+ a symbolic constant indicating what action is taken for back-facing polygons when the stencil
+ test fails. The initial value is GL_KEEP
.
+ See glStencilOpSeparate.
+
GL_STENCIL_BACK_FUNC
+ params
returns one value,
+ a symbolic constant indicating what function is used for back-facing polygons to compare the
+ stencil reference value with the stencil buffer value. The initial value
+ is GL_ALWAYS
.
+ See glStencilFuncSeparate.
+
GL_STENCIL_BACK_PASS_DEPTH_FAIL
+ params
returns one value,
+ a symbolic constant indicating what action is taken for back-facing polygons when the stencil
+ test passes,
+ but the depth test fails. The initial value is GL_KEEP
.
+ See glStencilOpSeparate.
+
GL_STENCIL_BACK_PASS_DEPTH_PASS
+ params
returns one value,
+ a symbolic constant indicating what action is taken for back-facing polygons when the stencil
+ test passes and the depth test passes. The initial value is GL_KEEP
.
+ See glStencilOpSeparate.
+
GL_STENCIL_BACK_REF
+ params
returns one value,
+ the reference value that is compared with the contents of the stencil
+ buffer for back-facing polygons. The initial value is 0.
+ See glStencilFuncSeparate.
+
GL_STENCIL_BACK_VALUE_MASK
+ params
returns one value,
+ the mask that is used for back-facing polygons to mask both the stencil reference value and the
+ stencil buffer value before they are compared. The initial value is all 1's.
+ See glStencilFuncSeparate.
+
GL_STENCIL_BACK_WRITEMASK
+ params
returns one value,
+ the mask that controls writing of the stencil bitplanes for back-facing polygons. The initial value
+ is all 1's.
+ See glStencilMaskSeparate.
+
GL_STENCIL_BITS
+ params
returns one value,
+ the number of bitplanes in the stencil buffer of the
+ currently bound framebuffer.
+
GL_STENCIL_CLEAR_VALUE
+ params
returns one value,
+ the index to which the stencil bitplanes are cleared. The initial value is
+ 0.
+ See glClearStencil.
+
GL_STENCIL_FAIL
+ params
returns one value,
+ a symbolic constant indicating what action is taken when the stencil
+ test fails for front-facing polygons and non-polygons.
+ The initial value is GL_KEEP
.
+ See glStencilOp and
+ glStencilOpSeparate.
+
GL_STENCIL_FUNC
+ params
returns one value,
+ a symbolic constant indicating what function is used to compare the
+ stencil reference value with the stencil buffer value for front-facing polygons and non-polygons.
+ The initial value is GL_ALWAYS
.
+ See glStencilFunc and
+ glStencilFuncSeparate.
+
GL_STENCIL_PASS_DEPTH_FAIL
+ params
returns one value,
+ a symbolic constant indicating what action is taken when the stencil
+ test passes, but the depth test fails for front-facing polygons and non-polygons.
+ The initial value is GL_KEEP
.
+ See glStencilOp and
+ glStencilOpSeparate.
+
GL_STENCIL_PASS_DEPTH_PASS
+ params
returns one value,
+ a symbolic constant indicating what action is taken when the stencil
+ test passes and the depth test passes for front-facing polygons and non-polygons.
+ The initial value is GL_KEEP
.
+ See glStencilOp and
+ glStencilOpSeparate.
+
GL_STENCIL_REF
+ params
returns one value,
+ the reference value that is compared with the contents of the stencil
+ buffer for front-facing polygons and non-polygons.
+ The initial value is 0.
+ See glStencilFunc and
+ glStencilFuncSeparate.
+
GL_STENCIL_TEST
+ params
returns a single boolean value indicating whether stencil testing
+ of fragments is enabled. The initial value is GL_FALSE
.
+ See glStencilFunc and glStencilOp.
+
GL_STENCIL_VALUE_MASK
+ params
returns one value,
+ the mask that is used to mask both the stencil reference value and the
+ stencil buffer value before they are compared for front-facing polygons and non-polygons.
+ The initial value is all 1's.
+ See glStencilFunc and
+ glStencilFuncSeparate.
+
GL_STENCIL_WRITEMASK
+ params
returns one value,
+ the mask that controls writing of the stencil bitplanes for front-facing polygons and non-polygons.
+ The initial value is all 1's.
+ See glStencilMask and
+ glStencilMaskSeparate.
+
GL_SUBPIXEL_BITS
+ params
returns one value,
+ an estimate of the number of bits of subpixel resolution that are used to
+ position rasterized geometry in window coordinates. The value must be at least 4.
+
GL_TEXTURE_BINDING_2D
+ params
returns a single value, the name of the texture
+ currently bound to the target GL_TEXTURE_2D
for the active multitexture unit. The initial value is 0.
+ See glBindTexture.
+
GL_TEXTURE_BINDING_CUBE_MAP
+ params
returns a single value, the name of the texture
+ currently bound to the target GL_TEXTURE_CUBE_MAP
for the active multitexture unit. The initial value is 0.
+ See glBindTexture.
+
GL_UNPACK_ALIGNMENT
+ params
returns one value,
+ the byte alignment used for reading pixel data from memory. The initial
+ value is 4.
+ See glPixelStorei.
+
GL_VIEWPORT
+ params
returns four values:
+ the
+
+ Many of the boolean parameters can also be queried more easily using + glIsEnabled. +
+ glGetActiveAttrib, + glGetActiveUniform, + glGetAttachedShaders, + glGetAttribLocation, + glGetBufferParameteriv, + glGetError, + glGetFramebufferAttachmentParameteriv, + glGetProgramiv, + glGetProgramInfoLog, + glGetRenderbufferParameteriv, + glGetShaderiv, + glGetShaderInfoLog, + glGetShaderSource, + glGetString, + glGetTexParameter, + glGetUniform, + glGetUniformLocation, + glGetVertexAttrib, + glGetVertexAttribPointerv, + glIsEnabled +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetActiveAttrib — return information about an active attribute variable
void glGetActiveAttrib( | GLuint program, |
GLuint index, | |
GLsizei bufSize, | |
GLsizei *length, | |
GLint *size, | |
GLenum *type, | |
GLchar *name) ; |
program
Specifies the program object to be + queried.
index
Specifies the index of the attribute variable + to be queried.
bufSize
Specifies the maximum number of characters
+ OpenGL is allowed to write in the character buffer
+ indicated by name
.
length
Returns the number of characters actually
+ written by OpenGL in the string indicated by
+ name
(excluding the null
+ terminator) if a value other than
+ NULL
is passed.
size
Returns the size of the attribute + variable.
type
Returns the data type of the attribute + variable.
name
Returns a null terminated string containing + the name of the attribute variable.
glGetActiveAttrib
returns information
+ about an active attribute variable in the program object
+ specified by program
. The number of
+ active attributes can be obtained by calling
+ glGetProgramiv
+ with the value GL_ACTIVE_ATTRIBUTES
. A
+ value of 0 for index
selects the first
+ active attribute variable. Permissible values for
+ index
range from 0 to the number of
+ active attribute variables minus 1.
Attribute variables have arbitrary names and obtain their values
+ through numbered generic vertex attributes. An attribute
+ variable is considered active
+ if it is determined during the link operation that it may be
+ accessed during program execution. Therefore,
+ program
should have previously been the
+ target of a call to
+ glLinkProgram,
+ but it is not necessary for it to have been linked
+ successfully.
The size of the character buffer required to store the
+ longest attribute variable name in
+ program
can be obtained by calling
+ glGetProgramiv
+ with the value
+ GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
. This value
+ should be used to allocate a buffer of sufficient size to store
+ the returned attribute name. The size of this character buffer
+ is passed in bufSize
, and a pointer to
+ this character buffer is passed in
+ name
.
glGetActiveAttrib
returns the name of
+ the attribute variable indicated by
+ index
, storing it in the character buffer
+ specified by name
. The string returned
+ will be null terminated. The actual number of characters written
+ into this buffer is returned in length
,
+ and this count does not include the null termination character.
+ If the length of the returned string is not required, a value of
+ NULL
can be passed in the
+ length
argument.
The type
argument will return a
+ pointer to the attribute variable's data type. The symbolic
+ constants GL_FLOAT
,
+ GL_FLOAT_VEC2
,
+ GL_FLOAT_VEC3
,
+ GL_FLOAT_VEC4
,
+ GL_FLOAT_MAT2
,
+ GL_FLOAT_MAT3
, or
+ GL_FLOAT_MAT4
may be returned. The
+ size
argument will return the size of the
+ attribute, in units of the type returned in
+ type
.
This function will return as much information as it can
+ about the specified active attribute variable. If no information
+ is available, length
will be 0, and
+ name
will be an empty string. This
+ situation could occur if this function is called after a link
+ operation that failed. If an error occurs, the return values
+ length
, size
,
+ type
, and name
+ will be unmodified.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to the
+ number of active attribute variables in
+ program
.
GL_INVALID_VALUE
is generated if
+ bufSize
is less than 0.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
.
glGetProgramiv
+ with argument GL_ACTIVE_ATTRIBUTES
or
+ GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
.
glBindAttribLocation, + glGetActiveUniform, + glLinkProgram, + glVertexAttrib, + glVertexAttribPointer
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetActiveUniform — return information about an active uniform variable
void glGetActiveUniform( | GLuint program, |
GLuint index, | |
GLsizei bufSize, | |
GLsizei *length, | |
GLint *size, | |
GLenum *type, | |
GLchar *name) ; |
program
Specifies the program object to be + queried.
index
Specifies the index of the uniform variable to + be queried.
bufSize
Specifies the maximum number of characters
+ OpenGL is allowed to write in the character buffer
+ indicated by name
.
length
Returns the number of characters actually
+ written by OpenGL in the string indicated by
+ name
(excluding the null
+ terminator) if a value other than
+ NULL
is passed.
size
Returns the size of the uniform + variable.
type
Returns the data type of the uniform + variable.
name
Returns a null terminated string containing + the name of the uniform variable.
glGetActiveUniform
returns
+ information about an active uniform variable in the program
+ object specified by program
. The number
+ of active uniform variables can be obtained by calling
+ glGetProgramiv
+ with the value GL_ACTIVE_UNIFORMS
. A value
+ of 0 for index
selects the first active
+ uniform variable. Permissible values for
+ index
range from 0 to the number of
+ active uniform variables minus 1.
Shaders may use either built-in uniform variables,
+ user-defined uniform variables, or both. Built-in uniform
+ variables have a prefix of "gl_" and reference
+ existing OpenGL state or values derived from such state (e.g.,
+ gl_DepthRange
).
+ User-defined uniform variables have arbitrary names and obtain
+ their values from the application through calls to
+ glUniform.
+ A uniform variable (either built-in or user-defined) is
+ considered active if it is determined during the link operation
+ that it may be accessed during program execution. Therefore,
+ program
should have previously been the
+ target of a call to
+ glLinkProgram,
+ but it is not necessary for it to have been linked
+ successfully.
The size of the character buffer required to store the
+ longest uniform variable name in program
+ can be obtained by calling
+ glGetProgramiv
+ with the value
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
. This value
+ should be used to allocate a buffer of sufficient size to store
+ the returned uniform variable name. The size of this character
+ buffer is passed in bufSize
, and a
+ pointer to this character buffer is passed in
+ name.
glGetActiveUniform
returns the name
+ of the uniform variable indicated by
+ index
, storing it in the character buffer
+ specified by name
. The string returned
+ will be null terminated. The actual number of characters written
+ into this buffer is returned in length
,
+ and this count does not include the null termination character.
+ If the length of the returned string is not required, a value of
+ NULL
can be passed in the
+ length
argument.
The type
+ argument will return a pointer to the uniform variable's data
+ type. The symbolic constants
+ GL_FLOAT
,
+ GL_FLOAT_VEC2
,
+ GL_FLOAT_VEC3
,
+ GL_FLOAT_VEC4
,
+ GL_INT
,
+ GL_INT_VEC2
,
+ GL_INT_VEC3
,
+ GL_INT_VEC4
,
+ GL_BOOL
,
+ GL_BOOL_VEC2
,
+ GL_BOOL_VEC3
,
+ GL_BOOL_VEC4
,
+ GL_FLOAT_MAT2
,
+ GL_FLOAT_MAT3
,
+ GL_FLOAT_MAT4
,
+ GL_SAMPLER_2D
, or
+ GL_SAMPLER_CUBE
+ may be returned.
If one or more elements of an array are active, the name
+ of the array is returned in name
, the
+ type is returned in type
, and the
+ size
parameter returns the highest array
+ element index used, plus one, as determined by the compiler
+ and/or linker. Only one active uniform variable will be reported
+ for a uniform array.
Uniform variables that are declared as structures or + arrays of structures will not be returned directly by this + function. Instead, each of these uniform variables will be + reduced to its fundamental components containing the + "." and "[]" operators such that each of the + names is valid as an argument to + glGetUniformLocation. + Each of these reduced uniform variables is counted as one active + uniform variable and is assigned an index. A valid name cannot + be a structure, an array of structures, or a subcomponent of a + vector or matrix.
The size of the uniform variable will be returned in
+ size
. Uniform variables other than arrays
+ will have a size of 1. Structures and arrays of structures will
+ be reduced as described earlier, such that each of the names
+ returned will be a data type in the earlier list. If this
+ reduction results in an array, the size returned will be as
+ described for uniform arrays; otherwise, the size returned will
+ be 1.
The list of active uniform variables may include both + built-in uniform variables (which begin with the prefix + "gl_") as well as user-defined uniform variable + names.
This function will return as much information as it can
+ about the specified active uniform variable. If no information
+ is available, length
will be 0, and
+ name
will be an empty string. This
+ situation could occur if this function is called after a link
+ operation that failed. If an error occurs, the return values
+ length
, size
,
+ type
, and name
+ will be unmodified.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to the
+ number of active uniform variables in
+ program
.
GL_INVALID_VALUE
is generated if
+ bufSize
is less than 0.
glGet
+ with argument GL_MAX_VERTEX_UNIFORM_VECTORS
+
or
+ GL_MAX_FRAGMENT_UNIFORM_VECTORS
.
glGetProgramiv
+ with argument GL_ACTIVE_UNIFORMS
or
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
.
glGetActiveAttrib, + glGetUniform, + glGetUniformLocation, + glLinkProgram, + glUniform, + glUseProgram
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetAttachedShaders — return the handles of the shader objects attached to a program object
void glGetAttachedShaders( | GLuint program, |
GLsizei maxCount, | |
GLsizei *count, | |
GLuint *shaders) ; |
program
Specifies the program object to be + queried.
maxCount
Specifies the size of the array for storing + the returned object names.
count
Returns the number of names actually returned
+ in shaders
.
shaders
Specifies an array that is used to return the + names of attached shader objects.
glGetAttachedShaders
returns the
+ names of the shader objects attached to
+ program
. The names of shader objects that
+ are attached to program
will be returned
+ in shaders.
The actual number of shader
+ names written into shaders
is returned in
+ count.
If no shader objects are attached
+ to program
, count
+ is set to 0. The maximum number of shader names that may be
+ returned in shaders
is specified by
+ maxCount
.
If the number of names actually returned is not required
+ (for instance, if it has just been obtained by calling
+ glGetProgramiv),
+ a value of NULL
may be passed for count. If
+ no shader objects are attached to
+ program
, a value of 0 will be returned in
+ count
. The actual number of attached
+ shaders can be obtained by calling
+ glGetProgramiv
+ with the value GL_ATTACHED_SHADERS
.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_VALUE
is generated if
+ maxCount
is less than 0.
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetAttribLocation — return the location of an attribute variable
GLint glGetAttribLocation( | GLuint program, |
const GLchar *name) ; |
program
Specifies the program object to be + queried.
name
Points to a null terminated string containing + the name of the attribute variable whose location is + to be queried.
glGetAttribLocation
queries the
+ previously linked program object specified by
+ program
for the attribute variable
+ specified by name
and returns the index
+ of the generic vertex attribute that is bound to that attribute
+ variable. If name
is a matrix attribute
+ variable, the index of the first column of the matrix is
+ returned. If the named attribute variable is not an active
+ attribute in the specified program object or if
+ name
starts with the reserved prefix
+ "gl_", a value of -1 is returned.
The association between an attribute variable name and a
+ generic attribute index can be specified at any time by calling
+ glBindAttribLocation.
+ Attribute bindings do not go into effect until
+ glLinkProgram
+ is called. After a program object has been linked successfully,
+ the index values for attribute variables remain fixed until the
+ next link command occurs. The attribute values can only be
+ queried after a link if the link was successful.
+ glGetAttribLocation
returns the binding
+ that actually went into effect the last time
+ glLinkProgram
+ was called for the specified program object. Attribute bindings
+ that have been specified since the last link operation are not
+ returned by glGetAttribLocation
.
GL_INVALID_OPERATION
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ program
has not been successfully
+ linked.
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetBufferParameteriv — return parameters of a buffer object
void glGetBufferParameteriv( | GLenum target, |
GLenum value, | |
GLint * data) ; |
target
+ Specifies the target buffer object.
+ The symbolic constant must be GL_ARRAY_BUFFER
or
+ GL_ELEMENT_ARRAY_BUFFER
.
+
value
+ Specifies the symbolic name of a buffer object parameter.
+ Accepted values are GL_BUFFER_SIZE
or GL_BUFFER_USAGE
.
+
data
+ Returns the requested parameter. +
+ glGetBufferParameteriv
returns in data
a selected parameter of the buffer object
+ specified by target
.
+
+ value
names a specific buffer object parameter, as follows:
+
GL_BUFFER_SIZE
+ params
returns the size of the buffer object, measured in bytes.
+ The initial value is 0.
+
GL_BUFFER_USAGE
+ params
returns the buffer object's usage pattern. The initial value is
+ GL_STATIC_DRAW
.
+
+ GL_INVALID_ENUM
is generated if target
or value
is not an
+ accepted value.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ Copyright © 2005 Addison-Wesley. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetError — return error information
GLenum glGetError( | void) ; |
+ glGetError
returns the value of the error flag.
+ Each detectable error is assigned a numeric code and symbolic name.
+ When an error occurs,
+ the error flag is set to the appropriate error code value.
+ No other errors are recorded until glGetError
is called,
+ the error code is returned,
+ and the flag is reset to GL_NO_ERROR
.
+ If a call to glGetError
returns GL_NO_ERROR
,
+ there has been no detectable error since the last call to glGetError
,
+ or since the GL was initialized.
+
+ To allow for distributed implementations,
+ there may be several error flags.
+ If any single error flag has recorded an error,
+ the value of that flag is returned
+ and that flag is reset to GL_NO_ERROR
+ when glGetError
is called.
+ If more than one flag has recorded an error,
+ glGetError
returns and clears an arbitrary error flag value.
+ Thus, glGetError
should always be called in a loop,
+ until it returns GL_NO_ERROR
,
+ if all error flags are to be reset.
+
+ Initially, all error flags are set to GL_NO_ERROR
.
+
+ The following errors are currently defined: +
GL_NO_ERROR
+ No error has been recorded. + The value of this symbolic constant is guaranteed to be 0. +
GL_INVALID_ENUM
+ An unacceptable value is specified for an enumerated argument. + The offending command is ignored + and has no other side effect than to set the error flag. +
GL_INVALID_VALUE
+ A numeric argument is out of range. + The offending command is ignored + and has no other side effect than to set the error flag. +
GL_INVALID_OPERATION
+ The specified operation is not allowed in the current state. + The offending command is ignored + and has no other side effect than to set the error flag. +
GL_INVALID_FRAMEBUFFER_OPERATION
+ The command is trying to render to or read from the framebuffer
+ while the currently bound framebuffer is not framebuffer
+ complete (i.e. the return value from
+ glCheckFramebufferStatus
+ is not GL_FRAMEBUFFER_COMPLETE
).
+ The offending command is ignored
+ and has no other side effect than to set the error flag.
+
GL_OUT_OF_MEMORY
+ There is not enough memory left to execute the command. + The state of the GL is undefined, + except for the state of the error flags, + after this error is recorded. +
+ When an error flag is set,
+ results of a GL operation are undefined only if GL_OUT_OF_MEMORY
+ has occurred.
+ In all other cases,
+ the command generating the error is ignored and has no effect on the GL state
+ or frame buffer contents.
+ If the generating command returns a value, it returns 0.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetFramebufferAttachmentParameteriv — return attachment parameters of a framebuffer object
void glGetFramebufferAttachmentParameteriv( | GLenum target, |
GLenum attachment, | |
GLenum pname, | |
GLint * params) ; |
target
+ Specifies the target framebuffer object.
+ The symbolic constant must be GL_FRAMEBUFFER
.
+
attachment
+ Specifies the symbolic name of a framebuffer object attachment point.
+ Accepted values are GL_COLOR_ATTACHMENT0
,
+ GL_DEPTH_ATTACHMENT
, and
+ GL_STENCIL_ATTACHMENT
.
+
pname
+ Specifies the symbolic name of a framebuffer object attachment parameter.
+ Accepted values are GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
,
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
,
+ GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
,
+ and GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
.
+
params
+ Returns the requested parameter. +
+ glGetFramebufferAttachmentParameteriv
+ returns in params
a selected attachment
+ parameter of the attachpoint point attachment
+ of the currently bound framebuffer object.
+
+ pname
names a specific framebuffer object attachment parameter, as follows:
+
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
+ params
returns the type of
+ object which contains the attached image, either
+ GL_RENDERBUFFER
,
+ GL_TEXTURE
, or if no image is
+ attached, GL_NONE
.
+ The initial value is GL_NONE
.
+
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
+ is GL_RENDERBUFFER
,
+ params
returns the name of
+ the renderbuffer object which contains the attached image.
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
+ is GL_TEXTURE
,
+ params
returns the name of
+ the texture object which contains the attached image.
+ The initial value is zero.
+
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
+ is GL_TEXTURE
,
+ params
returns the mipmap level of
+ the texture object which contains the attached image.
+ The initial value is zero.
+
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
+ is GL_TEXTURE
and
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
+ is the name of a cube-map texture,
+ params
returns the cube map
+ face of the cube-map texture object which contains
+ the attached image. If the attached image is from a
+ texture object but not a cube-map, params
+ returns 0.
+ The initial value is GL_TEXTURE_CUBE_MAP_POSITIVE_X
.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_FRAMEBUFFER
.
+
+ GL_INVALID_ENUM
is generated if attachment
is not GL_COLOR_ATTACHMENT0
, GL_DEPTH_ATTACHMENT
, or GL_STENCIL_ATTACHMENT
.
+
+ GL_INVALID_ENUM
is generated if the attached object at the named attachment point is GL_RENDERBUFFER
and pname
is not
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
or GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
.
+
+ GL_INVALID_ENUM
is generated if the attached object at the named attachment point is GL_TEXTURE
and pname
is not
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
,
+ GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
, or GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
.
+
+ GL_INVALID_ENUM
is generated if there is no attached object at the named attachment point and pname
is not
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
.
+
+ GL_INVALID_OPERATION
is generated if the default framebuffer object name 0 is bound.
+
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetProgramInfoLog — return the information log for a program object
void glGetProgramInfoLog( | GLuint program, |
GLsizei maxLength, | |
GLsizei *length, | |
GLchar *infoLog) ; |
program
Specifies the program object whose information + log is to be queried.
maxLength
Specifies the size of the character buffer for + storing the returned information log.
length
Returns the length of the string returned in
+ infoLog
(excluding the null
+ terminator).
infoLog
Specifies an array of characters that is used + to return the information log.
glGetProgramInfoLog
returns the
+ information log for the specified program object. The
+ information log for a program object is modified when the
+ program object is linked or validated. The string that is
+ returned will be null terminated.
glGetProgramInfoLog
returns in
+ infoLog
as much of the information log as
+ it can, up to a maximum of maxLength
+ characters. The number of characters actually returned,
+ excluding the null termination character, is specified by
+ length
. If the length of the returned
+ string is not required, a value of NULL
can
+ be passed in the length
argument. The
+ size of the buffer required to store the returned information
+ log can be obtained by calling
+ glGetProgramiv
+ with the value GL_INFO_LOG_LENGTH
.
The information log for a program object is either an + empty string, or a string containing information about the last + link operation, or a string containing information about the + last validation operation. It may contain diagnostic messages, + warning messages, and other information. When a program object + is created, its information log will be a string of length + 0.
The information log for a program object is the OpenGL + implementer's primary mechanism for conveying information about + linking and validating. Therefore, the information log can be + helpful to application developers during the development + process, even when these operations are successful. Application + developers should not expect different OpenGL implementations to + produce identical information logs.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_VALUE
is generated if
+ maxLength
is less than 0.
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetProgramiv — return a parameter from a program object
void glGetProgramiv( | GLuint program, |
GLenum pname, | |
GLint *params) ; |
program
Specifies the program object to be + queried.
pname
Specifies the object parameter. Accepted
+ symbolic names are
+ GL_DELETE_STATUS
,
+ GL_LINK_STATUS
,
+ GL_VALIDATE_STATUS
,
+ GL_INFO_LOG_LENGTH
,
+ GL_ATTACHED_SHADERS
,
+ GL_ACTIVE_ATTRIBUTES
,
+ GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
,
+ GL_ACTIVE_UNIFORMS
,
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
.
params
Returns the requested object parameter.
glGetProgramiv
+ returns in params
+ the value of a parameter for a specific program object. The following parameters are defined:
GL_DELETE_STATUS
params
returns
+ GL_TRUE
if
+ program
is currently flagged
+ for deletion, and GL_FALSE
+ otherwise.
GL_LINK_STATUS
params
returns
+ GL_TRUE
if the last link
+ operation on program
was
+ successful, and GL_FALSE
+ otherwise.
GL_VALIDATE_STATUS
params
returns
+ GL_TRUE
or if the last
+ validation operation on
+ program
was successful, and
+ GL_FALSE
+ otherwise.
GL_INFO_LOG_LENGTH
params
returns the
+ number of characters in the information log for
+ program
including the null
+ termination character (i.e., the size of the
+ character buffer required to store the information
+ log). If program
has no
+ information log, a value of 0 is
+ returned.
GL_ATTACHED_SHADERS
params
returns the
+ number of shader objects attached to
+ program
.
GL_ACTIVE_ATTRIBUTES
params
returns the
+ number of active attribute variables for
+ program
.
GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
params
returns the
+ length of the longest active attribute name for
+ program
, including the null
+ termination character (i.e., the size of the
+ character buffer required to store the longest
+ attribute name). If no active attributes exist, 0 is
+ returned.
GL_ACTIVE_UNIFORMS
params
returns the
+ number of active uniform variables for
+ program
.
GL_ACTIVE_UNIFORM_MAX_LENGTH
params
returns the
+ length of the longest active uniform variable name
+ for program
, including the
+ null termination character (i.e., the size of the
+ character buffer required to store the longest
+ uniform variable name). If no active uniform
+ variables exist, 0 is returned.
GL_INVALID_ENUM
+ is generated if pname
+ is not an accepted value.
GL_INVALID_VALUE
+ is generated if program
+ is not a value generated by OpenGL.
GL_INVALID_OPERATION
+ is generated if program
+ does not refer to a program object.
glGetActiveAttrib
+ with argument program
glGetActiveUniform
+ with argument program
glGetAttachedShaders
+ with argument program
glGetProgramInfoLog
+ with argument program
glAttachShader, + glCreateProgram, + glDeleteProgram, + glGetShaderiv, + glLinkProgram, + glValidateProgram
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetRenderbufferParameteriv — return parameters of a renderbuffer object
void glGetRenderbufferParameteriv( | GLenum target, |
GLenum pname, | |
GLint * params) ; |
target
+ Specifies the target renderbuffer object.
+ The symbolic constant must be GL_RENDERBUFFER
.
+
pname
+ Specifies the symbolic name of a renderbuffer object parameter.
+ Accepted values are GL_RENDERBUFFER_WIDTH
,
+ GL_RENDERBUFFER_HEIGHT
,
+ GL_RENDERBUFFER_INTERNAL_FORMAT
,
+ GL_RENDERBUFFER_RED_SIZE
,
+ GL_RENDERBUFFER_GREEN_SIZE
,
+ GL_RENDERBUFFER_BLUE_SIZE
,
+ GL_RENDERBUFFER_ALPHA_SIZE
,
+ GL_RENDERBUFFER_DEPTH_SIZE
, or
+ GL_RENDERBUFFER_STENCIL_SIZE
.
+
params
+ Returns the requested parameter. +
+ glGetRenderbufferParameteriv
returns in
+ params
a selected parameter of the
+ currently bound renderbuffer object.
+
+ pname
names a specific renderbuffer object parameter, as follows:
+
GL_RENDERBUFFER_WIDTH
+ params
returns the width in pixels
+ of the image of the currently bound renderbuffer.
+ The initial value is 0.
+
GL_RENDERBUFFER_HEIGHT
+ params
returns the height in pixels
+ of the image of the currently bound renderbuffer.
+ The initial value is 0.
+
GL_RENDERBUFFER_INTERNAL_FORMAT
+ params
returns the internal format
+ of the image of the currently bound renderbuffer.
+ The initial value is GL_RGBA4
.
+
GL_RENDERBUFFER_RED_SIZE
+ params
returns the resolution in bits
+ for the red component of the image of the currently
+ bound renderbuffer.
+ The initial value is 0.
+
GL_RENDERBUFFER_GREEN_SIZE
+ params
returns the resolution in bits
+ for the green component of the image of the currently
+ bound renderbuffer.
+ The initial value is 0.
+
GL_RENDERBUFFER_BLUE_SIZE
+ params
returns the resolution in bits
+ for the blue component of the image of the currently
+ bound renderbuffer.
+ The initial value is 0.
+
GL_RENDERBUFFER_ALPHA_SIZE
+ params
returns the resolution in bits
+ for the alpha component of the image of the currently
+ bound renderbuffer.
+ The initial value is 0.
+
GL_RENDERBUFFER_DEPTH_SIZE
+ params
returns the resolution in bits
+ for the depth component of the image of the currently
+ bound renderbuffer.
+ The initial value is 0.
+
GL_RENDERBUFFER_STENCIL_SIZE
+ params
returns the resolution in bits
+ for the stencil component of the image of the currently
+ bound renderbuffer.
+ The initial value is 0.
+
+ The resolution of components reported by
+ glGetRenderbufferParameteriv
are the actual
+ resolutions at which the components are stored, which may be
+ different than those requested by the internalformat
+ parameter of glRenderbufferStorage.
+
+ If an error is generated,
+ no change is made to the contents of params
.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_RENDERBUFFER
.
+
+ GL_INVALID_ENUM
is generated if pname
is not
+ GL_RENDERBUFFER_WIDTH
,
+ GL_RENDERBUFFER_HEIGHT
,
+ GL_RENDERBUFFER_INTERNAL_FORMAT
,
+ GL_RENDERBUFFER_RED_SIZE
,
+ GL_RENDERBUFFER_GREEN_SIZE
,
+ GL_RENDERBUFFER_BLUE_SIZE
,
+ GL_RENDERBUFFER_ALPHA_SIZE
,
+ GL_RENDERBUFFER_DEPTH_SIZE
, or
+ GL_RENDERBUFFER_STENCIL_SIZE
.
+
+ GL_INVALID_OPERATION
is generated if the reserved renderbuffer object name 0 is bound.
+
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetShaderInfoLog — return the information log for a shader object
void glGetShaderInfoLog( | GLuint shader, |
GLsizei maxLength, | |
GLsizei *length, | |
GLchar *infoLog) ; |
shader
Specifies the shader object whose information + log is to be queried.
maxLength
Specifies the size of the character buffer for + storing the returned information log.
length
Returns the length of the string returned in
+ infoLog
(excluding the null
+ terminator).
infoLog
Specifies an array of characters that is used + to return the information log.
glGetShaderInfoLog
returns the
+ information log for the specified shader object. The information
+ log for a shader object is modified when the shader is compiled.
+ The string that is returned will be null terminated.
glGetShaderInfoLog
returns in
+ infoLog
as much of the information log as
+ it can, up to a maximum of maxLength
+ characters. The number of characters actually returned,
+ excluding the null termination character, is specified by
+ length
. If the length of the returned
+ string is not required, a value of NULL
can
+ be passed in the length
argument. The
+ size of the buffer required to store the returned information
+ log can be obtained by calling
+ glGetShaderiv
+ with the value GL_INFO_LOG_LENGTH
.
The information log for a shader object is a string that + may contain diagnostic messages, warning messages, and other + information about the last compile operation. When a shader + object is created, its information log will be a string of + length 0.
The information log for a shader object is the OpenGL + implementer's primary mechanism for conveying information about + the compilation process. Therefore, the information log can be + helpful to application developers during the development + process, even when compilation is successful. Application + developers should not expect different OpenGL implementations to + produce identical information logs.
GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_VALUE
is generated if
+ maxLength
is less than 0.
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetShaderPrecisionFormat — return the range and precision for different shader numeric formats
void glGetShaderPrecisionFormat( | GLenum shaderType, |
GLenum precisionType, | |
GLint *range, | |
GLint *precision) ; |
shaderType
Specifies the type of shader to query.
+ Must be either GL_VERTEX_SHADER
+ or GL_FRAGMENT_SHADER
.
precisionType
Specifies the numeric format to query, corresponding to a shader precision qualifier and variable type.
+ Must be one of GL_LOW_FLOAT
, GL_MEDIUM_FLOAT
,
+ GL_HIGH_FLOAT
, GL_LOW_INT
,
+ GL_MEDIUM_INT
, or GL_HIGH_INT
.
range
Specifies a pointer to the two-element array in which the
+
precision
Specifies a pointer to the location in which the
+
glGetShaderPrecisionFormat
+ returns range and precision limits for floating-point and integer shader variable formats with low,
+ medium, and high precision qualifiers.
+ When range
as the first and second elements, respectively.
If the smallest representable value greater than 1 is
+ precision
.
+ An integer format will have an ∊ of 1, and thus will return 0.
+ Floating-point formats will return values greater than 0.
The minimum range and precision required for different formats is + described in the OpenGL ES Shading Language Specification.
If a high precision floating-point format is not supported for fragment shaders,
+ calling glGetShaderPrecisionFormat
with arguments GL_FRAGMENT_SHADER
+ and GL_HIGH_FLOAT
will return 0 for both range
and
+ precision
. Support for a high precision floating-point format is mandatory for
+ vertex shaders.
Shader compiler support is optional, and thus must be queried
+ before use by calling glGet
+ with argument GL_SHADER_COMPILER
. glShaderSource,
+ glCompileShader, glGetShaderPrecisionFormat
, and
+ glReleaseShaderCompiler will
+ each generate GL_INVALID_OPERATION
on implementations
+ that do not support a shader compiler. Such implementations instead offer the
+ glShaderBinary
+ alternative for supplying a pre-compiled shader binary.
If an error is generated, no change is made to the
+ contents of range
or precision
.
GL_INVALID_OPERATION
is generated if
+ a shader compiler is not supported.
GL_INVALID_ENUM
is generated if
+ shaderType
or precisionType
is not
+ an accepted value.
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetShaderSource — return the source code string from a shader object
void glGetShaderSource( | GLuint shader, |
GLsizei bufSize, | |
GLsizei *length, | |
GLchar *source) ; |
shader
Specifies the shader object to be + queried.
bufSize
Specifies the size of the character buffer for + storing the returned source code string.
length
Returns the length of the string returned in
+ source
(excluding the null
+ terminator).
source
Specifies an array of characters that is used + to return the source code string.
glGetShaderSource
returns the
+ concatenation of the source code strings from the shader object
+ specified by shader
. The source code
+ strings for a shader object are the result of a previous call to
+ glShaderSource.
+ The string returned by the function will be null
+ terminated.
glGetShaderSource
returns in
+ source
as much of the source code string
+ as it can, up to a maximum of bufSize
+ characters. The number of characters actually returned,
+ excluding the null termination character, is specified by
+ length
. If the length of the returned
+ string is not required, a value of NULL
can
+ be passed in the length
argument. The
+ size of the buffer required to store the returned source code
+ string can be obtained by calling
+ glGetShaderiv
+ with the value
+ GL_SHADER_SOURCE_LENGTH
.
GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_VALUE
is generated if
+ bufSize
is less than 0.
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetShaderiv — return a parameter from a shader object
void glGetShaderiv( | GLuint shader, |
GLenum pname, | |
GLint *params) ; |
shader
Specifies the shader object to be + queried.
pname
Specifies the object parameter. Accepted
+ symbolic names are
+ GL_SHADER_TYPE
,
+ GL_DELETE_STATUS
,
+ GL_COMPILE_STATUS
,
+ GL_INFO_LOG_LENGTH
,
+ GL_SHADER_SOURCE_LENGTH
.
params
Returns the requested object parameter.
glGetShaderiv
+ returns in params
+ the value of a parameter for a specific shader object. The
+ following parameters are defined:
GL_SHADER_TYPE
params
returns
+ GL_VERTEX_SHADER
if
+ shader
is a vertex shader
+ object, and GL_FRAGMENT_SHADER
+ if shader
is a fragment
+ shader object.
GL_DELETE_STATUS
params
returns
+ GL_TRUE
if
+ shader
is currently flagged
+ for deletion, and GL_FALSE
+ otherwise.
GL_COMPILE_STATUS
For implementations that support a shader compiler,
+ params
returns
+ GL_TRUE
if the last compile
+ operation on shader
was
+ successful, and GL_FALSE
+ otherwise.
GL_INFO_LOG_LENGTH
For implementations that support a shader compiler,
+ params
returns the
+ number of characters in the information log for
+ shader
including the null
+ termination character (i.e., the size of the
+ character buffer required to store the information
+ log). If shader
has no
+ information log, a value of 0 is returned.
GL_SHADER_SOURCE_LENGTH
For implementations that support a shader compiler,
+ params
returns the
+ length of the concatenation of the source strings
+ that make up the shader source for the
+ shader
, including the null
+ termination character. (i.e., the size of the
+ character buffer required to store the shader
+ source). If no source code exists, 0 is
+ returned.
Shader compiler support is optional, and thus must be queried
+ before use by calling glGet
+ with argument GL_SHADER_COMPILER
. glShaderSource,
+ glCompileShader,
+ glGetShaderPrecisionFormat, and
+ glReleaseShaderCompiler will
+ each generate GL_INVALID_OPERATION
on implementations
+ that do not support a shader compiler, as will glGetShaderiv
queries of
+ GL_COMPILE_STATUS
, GL_INFO_LOG_LENGTH
, and
+ GL_SHADER_SOURCE_LENGTH
. Such implementations instead offer the
+ glShaderBinary
+ alternative for supplying a pre-compiled shader binary.
If an error is generated, no change is made to the
+ contents of params
.
GL_INVALID_ENUM
is generated if
+ pname
is not an accepted value.
GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ pname
is GL_COMPILE_STATUS
,
+ GL_INFO_LOG_LENGTH
, or GL_SHADER_SOURCE_LENGTH
+ but a shader compiler is not supported.
GL_INVALID_OPERATION
is generated if
+ shader
does not refer to a shader
+ object.
glGet
+ with argument GL_SHADER_COMPILER
glGetShaderInfoLog
+ with argument shader
glGetShaderSource
+ with argument shader
glCompileShader, + glCreateShader, + glDeleteShader, + glGetProgramiv, + glShaderSource, + glShaderBinary
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetString — return a string describing the current GL connection
const GLubyte* glGetString( | GLenum name) ; |
name
+ Specifies a symbolic constant, one of
+ GL_VENDOR
, GL_RENDERER
, GL_VERSION
, GL_SHADING_LANGUAGE_VERSION
, or GL_EXTENSIONS
.
+
+ glGetString
returns a pointer to a static string
+ describing some aspect of the current GL connection.
+ name
can be one of the following:
+
GL_VENDOR
+ Returns the company responsible for this GL implementation. + This name does not change from release to release. +
GL_RENDERER
+ Returns the name of the renderer. + This name is typically specific to a particular configuration of a hardware + platform. + It does not change from release to release. +
GL_VERSION
+ Returns a version or release number of the form
+ OpenGL<space>ES<space><version number><space><vendor-specific information>
.
+
GL_SHADING_LANGUAGE_VERSION
+ Returns a version or release number for the shading language of the form
+ OpenGL<space>ES<space>GLSL<space>ES<space><version number><space><vendor-specific information>
.
+
GL_EXTENSIONS
+ Returns a space-separated list of supported extensions to GL. +
+ Because the GL does not include queries for the performance
+ characteristics of an implementation, some applications are written to
+ recognize known platforms and modify their GL usage based on known
+ performance characteristics of these platforms.
+ Strings GL_VENDOR
and GL_RENDERER
together uniquely specify
+ a platform. They do not change from release to release and should be used
+ by platform-recognition algorithms.
+
+ Some applications want to make use of features that
+ are not part of the standard GL. These features
+ may be implemented as extensions to the standard GL.
+ The GL_EXTENSIONS
string is a space-separated
+ list of supported GL extensions.
+ (Extension names never contain a space character.)
+
+ All strings are null-terminated. +
+ If an error is generated, glGetString
returns 0.
+
+ The client and server may support different versions or extensions.
+ glGetString
always returns a compatible version number or list of extensions.
+ The release number always describes the server.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetTexParameter — return texture parameter values
void glGetTexParameterfv( | GLenum target, |
GLenum pname, | |
GLfloat * params) ; |
void glGetTexParameteriv( | GLenum target, |
GLenum pname, | |
GLint * params) ; |
target
+ Specifies the symbolic name of the target texture of the active texture unit.
+ GL_TEXTURE_2D
and
+ GL_TEXTURE_CUBE_MAP
+ are accepted.
+
pname
+ Specifies the symbolic name of a texture parameter.
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_WRAP_S
, and
+ GL_TEXTURE_WRAP_T
+ are accepted.
+
params
+ Returns the texture parameter. +
+ glGetTexParameter
returns in params
the
+ value of the texture parameter
+ specified as pname
.
+ target
defines the target texture of the active texture unit,
+ either GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
,
+ to specify two-dimensional or cube-mapped texturing.
+ pname
accepts the same symbols as glTexParameter,
+ with the same interpretations:
+
GL_TEXTURE_MAG_FILTER
+ Returns the single-valued texture magnification filter,
+ a symbolic constant. The initial value is GL_LINEAR
.
+
GL_TEXTURE_MIN_FILTER
+ Returns the single-valued texture minification filter,
+ a symbolic constant. The initial value is GL_NEAREST_MIPMAP_LINEAR
.
+
GL_TEXTURE_WRAP_S
+ Returns the single-valued wrapping function for texture coordinate
+ GL_REPEAT
.
+
GL_TEXTURE_WRAP_T
+ Returns the single-valued wrapping function for texture coordinate
+ GL_REPEAT
.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glGetUniform — return the value of a uniform variable
void glGetUniformfv( | GLuint program, |
GLint location, | |
GLfloat *params) ; |
void glGetUniformiv( | GLuint program, |
GLint location, | |
GLint *params) ; |
program
Specifies the program object to be + queried.
location
Specifies the location of the uniform variable + to be queried.
params
Returns the value of the specified uniform + variable.
glGetUniform
returns in
+ params
the value(s) of the specified
+ uniform variable. The type of the uniform variable specified by
+ location
determines the number of values
+ returned. If the uniform variable is defined in the shader as a
+ boolean, int, or float, a single value will be returned. If it
+ is defined as a vec2, ivec2, or bvec2, two values will be
+ returned. If it is defined as a vec3, ivec3, or bvec3, three
+ values will be returned, and so on. To query values stored in
+ uniform variables declared as arrays, call
+ glGetUniform
for each element of the array.
+ To query values stored in uniform variables declared as
+ structures, call glGetUniform
for each
+ field in the structure. The values for uniform variables
+ declared as a matrix will be returned in column major
+ order.
The locations assigned to uniform variables are not known
+ until the program object is linked. After linking has occurred,
+ the command
+ glGetUniformLocation
+ can be used to obtain the location of a uniform variable. This
+ location value can then be passed to
+ glGetUniform
in order to query the current
+ value of the uniform variable. After a program object has been
+ linked successfully, the index values for uniform variables
+ remain fixed until the next link command occurs. The uniform
+ variable values can only be queried after a link if the link was
+ successful.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ program
has not been successfully
+ linked.
GL_INVALID_OPERATION
is generated if
+ location
does not correspond to a valid
+ uniform variable location for the specified program object.
glGetActiveUniform
+ with arguments program
and the index of an active
+ uniform variable
glGetProgramiv
+ with arguments program
and
+ GL_ACTIVE_UNIFORMS
or
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
glGetUniformLocation
+ with arguments program
and the name of a
+ uniform variable
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetUniformLocation — return the location of a uniform variable
GLint glGetUniformLocation( | GLuint program, |
const GLchar *name) ; |
program
Specifies the program object to be + queried.
name
Points to a null terminated string containing + the name of the uniform variable whose location is + to be queried.
glGetUniformLocation
returns an
+ integer that represents the location of a specific uniform
+ variable within a program object. name
+ must be a null terminated string that contains no white space.
+ name
must be an active uniform variable
+ name in program
that is not a structure,
+ an array of structures, or a subcomponent of a vector or a
+ matrix. This function returns -1 if name
+ does not correspond to an active uniform variable in
+ program
or if name
+ starts with the reserved prefix "gl_".
Uniform variables that are structures or arrays of
+ structures may be queried by calling
+ glGetUniformLocation
for each field within
+ the structure. The array element operator "[]" and the
+ structure field operator "." may be used in
+ name
in order to select elements within
+ an array or fields within a structure. The result of using these
+ operators is not allowed to be another structure, an array of
+ structures, or a subcomponent of a vector or a matrix. Except if
+ the last part of name
indicates a uniform
+ variable array, the location of the first element of an array
+ can be retrieved by using the name of the array, or by using the
+ name appended by "[0]".
The actual locations assigned to uniform variables are not
+ known until the program object is linked successfully. After
+ linking has occurred, the command
+ glGetUniformLocation
can be used to obtain
+ the location of a uniform variable. This location value can then
+ be passed to
+ glUniform
+ to set the value of the uniform variable or to
+ glGetUniform
+ in order to query the current value of the uniform variable.
+ After a program object has been linked successfully, the index
+ values for uniform variables remain fixed until the next link
+ command occurs. Uniform variable locations and values can only
+ be queried after a link if the link was successful.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ program
has not been successfully
+ linked.
glGetActiveUniform
+ with arguments program
and the index of
+ an active uniform variable
glGetProgramiv
+ with arguments program
and
+ GL_ACTIVE_UNIFORMS
or
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
glGetUniform
+ with arguments program
and the name of a
+ uniform variable
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetVertexAttrib — return a generic vertex attribute parameter
void glGetVertexAttribfv( | GLuint index, |
GLenum pname, | |
GLfloat *params) ; |
void glGetVertexAttribiv( | GLuint index, |
GLenum pname, | |
GLint *params) ; |
index
Specifies the generic vertex attribute + parameter to be queried.
pname
Specifies the symbolic name of the vertex
+ attribute parameter to be queried. Accepted values are
+ GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
,
+ GL_VERTEX_ATTRIB_ARRAY_ENABLED
,
+ GL_VERTEX_ATTRIB_ARRAY_SIZE
,
+ GL_VERTEX_ATTRIB_ARRAY_STRIDE
,
+ GL_VERTEX_ATTRIB_ARRAY_TYPE
,
+ GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
, or
+ GL_CURRENT_VERTEX_ATTRIB
.
params
Returns the requested data.
glGetVertexAttrib
returns in
+ params
the value of a generic vertex
+ attribute parameter. The generic vertex attribute to be queried
+ is specified by index
, and the parameter
+ to be queried is specified by pname
.
The accepted parameter names are as follows:
GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
params
returns a
+ single value, the name of the buffer object currently bound to
+ the binding point corresponding to generic vertex attribute array
+ index
. If no buffer object is bound,
+ 0 is returned. The initial value is 0.
GL_VERTEX_ATTRIB_ARRAY_ENABLED
params
returns a
+ single value that is non-zero (true) if the vertex
+ attribute array for index
is
+ enabled and 0 (false) if it is disabled. The initial
+ value is GL_FALSE
.
GL_VERTEX_ATTRIB_ARRAY_SIZE
params
returns a
+ single value, the size of the vertex attribute array
+ for index
. The size is the
+ number of values for each element of the vertex
+ attribute array, and it will be 1, 2, 3, or 4. The
+ initial value is 4.
GL_VERTEX_ATTRIB_ARRAY_STRIDE
params
returns a
+ single value, the array stride for (number of bytes
+ between successive elements in) the vertex attribute
+ array for index
. A value of 0
+ indicates that the array elements are stored
+ sequentially in memory. The initial value is 0.
GL_VERTEX_ATTRIB_ARRAY_TYPE
params
returns a
+ single value, a symbolic constant indicating the
+ array type for the vertex attribute array for
+ index
. Possible values are
+ GL_BYTE
,
+ GL_UNSIGNED_BYTE
,
+ GL_SHORT
,
+ GL_UNSIGNED_SHORT
,
+ GL_FIXED
, and
+ GL_FLOAT
. The initial value is
+ GL_FLOAT
.
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
params
returns a
+ single value that is non-zero (true) if fixed-point
+ data types for the vertex attribute array indicated
+ by index
are normalized when
+ they are converted to floating point, and 0 (false)
+ otherwise. The initial value is
+ GL_FALSE
.
GL_CURRENT_VERTEX_ATTRIB
params
returns four
+ values that represent the current value for the
+ generic vertex attribute specified by index.
+ The initial value is (0,0,0,1).
All of the parameters except GL_CURRENT_VERTEX_ATTRIB
+ represent client-side state.
GL_INVALID_ENUM
is generated if
+ pname
is not an accepted value.
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to
+ GL_MAX_VERTEX_ATTRIBS
.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttribPointerv
+ with arguments index
and
+ GL_VERTEX_ATTRIB_ARRAY_POINTER
glBindAttribLocation, + glBindBuffer, + glDisableVertexAttribArray, + glEnableVertexAttribArray, + glVertexAttrib, + glVertexAttribPointer
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glGetVertexAttribPointerv — return the address of the specified generic vertex attribute pointer
void glGetVertexAttribPointerv( | GLuint index, |
GLenum pname, | |
GLvoid **pointer) ; |
index
Specifies the generic vertex attribute + parameter to be returned.
pname
Specifies the symbolic name of the generic
+ vertex attribute parameter to be returned. Must be
+ GL_VERTEX_ATTRIB_ARRAY_POINTER
.
pointer
Returns the pointer value.
glGetVertexAttribPointerv
returns
+ pointer information. index
is the generic
+ vertex attribute to be queried, pname
is
+ a symbolic constant indicating the pointer to be returned, and
+ params
is a pointer to a location in
+ which to place the returned data.
If a non-zero named buffer object was bound to the GL_ARRAY_BUFFER
target
+ (see glBindBuffer) when the desired pointer was previously
+ specified, the pointer
returned is a byte offset into the buffer object's data store.
+
GL_INVALID_ENUM
+ is generated if pname
+ is not an accepted value.
GL_INVALID_VALUE
+ is generated if index
+ is greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glHint — specify implementation-specific hints
void glHint( | GLenum target, |
GLenum mode) ; |
target
+ Specifies a symbolic constant indicating the behavior to be controlled.
+ GL_GENERATE_MIPMAP_HINT
is accepted.
+
mode
+ Specifies a symbolic constant indicating the desired behavior.
+ GL_FASTEST
,
+ GL_NICEST
, and
+ GL_DONT_CARE
are accepted.
+
+ Certain aspects of GL behavior,
+ when there is room for interpretation,
+ can be controlled with hints.
+ A hint is specified with two arguments.
+ target
is a symbolic
+ constant indicating the behavior to be controlled,
+ and mode
is another symbolic constant indicating the desired
+ behavior. The initial value for each target
is GL_DONT_CARE
.
+ mode
can be one of the following:
+
GL_FASTEST
+ The most efficient option should be chosen. +
GL_NICEST
+ The most correct, + or highest quality, + option should be chosen. +
GL_DONT_CARE
+ No preference. +
+ Though the implementation aspects that can be hinted are well defined,
+ the interpretation of the hints depends on the implementation.
+ The hint aspects that can be specified with target
,
+ along with suggested semantics,
+ are as follows:
+
GL_GENERATE_MIPMAP_HINT
+ Indicates the quality of filtering when generating mipmap images with + glGenerateMipmap. +
+ The interpretation of hints depends on the implementation.
+ Some implementations ignore glHint
settings.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glIsBuffer — determine if a name corresponds to a buffer object
GLboolean glIsBuffer( | GLuint buffer) ; |
+ glIsBuffer
returns GL_TRUE
if buffer
is currently the name of a buffer object.
+ If buffer
is zero, or is a non-zero value that is not currently the
+ name of a buffer object, or if an error occurs, glIsBuffer
returns GL_FALSE
.
+
+ A name returned by glGenBuffers, but not yet associated with a buffer object + by calling glBindBuffer, is not the name of a buffer object. +
+ Copyright © 2005 Addison-Wesley. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glIsEnabled — test whether a capability is enabled
GLboolean glIsEnabled( | GLenum cap) ; |
+ glIsEnabled
returns GL_TRUE
if cap
is an enabled capability
+ and returns GL_FALSE
otherwise.
+ Initially all capabilities except GL_DITHER
are disabled;
+ GL_DITHER
is initially enabled.
+
+ The following capabilities are accepted for cap
:
+
+
+ Constant + | + See + |
---|---|
+ GL_BLEND
+ | + glBlendFunc + |
+ GL_CULL_FACE
+ | + glCullFace + |
+ GL_DEPTH_TEST
+ | + glDepthFunc, glDepthRangef + |
+ GL_DITHER
+ | + glEnable + |
+ GL_POLYGON_OFFSET_FILL
+ | + glPolygonOffset + |
+ GL_SAMPLE_ALPHA_TO_COVERAGE
+ | + glSampleCoverage + |
+ GL_SAMPLE_COVERAGE
+ | + glSampleCoverage + |
+ GL_SCISSOR_TEST
+ | + glScissor + |
+ GL_STENCIL_TEST
+ | + glStencilFunc, glStencilOp + |
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glIsFramebuffer — determine if a name corresponds to a framebuffer object
GLboolean glIsFramebuffer( | GLuint framebuffer) ; |
+ glIsFramebuffer
returns GL_TRUE
if framebuffer
is currently the name of a framebuffer object.
+ If framebuffer
is zero, or is a non-zero value that is not currently the
+ name of a framebuffer object, or if an error occurs, glIsFramebuffer
returns GL_FALSE
.
+
+ A name returned by glGenFramebuffers, but not yet associated with a framebuffer object + by calling glBindFramebuffer, is not the name of a framebuffer object. +
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glIsProgram — determine if a name corresponds to a program object
GLboolean glIsProgram( | GLuint program) ; |
glIsProgram
returns
+ GL_TRUE
if program
+ is the name of a program object previously created with
+ glCreateProgram
+ and not yet deleted with glDeleteProgram.
+ If program
is zero or a non-zero value that
+ is not the name of a program object, or if an error occurs,
+ glIsProgram
returns GL_FALSE
.
No error is generated if program
is
+ not a valid program object name.
A program object marked for deletion with glDeleteProgram
+ but still in use as part of current rendering state is still considered
+ a program object and glIsProgram
will return GL_TRUE
.
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glIsRenderbuffer — determine if a name corresponds to a renderbuffer object
GLboolean glIsRenderbuffer( | GLuint renderbuffer) ; |
+ glIsRenderbuffer
returns GL_TRUE
if renderbuffer
is currently the name of a renderbuffer object.
+ If renderbuffer
is zero, or is a non-zero value that is not currently the
+ name of a renderbuffer object, or if an error occurs, glIsRenderbuffer
returns GL_FALSE
.
+
+ A name returned by glGenRenderbuffers, but not yet associated with a renderbuffer object + by calling glBindRenderbuffer, is not the name of a renderbuffer object. +
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glIsShader — determine if a name corresponds to a shader object
GLboolean glIsShader( | GLuint shader) ; |
glIsShader
returns
+ GL_TRUE
if shader
is
+ the name of a shader object previously created with
+ glCreateShader
+ and not yet deleted with glDeleteShader.
+ If shader
is
+ zero or a non-zero value that is not the name of a shader
+ object, or if an error occurs, glIsShader
returns
+ GL_FALSE
.
No error is generated if shader
is
+ not a valid shader object name.
A shader object marked for deletion with glDeleteShader
+ but still attached to a program object is still considered
+ a shader object and glIsShader
will return GL_TRUE
.
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glIsTexture — determine if a name corresponds to a texture
GLboolean glIsTexture( | GLuint texture) ; |
+ glIsTexture
returns GL_TRUE
if texture
is currently the name of a texture.
+ If texture
is zero, or is a non-zero value that is not currently the
+ name of a texture, or if an error occurs, glIsTexture
returns GL_FALSE
.
+
+ A name returned by glGenTextures, but not yet associated with a texture + by calling glBindTexture, is not the name of a texture. +
+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glGenTextures, + glGet, + glGetTexParameter, + glTexImage2D, + glTexParameter +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glLineWidth — specify the width of rasterized lines
void glLineWidth( | GLfloat width) ; |
+ glLineWidth
specifies the rasterized width of
+ lines.
+
+ The actual width is determined by rounding the supplied width
+ to the nearest integer.
+ (If the rounding results in the value 0,
+ it is as if the line width were 1.)
+ If
+ width
.
+ Otherwise,
+ i pixels are filled in each row that is rasterized.
+
+ There is a range of supported line widths. Only width 1 is guaranteed to be supported; others depend on the
+ implementation.
+ To query the range of supported widths, call glGet
+ with argument GL_ALIASED_LINE_WIDTH_RANGE
.
+
+ The line width specified by glLineWidth
is always returned when GL_LINE_WIDTH
+ is queried.
+ Clamping and rounding have no effect on the specified value.
+
+ Line width may be clamped to an implementation-dependent maximum. Call glGet with GL_ALIASED_LINE_WIDTH_RANGE
to determine the maximum width.
+
+ glGet with argument GL_LINE_WIDTH
+
+ glGet with argument GL_ALIASED_LINE_WIDTH_RANGE
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glLinkProgram — link a program object
void glLinkProgram( | GLuint program) ; |
glLinkProgram
links the program
+ object specified by program
. A shader object
+ of type GL_VERTEX_SHADER
attached to
+ program
is used to
+ create an executable that will run on the programmable vertex
+ processor. A shader object of type GL_FRAGMENT_SHADER
+ attached to program
is used to create an
+ executable that will run on the programmable fragment
+ processor.
The status of the link operation will be stored as part of
+ the program object's state. This value will be set to
+ GL_TRUE
if the program object was linked
+ without errors and is ready for use, and
+ GL_FALSE
otherwise. It can be queried by
+ calling
+ glGetProgramiv
+ with arguments program
and
+ GL_LINK_STATUS
.
As a result of a successful link operation, all active
+ user-defined uniform variables belonging to
+ program
will be initialized to 0, and
+ each of the program object's active uniform variables will be
+ assigned a location that can be queried by calling
+ glGetUniformLocation.
+ Also, any active user-defined attribute variables that have not
+ been bound to a generic vertex attribute index will be bound to
+ one at this time.
Linking of a program object can fail for a number of + reasons as specified in the OpenGL ES Shading Language + Specification. The following lists some of the + conditions that will cause a link error.
A vertex shader and a fragment shader are not both + present in the program object.
The number of active attribute variables supported + by the implementation has been exceeded.
The storage limit for uniform variables has been + exceeded.
The number of active uniform variables supported + by the implementation has been exceeded.
The main
function is missing
+ for the vertex shader or the fragment shader.
A varying variable actually used in the fragment + shader is not declared in the same way (or is not + declared at all) in the vertex shader.
A reference to a function or variable name is + unresolved.
A shared global is declared with two different + types or two different initial values.
One or more of the attached shader objects has not + been successfully compiled (via glCompileShader) + or loaded with a pre-compiled shader binary (via glShaderBinary).
Binding a generic attribute matrix caused some
+ rows of the matrix to fall outside the allowed maximum
+ of GL_MAX_VERTEX_ATTRIBS
.
Not enough contiguous vertex attribute slots could + be found to bind attribute matrices.
When a program object has been successfully linked, the + program object can be made part of current state by calling + glUseProgram. + Whether or not the link operation was successful, the program + object's information log will be overwritten. The information + log can be retrieved by calling + glGetProgramInfoLog.
glLinkProgram
will also install the
+ generated executables as part of the current rendering state if
+ the link operation was successful and the specified program
+ object is already currently in use as a result of a previous
+ call to
+ glUseProgram.
+ If the program object currently in use is relinked
+ unsuccessfully, its link status will be set to
+ GL_FALSE
, but the executables and
+ associated state will remain part of the current state until a
+ subsequent call to glUseProgram
removes it
+ from use. After it is removed from use, it cannot be made part
+ of current state until it has been successfully relinked.
The program object's information log is updated and the + program is generated at the time of the link operation. After + the link operation, applications are free to modify attached + shader objects, compile attached shader objects, detach shader + objects, delete shader objects, and attach additional shader + objects. None of these operations affects the information log or + the program that is part of the program object.
If the link operation is unsuccessful, any information about a previous link operation on program
+ is lost (i.e., a failed link does not restore the old state of program
).
+ Certain information can still be retrieved from program
+ even after an unsuccessful link operation. See for instance glGetActiveAttrib
+ and glGetActiveUniform.
GL_INVALID_VALUE
+ is generated if program
+ is not a value generated by OpenGL.
GL_INVALID_OPERATION
+ is generated if program
+ is not a program object.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib
+ with argument program
+ and the index of an active attribute variable
glGetActiveUniform
+ with argument program
+ and the index of an active uniform variable
glGetAttachedShaders
+ with argument program
glGetAttribLocation
+ with argument program
+ and an attribute variable name
glGetProgramiv
+ with arguments program
+ and GL_LINK_STATUS
glGetProgramInfoLog
+ with argument program
glGetUniform
+ with argument program
+ and a uniform variable location
glGetUniformLocation
+ with argument program
+ and a uniform variable name
glAttachShader, + glBindAttribLocation, + glCompileShader, + glShaderBinary, + glCreateProgram, + glDeleteProgram, + glDetachShader, + glUniform, + glUseProgram, + glValidateProgram
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glPixelStorei — set pixel storage modes
void glPixelStorei( | GLenum pname, |
GLint param) ; |
pname
+ Specifies the symbolic name of the parameter to be set.
+ One value affects the packing of pixel data into memory:
+ GL_PACK_ALIGNMENT
.
+ The other affects the unpacking of pixel data from memory:
+ GL_UNPACK_ALIGNMENT
.
+
param
+ Specifies the value that pname
is set to.
+
+ glPixelStorei
sets pixel storage modes that affect the operation of subsequent
+ glReadPixels as well as the unpacking of
+ texture patterns (see glTexImage2D and
+ glTexSubImage2D).
+
+ pname
is a symbolic constant indicating the parameter to be set, and
+ param
is the new value. One storage parameter affects
+ how pixel data is returned to client memory:
+
GL_PACK_ALIGNMENT
+ Specifies the alignment requirements for the start of each pixel row in memory. + The allowable values are + 1 (byte-alignment), + 2 (rows aligned to even-numbered bytes), + 4 (word-alignment), and + 8 (rows start on double-word boundaries). +
+ The other storage parameter affects how pixel data is + read from client memory: +
GL_UNPACK_ALIGNMENT
+ Specifies the alignment requirements for the start of each pixel row in memory. + The allowable values are + 1 (byte-alignment), + 2 (rows aligned to even-numbered bytes), + 4 (word-alignment), and + 8 (rows start on double-word boundaries). +
+ The following table gives the type,
+ initial value,
+ and range of valid values for each storage parameter
+ that can be set with glPixelStorei
.
+
+
+ pname
+ | + Type + | + Initial Value + | + Valid Range + |
---|---|---|---|
+ GL_PACK_ALIGNMENT
+ | + integer + | + 4 + | + 1, 2, 4, or 8 + |
+ GL_UNPACK_ALIGNMENT
+ | + integer + | + 4 + | + 1, 2, 4, or 8 + |
+ Boolean parameters are set to false if param
is 0 and true otherwise.
+
+ GL_INVALID_ENUM
is generated if pname
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated if alignment is specified as other than 1, 2, 4, or 8.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glPolygonOffset — set the scale and units used to calculate depth values
void glPolygonOffset( | GLfloat factor, |
GLfloat units) ; |
factor
+ Specifies a scale factor that is used to create a variable + depth offset for each polygon. The initial value is 0. +
units
+ Is multiplied by an implementation-specific value to + create a constant depth offset. The initial value is 0. +
+ When GL_POLYGON_OFFSET_FILL
is enabled, each
+ fragment's depth value will be offset after it is interpolated
+ from the depth values of the appropriate vertices.
+ The value of the offset is
+
+ glPolygonOffset
is useful for rendering hidden-line images, for applying decals
+ to surfaces, and for rendering solids with highlighted edges.
+
+ glIsEnabled with argument
+ GL_POLYGON_OFFSET_FILL
.
+
+ glGet with argument GL_POLYGON_OFFSET_FACTOR
or
+ GL_POLYGON_OFFSET_UNITS
.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glReadPixels — read a block of pixels from the frame buffer
void glReadPixels( | GLint x, |
GLint y, | |
GLsizei width, | |
GLsizei height, | |
GLenum format, | |
GLenum type, | |
GLvoid * data) ; |
x
, y
+ Specify the window coordinates of the first pixel + that is read from the frame buffer. + This location is the lower left corner of a rectangular block of pixels. +
width
, height
+ Specify the dimensions of the pixel rectangle.
+ width
and height
of one correspond to a single pixel.
+
format
+ Specifies the format of the pixel data.
+ The following symbolic values are accepted:
+ GL_ALPHA
,
+ GL_RGB
, and
+ GL_RGBA
.
+
type
+ Specifies the data type of the pixel data.
+ Must be one of
+ GL_UNSIGNED_BYTE
,
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
, or
+ GL_UNSIGNED_SHORT_5_5_5_1
.
+
data
+ Returns the pixel data. +
+ glReadPixels
returns pixel data from the frame buffer,
+ starting with the pixel whose lower left corner
+ is at location (x
, y
),
+ into client memory starting at location data
.
+ The GL_PACK_ALIGNMENT
parameter, set with the
+ glPixelStorei
+ command, affects the processing of the pixel data before it is placed into
+ client memory.
+
+ glReadPixels
returns values from each pixel with lower left corner at
+
+ format
specifies the format for the returned pixel values;
+ accepted values are:
+
GL_ALPHA
GL_RGB
GL_RGBA
+ RGBA color components are read from the color buffer. + Each color component is converted to floating point such that zero intensity + maps to 0.0 and full intensity maps to 1.0. +
+ Unneeded data is then discarded.
+ For example,
+ GL_ALPHA
discards the red, green, and blue components,
+ while GL_RGB
discards only the alpha component.
+ The final values are clamped to the range
+
+ Finally, the components
+ are converted to the proper format,
+ as specified by type
.
+ When type
is GL_UNSIGNED_BYTE
,
+ each component is multiplied by
+ type
is GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
, or GL_UNSIGNED_SHORT_5_5_5_1
,
+ each component is multiplied by
+
+ Return values are placed in memory as follows.
+ If format
is
+ GL_ALPHA
,
+ a single value is returned and the data for the
+ GL_RGB
returns three values and
+ GL_RGBA
returns four values for each pixel,
+ with all values corresponding to a single pixel occupying contiguous space
+ in data
.
+ Storage parameter GL_PACK_ALIGNMENT
, set by
+ glPixelStorei,
+ affects the way that data is written into memory.
+ See glPixelStorei for a description.
+
+ If the currently bound framebuffer is not the default framebuffer object, color
+ components are read from the color image attached to the
+ GL_COLOR_ATTACHMENT0
attachment point.
+
+ Only two format
/type
parameter pairs are
+ accepted. GL_RGBA
/GL_UNSIGNED_BYTE
is
+ always accepted, and the other acceptable pair can be discovered by querying
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT
and
+ GL_IMPLEMENTATION_COLOR_READ_TYPE
.
+
+ Values for pixels that lie outside the window + connected to the current GL context are undefined. +
+ If an error is generated,
+ no change is made to the contents of data
.
+
+ GL_INVALID_ENUM
is generated if format
or type
is not an
+ accepted value.
+
+ GL_INVALID_VALUE
is generated if either width
or height
is negative.
+
+ GL_INVALID_OPERATION
is generated if type
is
+ GL_UNSIGNED_SHORT_5_6_5
+ and format
is not GL_RGB
.
+
+ GL_INVALID_OPERATION
is generated if type
is
+ GL_UNSIGNED_SHORT_4_4_4_4
or
+ GL_UNSIGNED_SHORT_5_5_5_1
+ and format
is not GL_RGBA
.
+
+ GL_INVALID_OPERATION
is generated if format
+ and type
are neither GL_RGBA
and
+ GL_UNSIGNED_BYTE
, respectively, nor the format/type pair
+ returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT
+ and GL_IMPLEMENTATION_COLOR_READ_TYPE
.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if
+ the currently bound framebuffer is not framebuffer complete (i.e. the
+ return value from glCheckFramebufferStatus
+ is not GL_FRAMEBUFFER_COMPLETE
).
+
+ glGet with argument
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT
+ or GL_IMPLEMENTATION_COLOR_READ_TYPE
+
+ glGet with argument GL_PACK_ALIGNMENT
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glReleaseShaderCompiler — release resources allocated by the shader compiler
void glReleaseShaderCompiler( | void) ; |
For implementations that support a shader compiler,
+ glReleaseShaderCompiler
+ frees resources allocated by the shader compiler. This is a hint from the application
+ that additional shader compilations are unlikely to occur, at least for some period of time,
+ and that the resources consumed by the shader compiler may be released and put to better use
+ elsewhere.
However, if a call to glCompileShader
+ is made after a call to glReleaseShaderCompiler
, the shader compiler must be restored
+ to service the compilation request as if glReleaseShaderCompiler
had never been called.
Shader compiler support is optional, and thus must be queried
+ before use by calling glGet
+ with argument GL_SHADER_COMPILER
. glShaderSource,
+ glCompileShader,
+ glGetShaderPrecisionFormat, and
+ glReleaseShaderCompiler
will
+ each generate GL_INVALID_OPERATION
on implementations
+ that do not support a shader compiler. Such implementations instead offer the
+ glShaderBinary
+ alternative for supplying a pre-compiled shader binary.
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glRenderbufferStorage — create and initialize a renderbuffer object's data store
void glRenderbufferStorage( | GLenum target, |
GLenum internalformat, | |
GLsizei width, | |
GLsizei height) ; |
target
Specifies the renderbuffer target. The symbolic constant must be
+ GL_RENDERBUFFER
.
internalformat
Specifies the color-renderable, depth-renderable, or
+ stencil-renderable format of the renderbuffer. Must be one of the
+ following symbolic constants:
+ GL_RGBA4
,
+ GL_RGB565
,
+ GL_RGB5_A1
,
+ GL_DEPTH_COMPONENT16
, or
+ GL_STENCIL_INDEX8
.
width
Specifies the width of the renderbuffer in pixels.
height
Specifies the height of the renderbuffer in pixels.
glRenderbufferStorage
establishes the data
+ storage, format, and dimensions of a renderbuffer object's image. Any
+ existing data store for the renderbuffer is deleted and the contents
+ of the new data store are undefined.
An implementation may vary its allocation of internal component
+ resolution based on any glRenderbufferStorage
parameter
+ (except target
), but the allocation and chosen
+ internal format must not be a function of any other state and cannot be
+ changed once they are established. The actual resolution in bits of each
+ component of the allocated image can be queried with
+ glGetRenderbufferParameteriv.
GL_INVALID_ENUM
is generated if
+ target
is not GL_RENDERBUFFER
.
GL_INVALID_ENUM
is generated if
+ internalformat
is not an accepted format.
GL_INVALID_VALUE
is generated if
+ width
or height
is less than zero
+ or greater than GL_MAX_RENDERBUFFER_SIZE
.
GL_OUT_OF_MEMORY
is generated if the implementation is
+ unable to create a data store with the requested
+ width
and height
.
GL_INVALID_OPERATION
is generated if the reserved
+ renderbuffer object name 0 is bound.
glBindRenderbuffer, + glDeleteRenderbuffers, + glFramebufferRenderbuffer, + glGenRenderbuffers, + glGetRenderbufferParameteriv, + glIsRenderbuffer
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glSampleCoverage — specify multisample coverage parameters
void glSampleCoverage( | GLclampf value, |
GLboolean invert) ; |
value
+ Specify a single floating-point sample coverage value. The value is
+ clamped to the range
+
invert
+ Specify a single boolean value representing if the coverage masks should be
+ inverted. GL_TRUE
and GL_FALSE
are accepted. The initial value
+ is GL_FALSE
.
+
+ Multisampling samples a pixel multiple times at various + implementation-dependent subpixel locations to generate antialiasing + effects. Multisampling transparently antialiases points, lines, and polygons + if it is enabled. +
+ value
is used in constructing a temporary mask used in determining which
+ samples will be used in resolving the final fragment color. This mask is
+ bitwise-anded with the coverage mask generated from the multisampling
+ computation. If the invert
flag is set, the temporary mask is inverted
+ (all bits flipped) and then the bitwise-and is computed.
+
+ If an implementation does not have any multisample buffers available, or + multisampling is disabled, rasterization occurs with only a single sample + computing a pixel's final RGB color. +
+ Provided an implementation supports multisample buffers, and multisampling + is enabled, then a pixel's final color is generated by combining several + samples per pixel. Each sample contains color, depth, and stencil + information, allowing those operations to be performed on each sample. +
+ glGet with argument GL_SAMPLE_COVERAGE_VALUE
+
+ glGet with argument GL_SAMPLE_COVERAGE_INVERT
+
+ glIsEnabled with argument GL_SAMPLE_ALPHA_TO_COVERAGE
+
+ glIsEnabled with argument GL_SAMPLE_COVERAGE
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glScissor — define the scissor box
void glScissor( | GLint x, |
GLint y, | |
GLsizei width, | |
GLsizei height) ; |
x
, y
+ Specify the lower left corner of the scissor box. + Initially (0, 0). +
width
, height
+ Specify the width and height of the scissor box.
+ When a GL context is first attached to a window,
+ width
and height
are set to the dimensions of that
+ window.
+
+ glScissor
defines a rectangle, called the scissor box,
+ in window coordinates.
+ The first two arguments,
+ x
and y
,
+ specify the lower left corner of the box.
+ width
and height
specify the width and height of the box.
+
+ To enable and disable the scissor test, call
+ glEnable and glDisable with argument
+ GL_SCISSOR_TEST
. The test is initially disabled.
+ While the test is enabled, only pixels that lie within the scissor box
+ can be modified by drawing commands.
+ Window coordinates have integer values at the shared corners of
+ frame buffer pixels.
+ glScissor(0,0,1,1)
allows modification of only the lower left
+ pixel in the window, and glScissor(0,0,0,0)
doesn't allow
+ modification of any pixels in the window.
+
+ When the scissor test is disabled, + it is as though the scissor box includes the entire window. +
+ glGet with argument GL_SCISSOR_BOX
+
+ glIsEnabled with argument GL_SCISSOR_TEST
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glShaderBinary — load a precompiled shader binary
void glShaderBinary( | GLsizei n, |
const GLuint *shaders, | |
GLenum binaryformat, | |
const void *binary, | |
GLsizei length) ; |
n
Specifies the number of shader object handles
+ present in shaders
.
shaders
Specifies a pointer to an array of shader object handles into + which the shader binary will be loaded.
binaryformat
Specifies the shader binary format.
binary
Specifies a pointer to the shader binary data in client memory.
length
Specifies the length of the shader binary data in bytes.
For implementations that support them,
+ glShaderBinary
loads precompiled shader binaries.
+ shaders
contains a list of n
+ shader object handles. Each handle refers to a unique shader type (vertex shader or
+ fragment shader). binary
points to precompiled binary
+ shader code in client memory, and binaryformat
denotes
+ the format of the pre-compiled code.
The binary image is decoded according to the extension
+ specification defining the specified binaryformat
.
+ OpenGL ES defines no specific binary formats, but does provide a mechanism
+ to obtain symbolic constants for such formats provided by extensions. The
+ number of shader binary formats supported can be obtained by querying the
+ value of GL_NUM_SHADER_BINARY_FORMATS
. The list of
+ specific binary formats supported can be obtained by querying the value of
+ GL_SHADER_BINARY_FORMATS
.
Depending on the types of the shader objects in shaders
,
+ glShaderBinary
will individually load binary vertex or
+ fragment shaders, or load an executable binary that contains an optimized
+ pair of vertex and fragment shaders stored in the same binary.
If glShaderBinary
fails, the old state of shader
+ objects for which the binary was being loaded will not be restored.
Shader binary support is optional and thus must be queried
+ before use by calling glGet
+ with arguments GL_NUM_SHADER_BINARY_FORMATS
and
+ GL_SHADER_BINARY_FORMATS
. glShaderBinary
+ generates GL_INVALID_OPERATION
on implementations
+ that do not support any shader binary formats. Such implementations instead
+ offer the glShaderSource
+ alternative for supplying OpenGL ES Shading Language shader source for compilation.
If shader binary formats are supported, then an implementation may
+ require that an optimized pair of vertex and fragment shader
+ binaries that were compiled together to be specified to
+ glLinkProgram.
+ Not specifying an optimized pair my cause
+ glLinkProgram
+ to fail. Such a restriction, if it exists, will be documented in
+ the extension specification defining binaryformat
.
OpenGL copies the shader binary data when
+ glShaderBinary
is called, so an application
+ may free its copy of the data immediately after
+ the function returns.
GL_INVALID_ENUM
is generated if
+ binaryformat
is not a supported format returned in
+ GL_SHADER_BINARY_FORMATS
.
GL_INVALID_VALUE
is generated if any value in
+ shaders
is not a vlue generated by OpenGL.
GL_INVALID_VALUE
is generated if the format of the
+ data pointed to by binary
does not match
+ binaryformat
.
GL_INVALID_VALUE
is generated if n
+ or length
is negative.
GL_INVALID_OPERATION
is generated if any value in
+ shaders
is not a shader object, or if there
+ is more than one vertex shader object handle or more than one fragment shader
+ object handle in shaders
.
+ Copyright © 2008 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glShaderSource — replace the source code in a shader object
void glShaderSource( | GLuint shader, |
GLsizei count, | |
const GLchar * const *string, | |
const GLint *length) ; |
shader
Specifies the handle of the shader object + whose source code is to be replaced.
count
Specifies the number of elements in the
+ string
and
+ length
+ arrays.
string
Specifies an array of pointers to strings + containing the source code to be loaded into the + shader.
length
Specifies an array of string lengths.
For implementations that support a shader compiler,
+ glShaderSource
sets the source code
+ in shader
to the source code in the array
+ of strings specified by string
. Any
+ source code previously stored in the shader object is completely
+ replaced. The number of strings in the array is specified by
+ count
. If length
+ is NULL
, each string is assumed to be null
+ terminated. If length
is a value other
+ than NULL
, it points to an array containing
+ a string length for each of the corresponding elements of
+ string
. Each element in the
+ length
array may contain the length of
+ the corresponding string (the null character is not counted as
+ part of the string length) or a value less than 0 to indicate
+ that the string is null terminated. The source code strings are
+ not scanned or parsed at this time; they are simply copied into
+ the specified shader object.
Shader compiler support is optional, and thus must be queried
+ before use by calling glGet
+ with argument GL_SHADER_COMPILER
. glShaderSource
,
+ glCompileShader,
+ glGetShaderPrecisionFormat, and
+ glReleaseShaderCompiler will
+ each generate GL_INVALID_OPERATION
on implementations
+ that do not support a shader compiler. Such implementations instead offer the
+ glShaderBinary
+ alternative for supplying a pre-compiled shader binary.
OpenGL copies the shader source code strings when
+ glShaderSource
is called, so an application
+ may free its copy of the source code strings immediately after
+ the function returns.
GL_INVALID_OPERATION
is generated if
+ a shader compiler is not supported.
GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_VALUE
is generated if
+ count
is less than 0.
glGet
+ with argument GL_SHADER_COMPILER
glGetShaderiv
+ with arguments shader
and
+ GL_SHADER_SOURCE_LENGTH
glGetShaderSource
+ with argument shader
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glStencilFunc — set front and back function and reference value for stencil testing
void glStencilFunc( | GLenum func, |
GLint ref, | |
GLuint mask) ; |
func
+ Specifies the test function.
+ Eight symbolic constants are valid:
+ GL_NEVER
,
+ GL_LESS
,
+ GL_LEQUAL
,
+ GL_GREATER
,
+ GL_GEQUAL
,
+ GL_EQUAL
,
+ GL_NOTEQUAL
, and
+ GL_ALWAYS
. The initial value is GL_ALWAYS
.
+
ref
+ Specifies the reference value for the stencil test.
+ ref
is clamped to the range
+
mask
+ Specifies a mask that is ANDed with both the reference value + and the stored stencil value when the test is done. The initial value + is all 1's. +
+ Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + Stencil planes are first drawn into using GL drawing primitives, then + geometry and images are rendered using the stencil planes to mask out + portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering. +
+ The stencil test conditionally eliminates a pixel based on the outcome
+ of a comparison between the reference value
+ and the value in the stencil buffer.
+ To enable and disable the test, call glEnable and glDisable
+ with argument GL_STENCIL_TEST
.
+ To specify actions based on the outcome of the stencil test, call
+ glStencilOp or
+ glStencilOpSeparate.
+
+ There can be two separate sets of func
, ref
, and
+ mask
parameters; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilFunc sets both front
+ and back stencil state to the same values. Use glStencilFuncSeparate
+ to set front and back stencil state to different values.
+
+ func
is a symbolic constant that determines the stencil comparison function.
+ It accepts one of eight values,
+ shown in the following list.
+ ref
is an integer reference value that is used in the stencil comparison.
+ It is clamped to the range
+ mask
is bitwise ANDed with both the reference value
+ and the stored stencil value,
+ with the ANDed values participating in the comparison.
+
+ If stencil represents the value stored in the corresponding
+ stencil buffer location,
+ the following list shows the effect of each comparison function
+ that can be specified by func
.
+ Only if the comparison succeeds is the pixel passed through
+ to the next stage in the rasterization process
+ (see glStencilOp).
+ All tests treat stencil values as unsigned integers in the range
+
+ The following values are accepted by func
:
+
GL_NEVER
+ Always fails. +
GL_LESS
+ Passes if ( ref
& mask
) < ( stencil & mask
).
+
GL_LEQUAL
+ Passes if ( ref
& mask
) <= ( stencil & mask
).
+
GL_GREATER
+ Passes if ( ref
& mask
) > ( stencil & mask
).
+
GL_GEQUAL
+ Passes if ( ref
& mask
) >= ( stencil & mask
).
+
GL_EQUAL
+ Passes if ( ref
& mask
) = ( stencil & mask
).
+
GL_NOTEQUAL
+ Passes if ( ref
& mask
) != ( stencil & mask
).
+
GL_ALWAYS
+ Always passes. +
+ Initially, the stencil test is disabled. + If there is no stencil buffer, + no stencil modification can occur and it is as if + the stencil test always passes. +
+ glStencilFunc is the same as
+ calling glStencilFuncSeparate
+ with face
set to GL_FRONT_AND_BACK
.
+
+ glGet with argument
+ GL_STENCIL_FUNC
, GL_STENCIL_VALUE_MASK
,
+ GL_STENCIL_REF
, GL_STENCIL_BACK_FUNC
,
+ GL_STENCIL_BACK_VALUE_MASK
, GL_STENCIL_BACK_REF
,
+ or GL_STENCIL_BITS
+
+ glIsEnabled with argument GL_STENCIL_TEST
+
+ glBlendFunc, + glDepthFunc, + glEnable, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glStencilFuncSeparate — set front and/or back function and reference value for stencil testing
void glStencilFuncSeparate( | GLenum face, |
GLenum func, | |
GLint ref, | |
GLuint mask) ; |
face
+ Specifies whether front and/or back stencil state is updated.
+ Three symbolic constants are valid:
+ GL_FRONT
,
+ GL_BACK
, and
+ GL_FRONT_AND_BACK
.
+
func
+ Specifies the test function.
+ Eight symbolic constants are valid:
+ GL_NEVER
,
+ GL_LESS
,
+ GL_LEQUAL
,
+ GL_GREATER
,
+ GL_GEQUAL
,
+ GL_EQUAL
,
+ GL_NOTEQUAL
, and
+ GL_ALWAYS
. The initial value is GL_ALWAYS
.
+
ref
+ Specifies the reference value for the stencil test.
+ ref
is clamped to the range
+
mask
+ Specifies a mask that is ANDed with both the reference value + and the stored stencil value when the test is done. The initial value + is all 1's. +
+ Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + You draw into the stencil planes using GL drawing primitives, + then render geometry and images, + using the stencil planes to mask out portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering. +
+ The stencil test conditionally eliminates a pixel based on the outcome
+ of a comparison between the reference value
+ and the value in the stencil buffer.
+ To enable and disable the test, call glEnable and glDisable
+ with argument GL_STENCIL_TEST
.
+ To specify actions based on the outcome of the stencil test, call
+ glStencilOp or
+ glStencilOpSeparate.
+
+ There can be two separate sets of func
, ref
, and
+ mask
parameters; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilFunc sets both front
+ and back stencil state to the same values, as if
+ glStencilFuncSeparate were called
+ with face
set to GL_FRONT_AND_BACK
.
+
+ func
is a symbolic constant that determines the stencil comparison function.
+ It accepts one of eight values,
+ shown in the following list.
+ ref
is an integer reference value that is used in the stencil comparison.
+ It is clamped to the range
+ mask
is bitwise ANDed with both the reference value
+ and the stored stencil value,
+ with the ANDed values participating in the comparison.
+
+ If stencil represents the value stored in the corresponding
+ stencil buffer location,
+ the following list shows the effect of each comparison function
+ that can be specified by func
.
+ Only if the comparison succeeds is the pixel passed through
+ to the next stage in the rasterization process
+ (see glStencilOp).
+ All tests treat stencil values as unsigned integers in the range
+
+ The following values are accepted by func
:
+
GL_NEVER
+ Always fails. +
GL_LESS
+ Passes if ( ref
& mask
) < ( stencil & mask
).
+
GL_LEQUAL
+ Passes if ( ref
& mask
) <= ( stencil & mask
).
+
GL_GREATER
+ Passes if ( ref
& mask
) > ( stencil & mask
).
+
GL_GEQUAL
+ Passes if ( ref
& mask
) >= ( stencil & mask
).
+
GL_EQUAL
+ Passes if ( ref
& mask
) = ( stencil & mask
).
+
GL_NOTEQUAL
+ Passes if ( ref
& mask
) != ( stencil & mask
).
+
GL_ALWAYS
+ Always passes. +
+ Initially, the stencil test is disabled. + If there is no stencil buffer, + no stencil modification can occur and it is as if + the stencil test always passes. +
+ GL_INVALID_ENUM
is generated if face
is
+ not GL_FRONT
, GL_BACK
, or
+ GL_FRONT_AND_BACK
.
+
+ GL_INVALID_ENUM
is generated if func
is not one of the eight
+ accepted values.
+
+ glGet with argument
+ GL_STENCIL_FUNC
, GL_STENCIL_VALUE_MASK
,
+ GL_STENCIL_REF
, GL_STENCIL_BACK_FUNC
,
+ GL_STENCIL_BACK_VALUE_MASK
, GL_STENCIL_BACK_REF
,
+ or GL_STENCIL_BITS
+
+ glIsEnabled with argument GL_STENCIL_TEST
+
+ glBlendFunc, + glDepthFunc, + glEnable, + glStencilFunc, + glStencilMask, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +
+ Copyright © 2006 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glStencilMask — control the front and back writing of individual bits in the stencil planes
void glStencilMask( | GLuint mask) ; |
mask
+ Specifies a bit mask to enable and disable writing of individual bits + in the stencil planes. + Initially, the mask is all 1's. +
+ glStencilMask
controls the writing of individual bits in the stencil planes.
+ The least significant
+ mask
,
+ where
+
+ There can be two separate mask
writemasks; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilMask sets both front
+ and back stencil writemasks to the same values. Use glStencilMaskSeparate
+ to set front and back stencil writemasks to different values.
+
+ glStencilMask is the same as
+ calling glStencilMaskSeparate
+ with face
set to GL_FRONT_AND_BACK
.
+
+ glGet with argument
+ GL_STENCIL_WRITEMASK
, GL_STENCIL_BACK_WRITEMASK
,
+ or GL_STENCIL_BITS
+
+ glColorMask, + glDepthMask, + glStencilFunc, + glStencilFuncSeparate, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glStencilMaskSeparate — control the front and/or back writing of individual bits in the stencil planes
void glStencilMaskSeparate( | GLenum face, |
GLuint mask) ; |
face
+ Specifies whether the front and/or back stencil writemask is updated.
+ Three symbolic constants are valid:
+ GL_FRONT
,
+ GL_BACK
, and
+ GL_FRONT_AND_BACK
.
+
mask
+ Specifies a bit mask to enable and disable writing of individual bits + in the stencil planes. + Initially, the mask is all 1's. +
+ glStencilMaskSeparate
controls the writing of individual bits in the stencil planes.
+ The least significant
+ mask
,
+ where
+
+ There can be two separate mask
writemasks; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilMask sets both front
+ and back stencil writemasks to the same values, as if
+ glStencilMaskSeparate were called
+ with face
set to GL_FRONT_AND_BACK
.
+
+ glGet with argument
+ GL_STENCIL_WRITEMASK
, GL_STENCIL_BACK_WRITEMASK
,
+ or GL_STENCIL_BITS
+
+ glColorMask, + glDepthMask, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilOp, + glStencilOpSeparate +
+ Copyright © 2006 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glStencilOp — set front and back stencil test actions
void glStencilOp( | GLenum sfail, |
GLenum dpfail, | |
GLenum dppass) ; |
sfail
+ Specifies the action to take when the stencil test fails.
+ Eight symbolic constants are accepted:
+ GL_KEEP
,
+ GL_ZERO
,
+ GL_REPLACE
,
+ GL_INCR
,
+ GL_INCR_WRAP
,
+ GL_DECR
,
+ GL_DECR_WRAP
, and
+ GL_INVERT
. The initial value is GL_KEEP
.
+
dpfail
+ Specifies the stencil action when the stencil test passes,
+ but the depth test fails.
+ dpfail
accepts the same symbolic constants as sfail
. The initial value
+ is GL_KEEP
.
+
dppass
+ Specifies the stencil action when both the stencil test and the depth
+ test pass, or when the stencil test passes and either there is no
+ depth buffer or depth testing is not enabled.
+ dppass
accepts the same symbolic constants as sfail
. The initial value
+ is GL_KEEP
.
+
+ Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + You draw into the stencil planes using GL drawing primitives, + then render geometry and images, + using the stencil planes to mask out portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering. +
+ The stencil test conditionally eliminates a pixel based on the outcome
+ of a comparison between the value in the stencil buffer and a
+ reference value. To enable and disable the test, call glEnable
+ and glDisable with argument
+ GL_STENCIL_TEST
; to control it, call
+ glStencilFunc or
+ glStencilFuncSeparate.
+
+ There can be two separate sets of sfail
, dpfail
, and
+ dppass
parameters; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilOp sets both front
+ and back stencil state to the same values. Use glStencilOpSeparate
+ to set front and back stencil state to different values.
+
+ glStencilOp
takes three arguments that indicate what happens
+ to the stored stencil value while stenciling is enabled.
+ If the stencil test fails,
+ no change is made to the pixel's color or depth buffers,
+ and sfail
specifies what happens to the stencil buffer contents.
+ The following eight actions are possible.
+
GL_KEEP
+ Keeps the current value. +
GL_ZERO
+ Sets the stencil buffer value to 0. +
GL_REPLACE
+ Sets the stencil buffer value to ref, + as specified by glStencilFunc. +
GL_INCR
+ Increments the current stencil buffer value. + Clamps to the maximum representable unsigned value. +
GL_INCR_WRAP
+ Increments the current stencil buffer value. + Wraps stencil buffer value to zero when incrementing the maximum + representable unsigned value. +
GL_DECR
+ Decrements the current stencil buffer value. + Clamps to 0. +
GL_DECR_WRAP
+ Decrements the current stencil buffer value. + Wraps stencil buffer value to the maximum representable unsigned value when + decrementing a stencil buffer value of zero. +
GL_INVERT
+ Bitwise inverts the current stencil buffer value. +
+ Stencil buffer values are treated as unsigned integers.
+ When incremented and decremented,
+ values are clamped to 0 and
+ GL_STENCIL_BITS
.
+
+ The other two arguments to glStencilOp
specify stencil buffer actions
+ that depend on whether subsequent depth buffer tests succeed (dppass
)
+ or fail (dpfail
) (see
+ glDepthFunc).
+ The actions are specified using the same eight symbolic constants as sfail
.
+ Note that dpfail
is ignored when there is no depth buffer,
+ or when the depth buffer is not enabled.
+ In these cases, sfail
and dppass
specify stencil action when the
+ stencil test fails and passes,
+ respectively.
+
+ Initially the stencil test is disabled.
+ If there is no stencil buffer,
+ no stencil modification can occur
+ and it is as if the stencil tests always pass,
+ regardless of any call to glStencilOp
.
+
+ glStencilOp is the same as
+ calling glStencilOpSeparate
+ with face
set to GL_FRONT_AND_BACK
.
+
+ GL_INVALID_ENUM
is generated if sfail
,
+ dpfail
, or dppass
is any value other
+ than the eight defined symbolic constant values.
+
+ glGet with argument
+ GL_STENCIL_FAIL
, GL_STENCIL_PASS_DEPTH_PASS
,
+ GL_STENCIL_PASS_DEPTH_FAIL
, GL_STENCIL_BACK_FAIL
,
+ GL_STENCIL_BACK_PASS_DEPTH_PASS
, GL_STENCIL_BACK_PASS_DEPTH_FAIL
,
+ or GL_STENCIL_BITS
+
+ glIsEnabled with argument GL_STENCIL_TEST
+
+ glBlendFunc, + glDepthFunc, + glEnable, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOpSeparate +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glStencilOpSeparate — set front and/or back stencil test actions
void glStencilOpSeparate( | GLenum face, |
GLenum sfail, | |
GLenum dpfail, | |
GLenum dppass) ; |
face
+ Specifies whether front and/or back stencil state is updated.
+ Three symbolic constants are valid:
+ GL_FRONT
,
+ GL_BACK
, and
+ GL_FRONT_AND_BACK
.
+
sfail
+ Specifies the action to take when the stencil test fails.
+ Eight symbolic constants are accepted:
+ GL_KEEP
,
+ GL_ZERO
,
+ GL_REPLACE
,
+ GL_INCR
,
+ GL_INCR_WRAP
,
+ GL_DECR
,
+ GL_DECR_WRAP
, and
+ GL_INVERT
. The initial value is GL_KEEP
.
+
dpfail
+ Specifies the stencil action when the stencil test passes,
+ but the depth test fails.
+ dpfail
accepts the same symbolic constants as sfail
. The initial value
+ is GL_KEEP
.
+
dppass
+ Specifies the stencil action when both the stencil test and the depth
+ test pass, or when the stencil test passes and either there is no
+ depth buffer or depth testing is not enabled.
+ dppass
accepts the same symbolic constants as sfail
. The initial value
+ is GL_KEEP
.
+
+ Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + You draw into the stencil planes using GL drawing primitives, + then render geometry and images, + using the stencil planes to mask out portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering. +
+ The stencil test conditionally eliminates a pixel based on the outcome
+ of a comparison between the value in the stencil buffer and a
+ reference value. To enable and disable the test, call glEnable
+ and glDisable with argument
+ GL_STENCIL_TEST
; to control it, call
+ glStencilFunc or
+ glStencilFuncSeparate.
+
+ There can be two separate sets of sfail
, dpfail
, and
+ dppass
parameters; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilOp sets both front
+ and back stencil state to the same values, as if
+ glStencilOpSeparate were called
+ with face
set to GL_FRONT_AND_BACK
.
+
+ glStencilOpSeparate
takes three arguments that indicate what happens
+ to the stored stencil value while stenciling is enabled.
+ If the stencil test fails,
+ no change is made to the pixel's color or depth buffers,
+ and sfail
specifies what happens to the stencil buffer contents.
+ The following eight actions are possible.
+
GL_KEEP
+ Keeps the current value. +
GL_ZERO
+ Sets the stencil buffer value to 0. +
GL_REPLACE
+ Sets the stencil buffer value to ref, + as specified by glStencilFunc. +
GL_INCR
+ Increments the current stencil buffer value. + Clamps to the maximum representable unsigned value. +
GL_INCR_WRAP
+ Increments the current stencil buffer value. + Wraps stencil buffer value to zero when incrementing the maximum + representable unsigned value. +
GL_DECR
+ Decrements the current stencil buffer value. + Clamps to 0. +
GL_DECR_WRAP
+ Decrements the current stencil buffer value. + Wraps stencil buffer value to the maximum representable unsigned value when + decrementing a stencil buffer value of zero. +
GL_INVERT
+ Bitwise inverts the current stencil buffer value. +
+ Stencil buffer values are treated as unsigned integers.
+ When incremented and decremented,
+ values are clamped to 0 and
+ GL_STENCIL_BITS
.
+
+ The other two arguments to glStencilOpSeparate
specify stencil buffer actions
+ that depend on whether subsequent depth buffer tests succeed (dppass
)
+ or fail (dpfail
) (see
+ glDepthFunc).
+ The actions are specified using the same eight symbolic constants as sfail
.
+ Note that dpfail
is ignored when there is no depth buffer,
+ or when the depth buffer is not enabled.
+ In these cases, sfail
and dppass
specify stencil action when the
+ stencil test fails and passes,
+ respectively.
+
+ Initially the stencil test is disabled. + If there is no stencil buffer, + no stencil modification can occur + and it is as if the stencil test always passes. +
+ GL_INVALID_ENUM
is generated if face
is any value
+ other than GL_FRONT
, GL_BACK
, or GL_FRONT_AND_BACK
.
+
+ GL_INVALID_ENUM
is generated if sfail
,
+ dpfail
, or dppass
is any value other
+ than the eight defined symbolic constant values.
+
+ glGet with argument
+ GL_STENCIL_FAIL
, GL_STENCIL_PASS_DEPTH_PASS
,
+ GL_STENCIL_PASS_DEPTH_FAIL
, GL_STENCIL_BACK_FAIL
,
+ GL_STENCIL_BACK_PASS_DEPTH_PASS
, GL_STENCIL_BACK_PASS_DEPTH_FAIL
,
+ or GL_STENCIL_BITS
+
+ glIsEnabled with argument GL_STENCIL_TEST
+
+ glBlendFunc, + glDepthFunc, + glEnable, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOp +
+ Copyright © 2006 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glTexImage2D — specify a two-dimensional texture image
void glTexImage2D( | GLenum target, |
GLint level, | |
GLint internalformat, | |
GLsizei width, | |
GLsizei height, | |
GLint border, | |
GLenum format, | |
GLenum type, | |
const GLvoid * data) ; |
+
target
+ Specifies the target texture of the active texture unit.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+ Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
internalformat
+ Specifies the internal format of the texture.
+ Must be one of the following symbolic constants:
+ GL_ALPHA
,
+ GL_LUMINANCE
,
+ GL_LUMINANCE_ALPHA
,
+ GL_RGB
,
+ GL_RGBA
.
+
width
+ Specifies the width of the texture image. + All implementations support 2D texture images that are at least 64 texels + wide and cube-mapped texture images that are at least 16 texels wide. +
height
+ Specifies the height of the texture image + All implementations support 2D texture images that are at least 64 texels + high and cube-mapped texture images that are at least 16 texels high. +
border
+ Specifies the width of the border. + Must be 0. +
format
+ Specifies the format of the texel data. Must match internalformat
.
+ The following symbolic values are accepted:
+ GL_ALPHA
,
+ GL_RGB
,
+ GL_RGBA
,
+ GL_LUMINANCE
, and
+ GL_LUMINANCE_ALPHA
.
+
type
+ Specifies the data type of the texel data.
+ The following symbolic values are accepted:
+ GL_UNSIGNED_BYTE
,
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
, and
+ GL_UNSIGNED_SHORT_5_5_5_1
.
+
data
+ Specifies a pointer to the image data in memory. +
+ Texturing maps a portion of a specified texture image + onto each graphical primitive for which texturing is + active. Texturing is active when the current fragment shader or + vertex shader makes use of built-in texture lookup + functions. +
+ To define texture images, call glTexImage2D
.
+ The arguments describe the parameters of the texture image,
+ such as height,
+ width,
+ level-of-detail number
+ (see glTexParameter),
+ and format.
+ The last three arguments describe how the image is represented in memory.
+
+ Data is read from data
as a sequence of unsigned bytes or shorts,
+ depending on type
.
+ When type
is GL_UNSIGNED_BYTE
,
+ each of the bytes is interpreted as one color component.
+ When type
is one of
+ GL_UNSIGNED_SHORT_5_6_5
, GL_UNSIGNED_SHORT_4_4_4_4
, or
+ GL_UNSIGNED_SHORT_5_5_5_1
, each unsigned short value is interpreted as
+ containing all the components for a single texel, with the color
+ components arranged according to format
.
+ Color components are treated as groups of one, two, three, or four
+ values, again based on format
. Groups of
+ components are referred to as texels.
+
+ data
.
+ By default, these texels are taken from adjacent memory locations,
+ except that after all width
texels are read,
+ the read pointer is advanced to the next four-byte boundary.
+ The four-byte row alignment is specified by glPixelStorei with
+ argument GL_UNPACK_ALIGNMENT
,
+ and it can be set to one, two, four, or eight bytes.
+
+ The first element corresponds to the lower left corner of the texture + image. + Subsequent elements progress left-to-right through the remaining texels + in the lowest row of the texture image, and then in successively higher + rows of the texture image. + The final element corresponds to the upper right corner of the texture + image. +
+ format
determines the composition of each element in data
.
+ It can assume one of these symbolic values:
+
GL_ALPHA
+ Each element is a single alpha component. + The GL converts it to floating point and assembles it into an RGBA element + by attaching 0 for red, green, and blue. + Each component is then clamped to the range [0,1]. +
GL_RGB
+ Each element is an RGB triple. + The GL converts it to floating point and assembles it into an RGBA element + by attaching 1 for alpha. + Each component is then clamped to the range [0,1]. +
GL_RGBA
+ Each element contains all four components. The GL converts it to floating point, then + each component is clamped to the range [0,1]. +
GL_LUMINANCE
+ Each element is a single luminance value. + The GL converts it to floating point, + then assembles it into an RGBA element by replicating the luminance value + three times for red, green, and blue and attaching 1 for alpha. + Each component is then clamped to the range [0,1]. +
GL_LUMINANCE_ALPHA
+ Each element is a luminance/alpha pair. + The GL converts it to floating point, + then assembles it into an RGBA element by replicating the luminance value + three times for red, green, and blue. + Each component is then clamped to the range [0,1]. +
+ Color components are converted to floating point based on the type
.
+ When type
is GL_UNSIGNED_BYTE
,
+ each component is divided by
+ type
is GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
, or GL_UNSIGNED_SHORT_5_5_5_1
,
+ each component is divided by
+
+ internalformat
must match format
.
+ No conversion between formats is supported during texture image processing.
+ type
may be used as a hint to specify how much
+ precision is desired, but a GL implementation may choose to store the texture
+ array at any internal resolution it chooses.
+
+ data
may be a null pointer.
+ In this case, texture memory is
+ allocated to accommodate a texture of width width
and height height
.
+ You can then download subtextures to initialize this
+ texture memory.
+ The image is undefined if the user tries to apply
+ an uninitialized portion of the texture image to a primitive.
+
+ glTexImage2D
+ specifies a two-dimensional or cube-map texture for the current texture unit,
+ specified with glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_ENUM
is generated if format
+ or type
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated if target
is one of the six cube map 2D image targets and the width and height parameters are not equal.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater than
+ GL_MAX_TEXTURE_SIZE
when target
+ is GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when
+ target
is not GL_TEXTURE_2D
.
+
+ GL_INVALID_VALUE
is generated if internalformat
is not an
+ accepted format.
+
+ GL_INVALID_VALUE
is generated if width
or height
is less than 0
+ or greater than GL_MAX_TEXTURE_SIZE
when target
+ is GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when
+ target
is not GL_TEXTURE_2D
.
+
+ GL_INVALID_VALUE
is generated if border
is not 0.
+
+ GL_INVALID_OPERATION
is generated if format
does
+ not match internalformat
.
+
+ GL_INVALID_OPERATION
is generated if type
is
+ GL_UNSIGNED_SHORT_5_6_5
+ and format
is not GL_RGB
.
+
+ GL_INVALID_OPERATION
is generated if type
is
+ GL_UNSIGNED_SHORT_4_4_4_4
or
+ GL_UNSIGNED_SHORT_5_5_5_1
+ and format
is not GL_RGBA
.
+
+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glPixelStorei, + glTexSubImage2D, + glTexParameter +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glTexParameter — set texture parameters
void glTexParameterf( | GLenum target, |
GLenum pname, | |
GLfloat param) ; |
void glTexParameteri( | GLenum target, |
GLenum pname, | |
GLint param) ; |
target
+ Specifies the target texture of the active texture unit,
+ which must be either GL_TEXTURE_2D
or
+ GL_TEXTURE_CUBE_MAP
.
+
pname
+ Specifies the symbolic name of a single-valued texture parameter.
+ pname
can be one of the following:
+ GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_WRAP_S
, or
+ GL_TEXTURE_WRAP_T
.
+
param
+ Specifies the value of pname
.
+
void glTexParameterfv( | GLenum target, |
GLenum pname, | |
const GLfloat * params) ; |
void glTexParameteriv( | GLenum target, |
GLenum pname, | |
const GLint * params) ; |
target
+ Specifies the target texture of the active texture unit,
+ which must be either GL_TEXTURE_2D
or
+ GL_TEXTURE_CUBE_MAP
.
+
pname
+ Specifies the symbolic name of a texture parameter.
+ pname
can be one of the following:
+ GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_WRAP_S
, or
+ GL_TEXTURE_WRAP_T
.
+
params
+ Specifies a pointer to an array where the value of
+ pname
is stored.
+
+ Texture mapping is a technique that applies an image onto an object's surface
+ as if the image were a decal or cellophane shrink-wrap.
+ The image is created in texture space,
+ with an
+ (
+ glTexParameter
assigns the value or values in params
to the texture parameter
+ specified as pname
.
+ target
defines the target texture of the active texture unit,
+ either GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.
+ The following symbols are accepted in pname
:
+
GL_TEXTURE_MIN_FILTER
+ The texture minifying function is used whenever the pixel being textured + maps to an area greater than one texture element. + There are six defined minifying functions. + Two of them use the nearest one or nearest four texture elements + to compute the texture value. + The other four use mipmaps. +
+ A mipmap is an ordered set of arrays representing the same image
+ at progressively lower resolutions.
+ If the texture has dimensions
+
+ To define the mipmap levels, call glTexImage2D,
+ glCompressedTexImage2D,
+ or glCopyTexImage2D
+ with the level argument indicating the order of the mipmaps.
+ Level 0 is the original texture;
+ level
+
+ params
supplies a function for minifying the texture as one of the
+ following:
+
GL_NEAREST
+ Returns the value of the texture element that is nearest + (in Manhattan distance) + to the center of the pixel being textured. +
GL_LINEAR
+ Returns the weighted average of the four texture elements + that are closest to the center of the pixel being textured. +
GL_NEAREST_MIPMAP_NEAREST
+ Chooses the mipmap that most closely matches the size of the pixel
+ being textured and uses the GL_NEAREST
criterion
+ (the texture element nearest to the center of the pixel)
+ to produce a texture value.
+
GL_LINEAR_MIPMAP_NEAREST
+ Chooses the mipmap that most closely matches the size of the pixel
+ being textured and uses the GL_LINEAR
criterion
+ (a weighted average of the four texture elements that are closest
+ to the center of the pixel)
+ to produce a texture value.
+
GL_NEAREST_MIPMAP_LINEAR
+ Chooses the two mipmaps that most closely match the size of the pixel
+ being textured and uses the GL_NEAREST
criterion
+ (the texture element nearest to the center of the pixel)
+ to produce a texture value from each mipmap.
+ The final texture value is a weighted average of those two values.
+
GL_LINEAR_MIPMAP_LINEAR
+ Chooses the two mipmaps that most closely match the size of the pixel
+ being textured and uses the GL_LINEAR
criterion
+ (a weighted average of the four texture elements that are closest
+ to the center of the pixel)
+ to produce a texture value from each mipmap.
+ The final texture value is a weighted average of those two values.
+
+
+ As more texture elements are sampled in the minification process,
+ fewer aliasing artifacts will be apparent.
+ While the GL_NEAREST
and GL_LINEAR
minification functions can be
+ faster than the other four,
+ they sample only one or four texture elements to determine the texture value
+ of the pixel being rendered and can produce moire patterns
+ or ragged transitions.
+ The initial value of GL_TEXTURE_MIN_FILTER
is
+ GL_NEAREST_MIPMAP_LINEAR
.
+
GL_TEXTURE_MAG_FILTER
+ The texture magnification function is used when the pixel being textured
+ maps to an area less than or equal to one texture element.
+ It sets the texture magnification function to either GL_NEAREST
+ or GL_LINEAR
(see below). GL_NEAREST
is generally faster
+ than GL_LINEAR
,
+ but it can produce textured images with sharper edges
+ because the transition between texture elements is not as smooth.
+ The initial value of GL_TEXTURE_MAG_FILTER
is GL_LINEAR
.
+
GL_NEAREST
+ Returns the value of the texture element that is nearest + (in Manhattan distance) + to the center of the pixel being textured. +
GL_LINEAR
+ Returns the weighted average of the four texture elements + that are closest to the center of the pixel being textured. +
+
+
+
+
GL_TEXTURE_WRAP_S
+ Sets the wrap parameter for texture coordinate
+ GL_CLAMP_TO_EDGE
, GL_MIRRORED_REPEAT
, or
+ GL_REPEAT
. GL_CLAMP_TO_EDGE
causes
+ GL_REPEAT
causes the
+ integer part of the
+ GL_MIRRORED_REPEAT
causes the
+ GL_TEXTURE_WRAP_S
is set to GL_REPEAT
.
+
+
GL_TEXTURE_WRAP_T
+ Sets the wrap parameter for texture coordinate
+ GL_CLAMP_TO_EDGE
, GL_MIRRORED_REPEAT
, or
+ GL_REPEAT
. See the discussion under GL_TEXTURE_WRAP_S
.
+ Initially, GL_TEXTURE_WRAP_T
is set to GL_REPEAT
.
+
+ Suppose that a texture is accessed from a fragment shader or vertex shader and
+ has set GL_TEXTURE_MIN_FILTER
to one of the functions that requires
+ mipmaps. If either the dimensions of the texture images currently defined
+ (with previous calls to glTexImage2D,
+ glCompressedTexImage2D,
+ or glCopyTexImage2D) do not
+ follow the proper sequence for mipmaps (described above), or there are
+ fewer texture images defined than are needed, or the set of texture images
+ were defined with different formats or types, then the texture image unit will return
+ (R, G, B, A) = (0, 0, 0, 1).
+
+ Similarly, if the width or height of a texture image are not powers of two and either the
+ GL_TEXTURE_MIN_FILTER
is set to one of the functions that requires mipmaps
+ or the GL_TEXTURE_WRAP_S
or GL_TEXTURE_WRAP_T
is not
+ set to GL_CLAMP_TO_EDGE
, then the texture image unit will return
+ (R, G, B, A) = (0, 0, 0, 1).
+
+ glTexParameter
+ specifies the texture parameters for the texture bound to the active texture unit, specified
+ by calling glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
or pname
is not
+ one of the accepted defined values.
+
+ GL_INVALID_ENUM
is generated if params
+ should have a defined symbolic
+ constant value (based on the value of pname
) and does not.
+
+ glActiveTexture, + glBindTexture, + glCopyTexImage2D, + glCopyTexSubImage2D, + glPixelStorei, + glTexImage2D, + glTexSubImage2D +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glTexSubImage2D — specify a two-dimensional texture subimage
void glTexSubImage2D( | GLenum target, |
GLint level, | |
GLint xoffset, | |
GLint yoffset, | |
GLsizei width, | |
GLsizei height, | |
GLenum format, | |
GLenum type, | |
const GLvoid * data) ; |
+
target
+ Specifies the target texture of the active texture unit.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+ Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
xoffset
+ Specifies a texel offset in the x direction within the texture array. +
yoffset
+ Specifies a texel offset in the y direction within the texture array. +
width
+ Specifies the width of the texture subimage. +
height
+ Specifies the height of the texture subimage. +
format
+ Specifies the format of the pixel data.
+ The following symbolic values are accepted:
+ GL_ALPHA
,
+ GL_RGB
,
+ GL_RGBA
,
+ GL_LUMINANCE
, and
+ GL_LUMINANCE_ALPHA
.
+
type
+ Specifies the data type of the pixel data.
+ The following symbolic values are accepted:
+ GL_UNSIGNED_BYTE
,
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
, and
+ GL_UNSIGNED_SHORT_5_5_5_1
.
+
data
+ Specifies a pointer to the image data in memory. +
+ Texturing maps a portion of a specified texture image + onto each graphical primitive for which texturing is + active. Texturing is active when the current fragment shader or + vertex shader makes use of built-in texture lookup + functions. +
+ glTexSubImage2D
redefines a contiguous subregion of an existing two-dimensional
+ texture image.
+ The texels referenced by data
replace the portion of the
+ existing texture array with x indices xoffset
and
+ yoffset
and
+
+ Storage parameter GL_UNPACK_ALIGNMENT
, set by
+ glPixelStorei,
+ affects the way that data is read out of client memory.
+ See glPixelStorei for a description.
+
+ glTexSubImage2D
+ specifies a two-dimensional or cube-map subtexture for the current texture unit,
+ specified with glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_ENUM
is generated if format
or
+ type
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater
+ than
+ GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if
+
+ GL_INVALID_VALUE
is generated if width
or height
is less than 0.
+
+ GL_INVALID_OPERATION
is generated if the texture array has not
+ been defined by a previous
+ glTexImage2D or
+ glCopyTexImage2D operation
+ whose internalformat
matches the format
of
+ glTexSubImage2D
.
+
+ GL_INVALID_OPERATION
is generated if type
is
+ GL_UNSIGNED_SHORT_5_6_5
+ and format
is not GL_RGB
.
+
+ GL_INVALID_OPERATION
is generated if type
is
+ GL_UNSIGNED_SHORT_4_4_4_4
or
+ GL_UNSIGNED_SHORT_5_5_5_1
+ and format
is not GL_RGBA
.
+
+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glPixelStorei, + glTexImage2D, + glTexParameter +
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
glUniform — specify the value of a uniform variable for the current program object
void glUniform1f( | GLint location, |
GLfloat v0) ; |
void glUniform2f( | GLint location, |
GLfloat v0, | |
GLfloat v1) ; |
void glUniform3f( | GLint location, |
GLfloat v0, | |
GLfloat v1, | |
GLfloat v2) ; |
void glUniform4f( | GLint location, |
GLfloat v0, | |
GLfloat v1, | |
GLfloat v2, | |
GLfloat v3) ; |
void glUniform1i( | GLint location, |
GLint v0) ; |
void glUniform2i( | GLint location, |
GLint v0, | |
GLint v1) ; |
void glUniform3i( | GLint location, |
GLint v0, | |
GLint v1, | |
GLint v2) ; |
void glUniform4i( | GLint location, |
GLint v0, | |
GLint v1, | |
GLint v2, | |
GLint v3) ; |
location
Specifies the location of the uniform variable + to be modified.
v0
,
+ v1
,
+ v2
,
+ v3
+ Specifies the new values to be used for the + specified uniform variable.
void glUniform1fv( | GLint location, |
GLsizei count, | |
const GLfloat *value) ; |
void glUniform2fv( | GLint location, |
GLsizei count, | |
const GLfloat *value) ; |
void glUniform3fv( | GLint location, |
GLsizei count, | |
const GLfloat *value) ; |
void glUniform4fv( | GLint location, |
GLsizei count, | |
const GLfloat *value) ; |
void glUniform1iv( | GLint location, |
GLsizei count, | |
const GLint *value) ; |
void glUniform2iv( | GLint location, |
GLsizei count, | |
const GLint *value) ; |
void glUniform3iv( | GLint location, |
GLsizei count, | |
const GLint *value) ; |
void glUniform4iv( | GLint location, |
GLsizei count, | |
const GLint *value) ; |
location
Specifies the location of the uniform value to + be modified.
count
Specifies the number of elements that are to + be modified. This should be 1 if the targeted + uniform variable is not an array, and 1 or more if it is + an array.
value
Specifies a pointer to an array of
+ count
values that will be
+ used to update the specified uniform
+ variable.
void glUniformMatrix2fv( | GLint location, |
GLsizei count, | |
GLboolean transpose, | |
const GLfloat *value) ; |
void glUniformMatrix3fv( | GLint location, |
GLsizei count, | |
GLboolean transpose, | |
const GLfloat *value) ; |
void glUniformMatrix4fv( | GLint location, |
GLsizei count, | |
GLboolean transpose, | |
const GLfloat *value) ; |
location
Specifies the location of the uniform value to + be modified.
count
Specifies the number of matrices that are to + be modified. This should be 1 if the targeted + uniform variable is not an array of matrices, and 1 or more if it is + an array of matrices.
transpose
Specifies whether to transpose the matrix as
+ the values are loaded into the uniform
+ variable. Must be GL_FALSE
.
value
Specifies a pointer to an array of
+ count
values that will be
+ used to update the specified uniform
+ variable.
glUniform
modifies the value of a
+ uniform variable or a uniform variable array. The location of
+ the uniform variable to be modified is specified by
+ location
, which should be a value
+ returned by
+ glGetUniformLocation.
+ glUniform
operates on the program object
+ that was made part of current state by calling
+ glUseProgram.
The commands glUniform{1|2|3|4}{f|i}
+ are used to change the value of the uniform variable specified
+ by location
using the values passed as
+ arguments. The number specified in the command should match the
+ number of components in the data type of the specified uniform
+ variable (e.g., 1
for float, int, bool;
+ 2
for vec2, ivec2, bvec2, etc.). The suffix
+ f
indicates that floating-point values are
+ being passed; the suffix i
indicates that
+ integer values are being passed, and this type should also match
+ the data type of the specified uniform variable. The
+ i
variants of this function should be used
+ to provide values for uniform variables defined as int, ivec2,
+ ivec3, ivec4, or arrays of these. The f
+ variants should be used to provide values for uniform variables
+ of type float, vec2, vec3, vec4, or arrays of these. Either the
+ i
or the f
variants
+ may be used to provide values for uniform variables of type
+ bool, bvec2, bvec3, bvec4, or arrays of these. The uniform
+ variable will be set to false if the input value is 0 or 0.0f,
+ and it will be set to true otherwise.
All active uniform variables defined in a program object
+ are initialized to 0 when the program object is linked
+ successfully. They retain the values assigned to them by a call
+ to glUniform
until the next successful
+ link operation occurs on the program object, when they are once
+ again initialized to 0.
The commands glUniform{1|2|3|4}{f|i}v
+ can be used to modify a single uniform variable or a uniform
+ variable array. These commands pass a count and a pointer to the
+ values to be loaded into a uniform variable or a uniform
+ variable array. A count of 1 should be used if modifying the
+ value of a single uniform variable, and a count of 1 or greater
+ can be used to modify an entire array or part of an array. When
+ loading n elements starting at an arbitrary
+ position m in a uniform variable array,
+ elements m + n - 1 in
+ the array will be replaced with the new values. If
+ m
+ n
- 1 is
+ larger than the size of the uniform variable array, values for
+ all array elements beyond the end of the array will be ignored.
+ The number specified in the name of the command indicates the
+ number of components for each element in
+ value
, and it should match the number of
+ components in the data type of the specified uniform variable
+ (e.g., 1
for float, int, bool;
+ 2
for vec2, ivec2, bvec2, etc.). The data
+ type specified in the name of the command must match the data
+ type for the specified uniform variable as described previously
+ for glUniform{1|2|3|4}{f|i}
.
For uniform variable arrays, each element of the array is
+ considered to be of the type indicated in the name of the
+ command (e.g., glUniform3f
or
+ glUniform3fv
can be used to load a uniform
+ variable array of type vec3). The number of elements of the
+ uniform variable array to be modified is specified by
+ count
The commands
+ glUniformMatrix{2|3|4}fv
+ are used to modify a matrix or an array of matrices. The numbers in the
+ command name are interpreted as the dimensionality of the matrix.
+ The number 2
indicates a 2 × 2 matrix
+ (i.e., 4 values), the number 3
indicates a
+ 3 × 3 matrix (i.e., 9 values), and the number
+ 4
indicates a 4 × 4 matrix (i.e., 16
+ values).
+ Each matrix is assumed to be
+ supplied in column major order. The count
+ argument indicates the number of matrices to be passed. A count
+ of 1 should be used if modifying the value of a single matrix,
+ and a count greater than 1 can be used to modify an array of
+ matrices.
glUniform1i
and
+ glUniform1iv
are the only two functions
+ that may be used to load uniform variables defined as sampler
+ types. Loading samplers with any other function will result in a
+ GL_INVALID_OPERATION
error.
If count
is greater than 1 and the
+ indicated uniform variable is not an array, a
+ GL_INVALID_OPERATION
error is generated and the
+ specified uniform variable will remain unchanged.
Other than the preceding exceptions, if the type and size
+ of the uniform variable as defined in the shader do not match
+ the type and size specified in the name of the command used to
+ load its value, a GL_INVALID_OPERATION
error will
+ be generated and the specified uniform variable will remain
+ unchanged.
If location
is a value other than
+ -1 and it does not represent a valid uniform variable location
+ in the current program object, an error will be generated, and
+ no changes will be made to the uniform variable storage of the
+ current program object. If location
is
+ equal to -1, the data passed in will be silently ignored and the
+ specified uniform variable will not be changed.
GL_INVALID_OPERATION
is generated if there
+ is no current program object.
GL_INVALID_OPERATION
is generated if the
+ size of the uniform variable declared in the shader does not
+ match the size indicated by the glUniform
+ command.
GL_INVALID_OPERATION
is generated if one of
+ the integer variants of this function is used to load a uniform
+ variable of type float, vec2, vec3, vec4, or an array of these,
+ or if one of the floating-point variants of this function is
+ used to load a uniform variable of type int, ivec2, ivec3, or
+ ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if
+ location
is an invalid uniform location
+ for the current program object and
+ location
is not equal to -1.
GL_INVALID_VALUE
is generated if
+ count
is less than 0.
GL_INVALID_VALUE
is generated if
+ transpose
is not GL_FALSE
.
GL_INVALID_OPERATION
is generated if
+ count
is greater than 1 and the indicated
+ uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a
+ sampler is loaded using a command other than
+ glUniform1i
and
+ glUniform1iv
.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveUniform + with the handle of a program object and the index of an active uniform variable
glGetUniform + with the handle of a program object and the location of a + uniform variable
glGetUniformLocation + with the handle of a program object and the name of a uniform + variable
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glUseProgram — install a program object as part of current rendering state
void glUseProgram( | GLuint program) ; |
program
Specifies the handle of the program object + whose executables are to be used as part of current + rendering state.
glUseProgram
installs the program
+ object specified by program
as part of
+ current rendering state. Executables for each stage are created in
+ a program object by successfully attaching shader objects to it
+ with
+ glAttachShader,
+ successfully compiling the shader objects with
+ glCompileShader,
+ and successfully linking the program object with
+ glLinkProgram.
+
A program object will contain executables that will run
+ on the vertex and fragment processors if it contains one shader
+ object of type GL_VERTEX_SHADER
and one shader
+ object of type GL_FRAGMENT_SHADER
that have both
+ been successfully compiled and linked.
While a program object is in use, applications are free to
+ modify attached shader objects, compile attached shader objects,
+ attach shader objects, and detach or delete shader
+ objects. None of these operations will affect the executables
+ that are part of the current state. However, relinking the
+ program object that is currently in use will install the program
+ object as part of the current rendering state if the link
+ operation was successful (see
+ glLinkProgram
+ ). If the program object currently in use is relinked
+ unsuccessfully, its link status will be set to
+ GL_FALSE
, but the executables and
+ associated state will remain part of the current state until a
+ subsequent call to glUseProgram
removes it
+ from use. After it is removed from use, it cannot be made part
+ of current state until it has been successfully relinked.
If program
is 0, then the current
+ rendering state refers to an invalid program object, and the
+ results of vertex and fragment shader execution due to any
+ glDrawArrays or
+ glDrawElements
+ commands are undefined.
Like texture objects and buffer objects, the name space for + program objects may be shared across a set of contexts, as long + as the server sides of the contexts share the same address + space. If the name space is shared across contexts, any attached + objects and the data associated with those attached objects are + shared as well.
Applications are responsible for providing the + synchronization across API calls when objects are accessed from + different execution threads.
GL_INVALID_VALUE
is generated if
+ program
is neither 0 nor a value
+ generated by OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ program
could not be made part of current
+ state.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib + with a valid program object and the index of an active attribute + variable
glGetActiveUniform + with a valid program object and the index of an active uniform + variable
glGetAttachedShaders + with a valid program object
glGetAttribLocation + with a valid program object and the name of an attribute + variable
glGetProgramiv + with a valid program object and the parameter to be queried
glGetProgramInfoLog + with a valid program object
glGetUniform + with a valid program object and the location of a uniform + variable
glGetUniformLocation + with a valid program object and the name of a uniform + variable
glAttachShader, + glBindAttribLocation, + glCompileShader, + glCreateProgram, + glDeleteProgram, + glDetachShader, + glLinkProgram, + glUniform, + glValidateProgram, + glVertexAttrib
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glValidateProgram — validate a program object
void glValidateProgram( | GLuint program) ; |
glValidateProgram
checks to see
+ whether the executables contained in
+ program
can execute given the current
+ OpenGL state. The information generated by the validation
+ process will be stored in program
's
+ information log. The validation information may consist of an
+ empty string, or it may be a string containing information about
+ how the current program object interacts with the rest of
+ current OpenGL state. This provides a way for OpenGL
+ implementers to convey more information about why the current
+ program is inefficient, suboptimal, failing to execute, and so
+ on.
The status of the validation operation will be stored as
+ part of the program object's state. This value will be set to
+ GL_TRUE
if the validation succeeded, and
+ GL_FALSE
otherwise. It can be queried by
+ calling
+ glGetProgramiv
+ with arguments program
and
+ GL_VALIDATE_STATUS
. If validation is
+ successful, program
is guaranteed to
+ execute given the current state. Otherwise,
+ program
is guaranteed to not execute.
This function is typically useful only during application + development. The informational string stored in the information + log is completely implementation dependent; therefore, an + application should not expect different OpenGL implementations + to produce identical information strings.
This function mimics the validation operation that OpenGL
+ implementations must perform when rendering commands are issued
+ while programmable shaders are part of current state. The error
+ GL_INVALID_OPERATION
will be generated by
+ glDrawArrays or
+ glDrawElements
+ if any two active samplers in the current program
+ object are of different types, but refer to the same
+ texture image unit.
It may be difficult or cause a performance degradation for
+ applications to catch these errors when rendering commands are
+ issued. Therefore, applications are advised to make calls to
+ glValidateProgram
to detect these issues
+ during application development.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
glGetProgramiv
+ with arguments program
and
+ GL_VALIDATE_STATUS
glGetProgramInfoLog
+ with argument program
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glVertexAttrib — specify the value of a generic vertex attribute
void glVertexAttrib1f( | GLuint index, |
GLfloat v0) ; |
void glVertexAttrib2f( | GLuint index, |
GLfloat v0, | |
GLfloat v1) ; |
void glVertexAttrib3f( | GLuint index, |
GLfloat v0, | |
GLfloat v1, | |
GLfloat v2) ; |
void glVertexAttrib4f( | GLuint index, |
GLfloat v0, | |
GLfloat v1, | |
GLfloat v2, | |
GLfloat v3) ; |
index
Specifies the index of the generic vertex + attribute to be modified.
v0
,
+ v1
,
+ v2
,
+ v3
+ Specifies the new values to be used for the + specified vertex attribute.
void glVertexAttrib1fv( | GLuint index, |
const GLfloat *v) ; |
void glVertexAttrib2fv( | GLuint index, |
const GLfloat *v) ; |
void glVertexAttrib3fv( | GLuint index, |
const GLfloat *v) ; |
void glVertexAttrib4fv( | GLuint index, |
const GLfloat *v) ; |
index
Specifies the index of the generic vertex + attribute to be modified.
v
Specifies a pointer to an array of values to + be used for the generic vertex attribute.
The
+ glVertexAttrib
family of entry points
+ allows an application to pass generic vertex attributes in
+ numbered locations.
Generic attributes are defined as four-component values
+ that are organized into an array. The first entry of this array
+ is numbered 0, and the size of the array is specified by the
+ implementation-dependent symbolic constant
+ GL_MAX_VERTEX_ATTRIBS
. Individual elements
+ of this array can be modified with a
+ glVertexAttrib
call that specifies the
+ index of the element to be modified and a value for that
+ element.
These commands can be used to specify one, two, three, or
+ all four components of the generic vertex attribute specified by
+ index
. A 1
in the
+ name of the command indicates that only one value is passed, and
+ it will be used to modify the first component of the generic
+ vertex attribute. The second and third components will be set to
+ 0, and the fourth component will be set to 1. Similarly, a
+ 2
in the name of the command indicates that
+ values are provided for the first two components, the third
+ component will be set to 0, and the fourth component will be set
+ to 1. A 3
in the name of the command
+ indicates that values are provided for the first three
+ components and the fourth component will be set to 1, whereas a
+ 4
in the name indicates that values are
+ provided for all four components.
The letter f
indicates
+ that the arguments are of type float. When
+ v
is appended to the name, the commands can
+ take a pointer to an array of floats.
OpenGL ES Shading Language attribute variables are allowed to
+ be of type mat2, mat3, or mat4. Attributes of these types may be
+ loaded using the glVertexAttrib
entry
+ points. Matrices must be loaded into successive generic
+ attribute slots in column major order, with one column of the
+ matrix in each generic attribute slot.
A user-defined attribute variable declared in a vertex + shader can be bound to a generic attribute index by calling + glBindAttribLocation. + This allows an application to use descriptive variable + names in a vertex shader. A subsequent change to the specified + generic vertex attribute will be immediately reflected as a + change to the corresponding attribute variable in the vertex + shader.
The binding between a generic vertex attribute index and a + user-defined attribute variable in a vertex shader is part of + the state of a program object, but the current value of the + generic vertex attribute is not. The value of each generic + vertex attribute is part of current state and it is maintained + even if a different program object is used.
An application may freely modify generic vertex attributes + that are not bound to a named vertex shader attribute variable. + These values are simply maintained as part of current state and + will not be accessed by the vertex shader. If a generic vertex + attribute bound to an attribute variable in a vertex shader is + not updated while the vertex shader is executing, the vertex + shader will repeatedly use the current value for the generic + vertex attribute.
It is possible for an application to bind more than one + attribute name to the same generic vertex attribute index. This + is referred to as aliasing, and it is allowed only if just one + of the aliased attribute variables is active in the vertex + shader, or if no path through the vertex shader consumes more + than one of the attributes aliased to the same location. OpenGL + implementations are not required to do error checking to detect + aliasing, they are allowed to assume that aliasing will not + occur, and they are allowed to employ optimizations that work + only in the absence of aliasing.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib
+ with argument program
and the index of an active
+ attribute variable
glGetAttribLocation
+ with argument program
and an attribute
+ variable name
glGetVertexAttrib
+ with arguments GL_CURRENT_VERTEX_ATTRIB
and
+ index
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glVertexAttribPointer — define an array of generic vertex attribute data
void glVertexAttribPointer( | GLuint index, |
GLint size, | |
GLenum type, | |
GLboolean normalized, | |
GLsizei stride, | |
const GLvoid * pointer) ; |
index
Specifies the index of the generic vertex + attribute to be modified.
size
Specifies the number of components per + generic vertex attribute. Must + be 1, 2, 3, or 4. The initial value is 4.
type
Specifies the data type of each component in
+ the array. Symbolic constants
+ GL_BYTE
,
+ GL_UNSIGNED_BYTE
,
+ GL_SHORT
,
+ GL_UNSIGNED_SHORT
,
+ GL_FIXED
, or
+ GL_FLOAT
are
+ accepted. The initial value is GL_FLOAT
.
normalized
Specifies whether fixed-point data values
+ should be normalized (GL_TRUE
)
+ or converted directly as fixed-point values
+ (GL_FALSE
) when they are
+ accessed.
stride
Specifies the byte offset between consecutive
+ generic vertex attributes. If stride
+ is 0, the generic vertex attributes are
+ understood to be tightly packed in the
+ array. The initial value is 0.
pointer
Specifies a pointer to the first component of + the first generic vertex attribute in the array. The initial value is 0.
glVertexAttribPointer
specifies the
+ location and data format of the array of generic vertex attributes at index index
+ to use when rendering. size
+ specifies the number of components per attribute and must be 1,
+ 2, 3, or 4. type
specifies the data type
+ of each component, and stride
specifies
+ the byte stride from one attribute to the next, allowing vertices and
+ attributes to be packed into a single array or
+ stored in separate arrays.
+ If set to GL_TRUE
,
+ normalized
indicates that values stored
+ in an integer format are to be mapped to the range [-1,1] (for
+ signed values) or [0,1] (for unsigned values) when they are
+ accessed and converted to floating point. Otherwise, values will
+ be converted to floats directly without normalization.
If a non-zero named buffer object is bound to the GL_ARRAY_BUFFER
target
+ (see glBindBuffer) while a generic vertex attribute array is
+ specified, pointer
is treated as a byte offset into the buffer object's data store.
+ Also, the buffer object binding (GL_ARRAY_BUFFER_BINDING
) is saved as generic vertex attribute array
+ client-side state (GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
) for index index
.
When a generic vertex attribute array is specified,
+ size
, type
,
+ normalized
,
+ stride
, and
+ pointer
are saved as client-side
+ state, in addition to the current vertex array buffer object binding.
To enable and disable a generic vertex attribute array,
+ call
+ glEnableVertexAttribArray
+ and
+ glDisableVertexAttribArray
+ with index
. If enabled, the generic
+ vertex attribute array is used when
+ glDrawArrays or
+ glDrawElements
+ is called.
Each generic vertex attribute array is initially disabled + and isn't accessed when + glDrawElements or + glDrawArrays + is called.
glVertexAttribPointer
is typically
+ implemented on the client side.
GL_INVALID_ENUM
is generated if
+ type
is not an accepted value.
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to
+ GL_MAX_VERTEX_ATTRIBS
.
GL_INVALID_VALUE
is generated if
+ size
is not 1, 2, 3, or 4.
GL_INVALID_VALUE
is generated if
+ stride
is negative.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_ENABLED
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_SIZE
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_TYPE
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_STRIDE
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
glGet with argument
+ GL_ARRAY_BUFFER_BINDING
glGetVertexAttribPointerv
+ with arguments index
and
+ GL_VERTEX_ATTRIB_ARRAY_POINTER
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
glViewport — set the viewport
void glViewport( | GLint x, |
GLint y, | |
GLsizei width, | |
GLsizei height) ; |
x
, y
+ Specify the lower left corner of the viewport rectangle, + in pixels. The initial value is (0,0). +
width
, height
+ Specify the width and height
+ of the viewport.
+ When a GL context is first attached to a window,
+ width
and height
are set to the dimensions of that
+ window.
+
+ glViewport
specifies the affine transformation of
+
+
+
+
+
+ Viewport width and height are silently clamped
+ to a range that depends on the implementation.
+ To query this range, call glGet with argument
+ GL_MAX_VIEWPORT_DIMS
.
+
+ Copyright © 1991-2006 + Silicon Graphics, Inc. This document is licensed under the SGI + Free Software B License. For details, see + http://oss.sgi.com/projects/FreeB/. +
abs — return the absolute value of the parameter
+
+ genType abs(
+ |
+ genType x) ; |
+
+ genIType abs(
+ |
+ genIType x) ; |
+
x
+
+
+ + Specify the value of which to return the absolute. +
+
+ abs
returns x
if x
≥ 0, otherwise
+ returns -x
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
abs (genType) | +✔ | +✔ | +
abs (genIType) | +- | +✔ | +
+ sign +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+acos — return the arccosine of the parameter
+
+ genType acos(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value whose arccosine to return. +
+
+ atan
returns the angle whose trigonometric cosine is
+ acos
is
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
acos | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+acosh — return the arc hyperbolic cosine of the parameter
+
+ genType acosh(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value whose arc hyperbolic cosine to return. +
+
+ acosh
returns the arc hyperbolic cosine of
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
acosh | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+all — check whether all elements of a boolean vector are true
+
+ bool all(
+ |
+ bvec x) ; |
+
x
+
+
+ + Specifies the vector to be tested for truth. +
+
+ all
returns true if all elements of x
are true and false otherwise.
+ It is functionally equivalent to:
+
+
+bool all(bvec x) // bvec can be bvec2, bvec3 or bvec4 + { + bool result = true; + int i; + for (i = 0; i < x.length(); ++i) + { + result &= x[i]; + } + return result; + }+
+
++ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
all | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+any — check whether any element of a boolean vector is true
+
+ bool any(
+ |
+ bvec x) ; |
+
x
+
+
+ + Specifies the vector to be tested for truth. +
+
+ any
returns true if any element of x
is true and false otherwise.
+ It is functionally equivalent to:
+
+
+bool any(bvec x) // bvec can be bvec2, bvec3 or bvec4 + { + bool result = false; + int i; + for (i = 0; i < x.length(); ++i) + { + result |= x[i]; + } + return result; + }+
+
++ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
any | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+asin — return the arcsine of the parameter
+
+ genType asin(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value whose arcsine to return. +
+
+ atan
returns the angle whose trigonometric sine is
+ asin
is
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
asin | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+asinh — return the arc hyperbolic sine of the parameter
+
+ genType asinh(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value whose arc hyperbolic sine to return. +
+
+ asinh
returns the arc hyperbolic sine of
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
asinh | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+atan — return the arc-tangent of the parameters
+
+ genType atan(
+ |
+ genType y, | +
+ | genType x) ; |
+
+ genType atan(
+ |
+ genType y_over_x) ; |
+
y
+
+
+ + Specify the numerator of the fraction whose arctangent to return. +
+x
+
+
+ + Specify the denominator of the fraction whose arctangent to return. +
+y_over_x
+
+
+ + Specify the fraction whose arctangent to return. +
+
+ atan
returns the angle whose trigonometric arctangent is
+ atan
in this case are in the range
+
+ For the second overload, atan
returns the angle whose tangent is
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
atan | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+atanh — return the arc hyperbolic tangent of the parameter
+
+ genType atanh(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value whose arc hyperbolic tangent to return. +
+
+ atanh
returns the arc hyperbolic tangent of
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
atanh | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+ceil — find the nearest integer that is greater than or equal to the parameter
+
+ genType ceil(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value to evaluate. +
+
+ ceil
returns a value equal to the nearest integer that is
+ greater than or equal to x
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
ceil (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+clamp — constrain a value to lie between two further values
+
+ genType clamp(
+ |
+ genType x, | +
+ | genType minVal, | +
+ | genType maxVal) ; |
+
+ genType clamp(
+ |
+ genType x, | +
+ | float minVal, | +
+ | float maxVal) ; |
+
+ genIType clamp(
+ |
+ genIType x, | +
+ | genIType minVal, | +
+ | genIType maxVal) ; |
+
+ genIType clamp(
+ |
+ genIType x, | +
+ | int minVal, | +
+ | int maxVal) ; |
+
+ genUType clamp(
+ |
+ genUType x, | +
+ | genUType minVal, | +
+ | genUType maxVal) ; |
+
+ genUType clamp(
+ |
+ genUType x, | +
+ | uint minVal, | +
+ | uint maxVal) ; |
+
x
+
+
+ + Specify the value to constrain. +
+minVal
+
+
+
+ Specify the lower end of the range into which to constrain x
.
+
maxVal
+
+
+
+ Specify the upper end of the range into which to constrain x
.
+
+ clamp
returns the value of x
constrained to the
+ range minVal
to maxVal
. The returned value is
+ computed as
+ min(max(x
,
+ minVal
), maxVal
). The result is undefined if minVal
≥ maxVal
.
+
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
clamp (genType) | +✔ | +✔ | +
clamp (genIType) | +- | +✔ | +
clamp (genUType) | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+cos — return the cosine of the parameter
+
+ genType cos(
+ |
+ genType angle) ; |
+
angle
+
+
+ + Specify the quantity, in radians, of which to return the cosine. +
+
+ cos
returns the trigonometric cosine of angle
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
cos | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+cosh — return the hyperbolic cosine of the parameter
+
+ genType cosh(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value whose hyperbolic cosine to return. +
+
+ cosh
returns the hyperbolic cosine of
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
cosh | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+cross — calculate the cross product of two vectors
+
+ vec3 cross(
+ |
+ vec3 x, | +
+ | vec3 y) ; |
+
x
+
+
+ + Specifies the first of two vectors +
+y
+
+
+ + Specifies the second of two vectors +
+
+ cross
returns the cross product of two vectors, x
and y
. i.e.,
+
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
cross (vec3) | +✔ | +✔ | +
+ dot +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+dFdx, dFdy — return the partial derivative of an argument with respect to x or y
+
+ genType dFdx(
+ |
+ genType p) ; |
+
+ genType dFdy(
+ |
+ genType p) ; |
+
p
+
+
+ + Specifies the expression of which to take the partial derivative. +
+
+ Available only in the fragment shader, dFdx
and dFdy
+ return the partial derivative of expression p
in x and y, respectively. Deviatives are calculated
+ using local differencing. Expressions that imply higher order derivatives such as dFdx(dFdx(n))
have undefined
+ results, as do mixed-order derivatives such as dFdx(dFdy(n))
.
+ It is assumed that the expression p
is continuous and therefore, expressions evaluated
+ via non-uniform control flow may be undefined.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
dFdx | +- | +✔ | +
dFdy | +- | +✔ | +
+ fwidth +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+degrees — convert a quantity in radians to degrees
+
+ genType degrees(
+ |
+ genType radians) ; |
+
radians
+
+
+ + Specify the quantity, in radians, to be converted to degrees. +
+
+ degrees
converts a quantity, specified in radians into degrees. That is,
+ the return value is
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
degrees | +✔ | +✔ | +
radians | +✔ | +✔ | +
+ radians +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+determinant — calculate the determinant of a matrix
+
+ float determinant(
+ |
+ mat2 m) ; |
+
+ float determinant(
+ |
+ mat3 m) ; |
+
+ float determinant(
+ |
+ mat4 m) ; |
+
m
+
+
+ + Specifies the matrix of which to take the determinant. +
+
+ determinant
returns the determinant of the matrix m
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
determinant (float) | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+distance — calculate the distance between two points
+
+ float distance(
+ |
+ genType p0, | +
+ | genType p1) ; |
+
p0
+
+
+ + Specifies the first of two points +
+p1
+
+
+ + Specifies the second of two points +
+
+ distance
returns the distance between the two points p0
and p1
. i.e.,
+ length(
+ p0
- p1
);
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
distance (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+dot — calculate the dot product of two vectors
+
+ float dot(
+ |
+ genType x, | +
+ | genType y) ; |
+
x
+
+
+ + Specifies the first of two vectors +
+y
+
+
+ + Specifies the second of two vectors +
+
+ dot
returns the dot product of two vectors, x
and y
. i.e.,
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
dot (genType) | +✔ | +✔ | +
+ cross +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+equal — perform a component-wise equal-to comparison of two vectors
+
+ bvec equal(
+ |
+ vec x, | +
+ | vec y) ; |
+
+ bvec equal(
+ |
+ bvec x, | +
+ | bvec y) ; |
+
+ bvec equal(
+ |
+ ivec x, | +
+ | ivec y) ; |
+
+ bvec equal(
+ |
+ uvec x, | +
+ | uvec y) ; |
+
x
+
+
+ + Specifies the first vector to be used in the comparison operation. +
+y
+
+
+ + Specifies the second vector to be used in the comparison operation. +
+
+ equal
returns a boolean vector in which each element i is computed
+ as x
[i] == y
[i].
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
equal (vec) | +✔ | +✔ | +
equal (bvec) | +✔ | +✔ | +
equal (ivec) | +✔ | +✔ | +
equal (uvec) | +- | +✔ | +
+ lessThan, + lessThanEqual, + greaterThan, + greaterThanEqual, + notEqual, + any, + all, + not +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+exp — return the natural exponentiation of the parameter
+
+ genType exp(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value to exponentiate. +
+
+ exp
returns the natural exponentiation of x
. i.e.,
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
exp | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+exp2 — return 2 raised to the power of the parameter
+
+ genType exp2(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value of the power to which 2 will be raised. +
+
+ exp2
returns 2 raised to the power of x
. i.e.,
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
exp2 | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+faceforward — return a vector pointing in the same direction as another
+
+ genType faceforward(
+ |
+ genType N, | +
+ | genType I, | +
+ | genType Nref) ; |
+
N
+
+
+ + Specifies the vector to orient. +
+I
+
+
+ + Specifies the incident vector. +
+Nref
+
+
+ + Specifies the reference vector. +
+
+ faceforward
orients a vector to point away from a surface as defined by its normal.
+ If dot(
+ Nref
, I
) < 0faceforward
returns N
, otherwise it returns -
.
+ N
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
faceforward (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+floatBitsToInt — produce the encoding of a floating point value as an integer
+
+ genIType floatBitsToInt(
+ |
+ genType x) ; |
+
+ genUType floatBitsToUint(
+ |
+ genType x) ; |
+
x
+
+
+ + Specifies the value whose floating point encoding to return. +
+
+ floatBitsToInt
and floatBitsToUint
return the encoding
+ of their floating-point parameters as highp int
or uint
, respectively. The
+ floating-point bit-level representation is preserved. For mediump and lowp, the value is first
+ converted to highp floating point and the encoding of that value is returned.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
floatBitsToInt | +- | +✔ | +
floatBitsToUInt | +- | +✔ | +
+ intBitsToFloat, + uintBitsToFloat +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+floor — find the nearest integer less than or equal to the parameter
+
+ genType floor(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value to evaluate. +
+
+ floor
returns a value equal to the nearest integer that is less than or equal to x
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
floor (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+fract — compute the fractional part of the argument
+
+ genType fract(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value to evaluate. +
+
+ fract
returns the fractional part of x
. This
+ is calculated as x
- floor(x
).
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
fract (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+fwidth — return the sum of the absolute derivatives in x and y
+
+ genType fwidth(
+ |
+ genType p) ; |
+
p
+
+
+ + Specifies the expression of which to take the partial derivative. +
+
+ Available only in the fragment shader, fwidth
returns the sum of
+ the absolute derivatives in x and y using local differencing for the input argument p
.
+ It is equivalent to abs(dFdx(p)) + abs(dFdy(p))
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
fwidth | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glActiveTexture — select active texture unit
+
+ void glActiveTexture(
+ |
+ GLenum texture) ; |
+
texture
+
+
+
+ Specifies which texture unit to make active. The number
+ of texture units is implementation-dependent, but must be at least
+ 32. texture
must be one of
+ GL_TEXTURE
i,
+ where i ranges from zero to the
+ value of
+ GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
+ minus one. The initial value is
+ GL_TEXTURE0
.
+
+ glActiveTexture
selects which texture unit subsequent texture state calls will
+ affect. The number of texture units an implementation supports is
+ implementation-dependent, but must be at least 32.
+
+ GL_INVALID_ENUM
is generated if texture
is not one of
+ GL_TEXTURE
i, where
+ i ranges from zero to the value of
+ GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
minus
+ one.
+
+ glGet with argument GL_ACTIVE_TEXTURE
, or GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glActiveTexture | +✔ | +✔ | +
+ glGenTextures, + glBindTexture, + glCompressedTexImage2D, + glCompressedTexImage3D, + glCompressedTexSubImage2D, + glCompressedTexSubImage3D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glDeleteTextures + glIsTexture, + glTexImage2D, + glTexImage3D, + glTexSubImage2D, + glTexSubImage3D, + glTexParameter, +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glAttachShader — Attaches a shader object to a program object
+
+ void glAttachShader(
+ |
+ GLuint program, | +
+ | GLuint shader) ; |
+
program
+
+
+ Specifies the program object to which a shader + object will be attached.
+shader
+
+
+ Specifies the shader object that is to be attached.
+In order to create a complete shader program, there must be a way to
+ specify the list of things that will be linked together. Program
+ objects provide this mechanism. Shaders that are to be linked
+ together in a program object must first be attached to that
+ program object. glAttachShader
attaches the
+ shader object specified by shader
to the
+ program object specified by program
. This
+ indicates that shader
will be included in
+ link operations that will be performed on
+ program
.
All operations that can be performed on a shader object + are valid whether or not the shader object is attached to a + program object. It is permissible to attach a shader object to a + program object before source code has been loaded into the + shader object or before the shader object has been compiled. It + is not permissible to attach multiple shader objects of the same + type. + It is permissible to attach a shader object to more than + one program object. If a shader object is deleted while it is + attached to a program object, it will be flagged for deletion, + and deletion will not occur until + glDetachShader + is called to detach it from all program objects to which it is + attached.
+GL_INVALID_VALUE
is generated if either
+ program
or shader
+ is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_OPERATION
is generated if
+ shader
is already attached to
+ program
.
GL_INVALID_OPERATION
is generated if
+ a shader of the same type as shader
is
+ already attached to program
.
+ glGetAttachedShaders + with the handle of a valid program object +
+ + ++ glIsProgram +
++ glIsShader +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glAttachShader | +✔ | +✔ | +
+ glCompileShader, + glCreateShader, + glDeleteShader, + glDetachShader, + glLinkProgram, + glShaderSource +
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBeginQuery — delimit the boundaries of a query object
+
+ void glBeginQuery(
+ |
+ GLenum target, | +
+ | GLuint id) ; |
+
+ void glEndQuery(
+ |
+ GLenum target) ; |
+
glBeginQuery
target
+
+
+
+ Specifies the target type of query object established between
+ glBeginQuery
and the subsequent glEndQuery
.
+ The symbolic constant must be one of GL_ANY_SAMPLES_PASSED
, GL_ANY_SAMPLES_PASSED_CONSERVATIVE
,
+ or GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
.
+
id
+
+
+ + Specifies the name of a query object. +
+glEndQuery
target
+
+
+
+ Specifies the target type of query object to be concluded.
+ The symbolic constant must be one of GL_ANY_SAMPLES_PASSED
, GL_ANY_SAMPLES_PASSED_CONSERVATIVE
,
+ or GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
.
+
+ glBeginQuery
and glEndQuery delimit the
+ boundaries of a query object. query
must be a name previously returned from a call to
+ glGenQueries. If a query object with name id
+ does not yet exist it is created with the type determined by target
. target
must
+ be one of GL_ANY_SAMPLES_PASSED
, GL_ANY_SAMPLES_PASSED_CONSERVATIVE
,
+ or GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
. The behavior of the query
+ object depends on its type and is as follows.
+
+ If target
is GL_ANY_SAMPLES_PASSED
, id
must be an unused name,
+ or the name of an existing boolean occlusion query object.
+ When glBeginQuery
is executed, the query object's samples-passed flag is reset to GL_FALSE
.
+ Subsequent rendering causes the flag to be set to GL_TRUE
if any sample passes the depth test. When
+ glEndQuery
is executed, the samples-passed flag is assigned to the query object's result value. This value can
+ be queried by calling glGetQueryObjectuiv with pname
+ GL_QUERY_RESULT
.
+
+ If target
is GL_ANY_SAMPLES_PASSED_CONSERVATIVE
, id
must be an unused name,
+ or the name of an existing boolean occlusion query object.
+ When glBeginQuery
is executed, the query object's samples-passed flag is reset to GL_FALSE
.
+ Subsequent rendering causes the flag to be set to GL_TRUE
if any sample passes the depth test. The implementation
+ may choose to use a less precision version of the test, which can additionally set the samples-passed flag to GL_TRUE
+ in some other implementation-dependent cases. When glEndQuery
is executed, the samples-passed flag is assigned to
+ the query object's result value. This value can be queried by calling glGetQueryObjectuiv
+ with pname
GL_QUERY_RESULT
.
+
+ If target
is GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
, id
must be
+ an unused name, or the name of an existing primitive query object previously bound to the GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
+ query binding. When glBeginQuery
is executed, the query object's primitives-written counter is reset to 0. Subsequent
+ rendering will increment the counter once for every vertex that is written into the bound transform feedback buffer(s). If transform feedback
+ mode is not activated between the call to glBeginQuery
and glEndQuery
, the counter will not be
+ incremented. When glEndQuery
is executed, the primitives-written counter is assigned to
+ the query object's result value. This value can be queried by calling glGetQueryObjectuiv with pname
+ GL_QUERY_RESULT
.
+
+ GL_INVALID_ENUM
is generated if target
is not one of the accepted tokens.
+
+ GL_INVALID_OPERATION
is generated if glBeginQuery
is executed while
+ a query object of the same target
is already active. Note: GL_ANY_SAMPLES_PASSED
+ and GL_ANY_SAMPLES_PASSED_CONSERVATIVE
alias to the same target for the purposes of this error.
+
+ GL_INVALID_OPERATION
is generated if glEndQuery
+ is executed when a query object of the same target
is not active.
+
+ GL_INVALID_OPERATION
is generated if id
is 0.
+
+ GL_INVALID_OPERATION
is generated if id
not a name returned from a previous call to
+ glGenQueries
, or if such a name has since been deleted with glDeleteQueries
.
+
+ GL_INVALID_OPERATION
is generated if id
is the name of an already active query object.
+
+ GL_INVALID_OPERATION
is generated if id
refers to an existing query object whose type
+ does not does not match target
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glBeginQuery
+ |
+ - | +✔ | +
+ glEndQuery
+ |
+ - | +✔ | +
+ glDeleteQueries, + glGenQueries, + glGetQueryiv, + glGetQueryObjectuiv, + glIsQuery +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBeginTransformFeedback — start transform feedback operation
+
+ void glBeginTransformFeedback(
+ |
+ GLenum primitiveMode) ; |
+
+ void glEndTransformFeedback(
+ |
+ void) ; |
+
glBeginTransformFeedback
primitiveMode
+
+
+ + Specify the output type of the primitives that will be recorded into the + buffer objects that are bound for transform feedback. +
+
+ Transform feedback mode captures the values of varying variables written by the vertex shader.
+ Transform feedback is said to be active after a call to glBeginTransformFeedback
+ until a subsequent call to glEndTransformFeedback
.
+ Transform feedback commands must be paired. An implicit glResumeTransformFeedback
+ is performed by glEndTransformFeedback
if the transform feedback is paused.
+ Transform feedback is restricted to non-indexed GL_POINTS
, GL_LINES
, and
+ GL_TRIANGLES
.
+
+ While transform feedback is active the mode
parameter to
+ glDrawArrays must exactly match the
+ primitiveMode
specified by glBeginTransformFeedback
.
+
+ GL_INVALID_OPERATION
is generated if glBeginTransformFeedback
is executed
+ while transform feedback is active.
+
+ GL_INVALID_ENUM
is generated by glBeginTransformFeedback
if primitiveMode
+ is not one of GL_POINTS
, GL_LINES
, or GL_TRIANGLES
.
+
+ GL_INVALID_OPERATION
is generated if glEndTransformFeedback
is executed
+ while transform feedback is not active.
+
+ GL_INVALID_OPERATION
is generated by glDrawArrays
+ and glDrawArraysInstanced if transform feedback is active
+ and mode
does not exactly match primitiveMode
.
+
+ GL_INVALID_OPERATION
is generated by glDrawElements,
+ glDrawElementsInstanced, and
+ glDrawRangeElements if transform feedback is active and not paused.
+
+ GL_INVALID_OPERATION
is generated by glBeginTransformFeedback
if any binding
+ point used in transform feedback mode does not have a buffer object bound. In interleaved mode, only the first buffer
+ object binding point is ever written to.
+
+ GL_INVALID_OPERATION
is generated by glBeginTransformFeedback
if no binding
+ points would be used, either because no program object is active of because the active program object has specified
+ no varying variables to record.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glBeginTransformFeedback
+ |
+ - | +✔ | +
+ glEndTransformFeedback
+ |
+ - | +✔ | +
+ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBindAttribLocation — Associates a generic vertex attribute index with a named attribute variable
+
+ void glBindAttribLocation(
+ |
+ GLuint program, | +
+ | GLuint index, | +
+ | const GLchar *name) ; |
+
program
+
+
+ Specifies the handle of the program object in + which the association is to be made.
+index
+
+
+ Specifies the index of the generic vertex + attribute to be bound.
+name
+
+
+ Specifies a null terminated string containing
+ the name of the vertex shader attribute variable to
+ which index
is to be
+ bound.
glBindAttribLocation
is used to
+ associate a user-defined attribute variable in the program
+ object specified by program
with a
+ generic vertex attribute index. The name of the user-defined
+ attribute variable is passed as a null terminated string in
+ name
. The generic vertex attribute index
+ to be bound to this variable is specified by
+ index
. When
+ program
is made part of current state,
+ values provided via the generic vertex attribute
+ index
will modify the value of the
+ user-defined attribute variable specified by
+ name
.
If name
refers to a matrix
+ attribute variable, index
refers to the
+ first column of the matrix. Other matrix columns are then
+ automatically bound to locations index+1
+ for a matrix of type mat2
; index+1
and
+ index+2
for a matrix of type mat3
; and
+ index+1
, index+2
,
+ and index+3
for a matrix of type
+ mat4
.
This command makes it possible for vertex shaders to use
+ descriptive names for attribute variables rather than generic
+ variables that are numbered from zero to the value of
+ GL_MAX_VERTEX_ATTRIBS
minus one. The values sent
+ to each generic attribute index are part of current state.
+ If a different program object is made current by calling
+ glUseProgram,
+ the generic vertex attributes are tracked in such a way that the
+ same values will be observed by attributes in the new program
+ object that are also bound to
+ index
.
Attribute variable
+ name-to-generic attribute index bindings for a program object
+ can be explicitly assigned at any time by calling
+ glBindAttribLocation
. Attribute bindings do
+ not go into effect until
+ glLinkProgram
+ is called. After a program object has been linked successfully,
+ the index values for generic attributes remain fixed (and their
+ values can be queried) until the next link command
+ occurs.
Any attribute binding that occurs after the program object has been linked will not take effect + until the next time the program object is linked.
+glBindAttribLocation
can be called
+ before any vertex shader objects are bound to the specified
+ program object. It is also permissible to bind a generic
+ attribute index to an attribute variable name that is never used
+ in a vertex shader.
If name
was bound previously, that
+ information is lost. Thus you cannot bind one user-defined
+ attribute variable to multiple indices, but you can bind
+ multiple user-defined attribute variables to the same
+ index.
Applications are allowed to bind more than one + user-defined attribute variable to the same generic vertex + attribute index. This is called aliasing, + and it is allowed only if just one of the aliased attributes is + active in the executable program, or if no path through the + shader consumes more than one attribute of a set of attributes + aliased to the same location. The compiler and linker are + allowed to assume that no aliasing is done and are free to + employ optimizations that work only in the absence of aliasing. + OpenGL implementations are not required to do error checking to + detect aliasing.
+Active attributes that are not explicitly bound will be + bound by the linker when + glLinkProgram + is called. The locations assigned can be queried by calling + glGetAttribLocation.
+OpenGL copies the name
string when
+ glBindAttribLocation
is called, so an
+ application may free its copy of the name
+ string immediately after the function returns.
Generic attribute locations may be specified in the shader source
+ text using a location
layout qualifier. In this case,
+ the location of the attribute specified in the shader's source takes precedence
+ and may be queried by calling glGetAttribLocation.
+
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to
+ GL_MAX_VERTEX_ATTRIBS
.
GL_INVALID_OPERATION
is generated if
+ name
starts with the reserved prefix
+ "gl_".
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
glGetActiveAttrib
+ with argument program
glGetAttribLocation
+ with arguments program
and
+ name
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindAttribLocation | +✔ | +✔ | +
glDisableVertexAttribArray, + glEnableVertexAttribArray, + glUseProgram, + glVertexAttrib, + glVertexAttribPointer
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBindBuffer — bind a named buffer object
+
+ void glBindBuffer(
+ |
+ GLenum target, | +
+ | GLuint buffer) ; |
+
target
+
+
+
+ Specifies the target to which the buffer object is bound.
+ The symbolic constant must be
+ GL_ARRAY_BUFFER
,
+ GL_COPY_READ_BUFFER
,
+ GL_COPY_WRITE_BUFFER
,
+ GL_ELEMENT_ARRAY_BUFFER
,
+ GL_PIXEL_PACK_BUFFER
,
+ GL_PIXEL_UNPACK_BUFFER
,
+ GL_TRANSFORM_FEEDBACK_BUFFER
, or
+ GL_UNIFORM_BUFFER
.
+
buffer
+
+
+ + Specifies the name of a buffer object. +
+
+ glBindBuffer
binds a buffer object to the specified buffer binding point. Calling glBindBuffer
with
+ target
set to one of the accepted symbolic constants and buffer
set to the name
+ of a buffer object binds that buffer object name to the target. If no buffer object with name buffer
+ exists, one is created with that name. When a buffer object is bound to a target, the previous binding for that
+ target is automatically broken.
+
+ Buffer object names are unsigned integers. The value zero is reserved, but
+ there is no default buffer object for each buffer object target. Instead, buffer
set to zero
+ effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target (if supported for that target).
+ Buffer object names and the corresponding buffer object contents are local to
+ the shared object space of the current
+ GL rendering context;
+ two rendering contexts share buffer object names only if they
+ explicitly enable sharing between contexts through the appropriate GL windows interfaces functions.
+
+ glGenBuffers may be used to generate a set of unused buffer object names. +
+
+ The state of a buffer object immediately after it is first bound is an unmapped zero-sized memory buffer with
+ GL_READ_WRITE
access and GL_STATIC_DRAW
usage.
+
+ While a non-zero buffer object name is bound, GL operations on the target to which it is
+ bound affect the bound buffer object, and queries of the target to which it is bound return state
+ from the bound buffer object. While buffer object name zero is bound, as in the initial state,
+ attempts to modify or query state on the target to which it is bound generates an
+ GL_INVALID_OPERATION
error.
+
+ When a non-zero buffer object is bound to the GL_ARRAY_BUFFER
target,
+ the vertex array pointer parameter is interpreted as an offset within the
+ buffer object measured in basic machine units.
+
+ While a non-zero buffer object is bound to the GL_ELEMENT_ARRAY_BUFFER
target,
+ the indices parameter of glDrawElements,
+ glDrawElementsInstanced,
+ glDrawRangeElements,
+ offset within the buffer object measured in basic machine units.
+
+ While a non-zero buffer object is bound to the GL_PIXEL_PACK_BUFFER
target,
+ the following commands are affected: glReadPixels.
+ The pointer parameter is interpreted as an offset within the buffer object measured in basic machine units.
+
+ While a non-zero buffer object is bound to the GL_PIXEL_UNPACK_BUFFER
target,
+ the following commands are affected:
+ glCompressedTexImage2D,
+ glCompressedTexImage3D,
+ glCompressedTexSubImage2D,
+ glCompressedTexSubImage3D,
+ glTexImage2D,
+ glTexImage3D,
+ glTexSubImage2D, and
+ glTexSubImage3D. The pointer parameter is
+ interpreted as an offset within the buffer object measured in basic machine units.
+
+ The buffer targets GL_COPY_READ_BUFFER
and GL_COPY_WRITE_BUFFER
+ are provided to allow glCopyBufferSubData
+ to be used without disturbing the state of other bindings. However, glCopyBufferSubData
+ may be used with any pair of buffer binding points.
+
+ The GL_TRANSFORM_FEEDBACK_BUFFER
buffer binding point may be passed to glBindBuffer
,
+ but will not directly affect transform feedback state. Instead, the indexed GL_TRANSFORM_FEEDBACK_BUFFER
+ bindings must be used through a call to glBindBufferBase
+ or glBindBufferRange. This will affect the generic
+ GL_TRANSFORM_FEEDBACK_BUFFER
binding.
+
+ Likewise, the GL_UNIFORM_BUFFER
buffer binding point may be used, but does not directly affect
+ uniform buffer state. glBindBufferBase
+ or glBindBufferRange must be used to bind a buffer to
+ an indexed uniform buffer binding point.
+
+ A buffer object binding created with glBindBuffer
remains active until a different
+ buffer object name is bound to the same target, or until the bound buffer object is
+ deleted with glDeleteBuffers.
+
+ Once created, a named buffer object may be re-bound to any target as often as needed. However, + the GL implementation may make choices about how to optimize the storage of a buffer object based + on its initial binding target. +
+
+ GL_INVALID_ENUM
is generated if target
is not one of the allowable
+ values.
+
+ glGet with argument GL_ARRAY_BUFFER_BINDING
+
+ glGet with argument GL_COPY_READ_BUFFER_BINDING
+
+ glGet with argument GL_COPY_WRITE_BUFFER_BINDING
+
+ glGet with argument GL_ELEMENT_ARRAY_BUFFER_BINDING
+
+ glGet with argument GL_PIXEL_PACK_BUFFER_BINDING
+
+ glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
+
+ glGet with argument GL_TRANSFORM_FEEDBACK_BUFFER_BINDING
+
+ glGet with argument GL_UNIFORM_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindBuffer | +✔ | +✔ | +
+ glGenBuffers, + glBindBufferBase, + glBindBufferRange, + glMapBufferRange, + glUnmapBuffer, + glDeleteBuffers, + glGet, + glIsBuffer +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBindBufferBase — bind a buffer object to an indexed buffer target
+
+ void glBindBufferBase(
+ |
+ GLenum target, | +
+ | GLuint index, | +
+ | GLuint buffer) ; |
+
target
+
+
+
+ Specify the target of the bind operation. target
must be
+ either GL_TRANSFORM_FEEDBACK_BUFFER
or GL_UNIFORM_BUFFER
.
+
index
+
+
+
+ Specify the index of the binding point within the array specified by target
.
+
buffer
+
+
+ + The name of a buffer object to bind to the specified binding point. +
+
+ glBindBufferBase
binds the buffer object buffer
+ to the binding point at index index
of the array of targets specified
+ by target
. Each target
represents an indexed
+ array of buffer binding points, as well as a single general binding point that can be used by
+ other buffer manipulation functions such as glBindBuffer
+ or glMapBufferRange. In addition to binding
+ buffer
to the indexed buffer binding target, glBindBufferBase
+ also binds buffer
to the generic buffer binding point specified by target
.
+
+ Calling glBindBufferBase
binds the entire buffer, even when the size of the buffer is
+ changed after the binding is established. The starting offset is zero, and the amount
+ of data that can be read from or written to the buffer is determined by the size of
+ the bound buffer at the time the binding is used.
+
+ GL_INVALID_ENUM
is generated if target
is not
+ GL_TRANSFORM_FEEDBACK_BUFFER
or GL_UNIFORM_BUFFER
.
+
+ GL_INVALID_VALUE
is generated if target
is
+ GL_TRANSFORM_FEEDBACK_BUFFER
and index
is greater
+ than or equal to GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
.
+
+ GL_INVALID_VALUE
is generated if target
is
+ GL_UNIFORM_BUFFER
and index
is greater
+ than or equal to GL_MAX_UNIFORM_BUFFER_BINDINGS
.
+
+ glGet with argument GL_MAX_UNIFORM_BUFFER_BINDINGS
, or GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindBufferBase | +- | +✔ | +
+ glGenBuffers, + glDeleteBuffers, + glBindBuffer, + glBindBufferRange, + glMapBufferRange, + glUnmapBuffer, +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBindBufferRange — bind a range within a buffer object to an indexed buffer target
+
+ void glBindBufferRange(
+ |
+ GLenumtarget, | +
+ | GLuintindex, | +
+ | GLuintbuffer, | +
+ | GLintptroffset, | +
+ | GLsizeiptrsize) ; |
+
target
+
+
+
+ Specify the target of the bind operation. target
must be
+ either GL_TRANSFORM_FEEDBACK_BUFFER
or GL_UNIFORM_BUFFER
.
+
index
+
+
+
+ Specify the index of the binding point within the array specified by target
.
+
buffer
+
+
+ + The name of a buffer object to bind to the specified binding point. +
+offset
+
+
+
+ The starting offset in basic machine units into the buffer object buffer
.
+
size
+
+
+ + The amount of data in machine units that can be read from the buffet object while used as an indexed target. +
+
+ glBindBufferRange
binds a range of the buffer object buffer
+ represented by offset
and size
to the
+ binding point at index index
of the array of targets specified by target
.
+ Each target
represents an indexed array of buffer binding points, as well
+ as a single general binding point that can be used by other buffer manipulation functions such as
+ glBindBuffer or
+ glMapBufferRange. In addition to binding
+ a range of buffer
to the indexed buffer binding target, glBindBufferBase
+ also binds the range to the generic buffer binding point specified by target
.
+
+ offset
specifies the offset in basic machine units into the buffer object
+ buffer
and size
specifies the amount of data that
+ can be read from the buffer object while used as an indexed target.
+
+ GL_INVALID_ENUM
is generated if target
is not
+ GL_TRANSFORM_FEEDBACK_BUFFER
or GL_UNIFORM_BUFFER
.
+
+ GL_INVALID_VALUE
is generated if target
is
+ GL_TRANSFORM_FEEDBACK_BUFFER
andindex
is greater
+ than or equal to GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
.
+
+ GL_INVALID_VALUE
is generated if target
is
+ GL_UNIFORM_BUFFER
andindex
is greater
+ than or equal to GL_MAX_UNIFORM_BUFFER_BINDINGS
.
+
+ GL_INVALID_VALUE
is generated if buffer
is not
+ zero and size
is less than or equal to zero.
+
+ GL_INVALID_VALUE
is generated if target
is
+ GL_TRANSFORM_FEEDBACK_BUFFER
and size
or
+ offset
are not multiples of 4.
+
+ GL_INVALID_VALUE
is generated if target
is
+ GL_UNIFORM_BUFFER
and offset
is not a multiple of
+ GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT
.
+
+ glGet with argument GL_MAX_UNIFORM_BUFFER_BINDINGS
,
+ GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
, or GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindBufferRange | +- | +✔ | +
+ glGenBuffers, + glDeleteBuffers, + glBindBuffer, + glBindBufferBase, + glMapBufferRange, + glUnmapBuffer, +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBindFramebuffer — bind a framebuffer to a framebuffer target
+
+ void glBindFramebuffer(
+ |
+ GLenum target, | +
+ | GLuint framebuffer) ; |
+
target
+
+
+ + Specifies the framebuffer target of the binding operation. +
+framebuffer
+
+
+ + Specifies the name of the framebuffer object to bind. +
+
+ glBindFramebuffer
binds the framebuffer object with name framebuffer
to the framebuffer target specified
+ by target
. target
must be either GL_DRAW_FRAMEBUFFER
,
+ GL_READ_FRAMEBUFFER
or GL_FRAMEBUFFER
. If a framebuffer object is bound to
+ GL_DRAW_FRAMEBUFFER
or GL_READ_FRAMEBUFFER
, it becomes the target for
+ rendering or readback operations, respectively, until it is deleted or another framebuffer is bound to the corresponding bind point.
+ Calling glBindFramebuffer
with target
set to GL_FRAMEBUFFER
binds
+ framebuffer
to both the read and draw framebuffer targets.
+
+ glGenFramebuffers may be used to generate a set of unused framebuffer object names. +
++ The storage, dimensions, allocation, and format of the images attached to the default framebuffer are managed entirely + by the window system. In order that access to the default framebuffer is not lost, it is treated as a framebuffer object with the name of zero. + The default framebuffer is therefore rendered to and read from while zero is bound to the corresponding targets. +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_DRAW_FRAMEBUFFER
,
+ GL_READ_FRAMEBUFFER
or GL_FRAMEBUFFER
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindFramebuffer | +✔ | +✔ | +
+ glGenFramebuffers, + glDeleteFramebuffers, + glFramebufferRenderbuffer, + glFramebufferTexture2D, + glFramebufferTextureLayer, + glIsFramebuffer +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBindRenderbuffer — bind a renderbuffer to a renderbuffer target
+
+ void glBindRenderbuffer(
+ |
+ GLenum target, | +
+ | GLuint renderbuffer) ; |
+
target
+
+
+
+ Specifies the renderbuffer target of the binding operation. target
must be GL_RENDERBUFFER
.
+
renderbuffer
+
+
+ + Specifies the name of the renderbuffer object to bind. +
+
+ glBindRenderbuffer
binds the renderbuffer object with name renderbuffer
to the renderbuffer target specified
+ by target
. target
must be GL_RENDERBUFFER
. Calling
+ glBindRenderbuffer
with renderbuffer
set to a value of zero breaks the
+ existing binding of a renderbuffer object to target
.
+
+ glGenRenderbuffers may be used to generate a set of unused renderbuffer object names. +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_RENDERBUFFER
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindRenderbuffer | +✔ | +✔ | +
+ glGenRenderbuffers, + glDeleteRenderbuffers, + glRenderbufferStorage, + glRenderbufferStorageMultisample, + glIsRenderbuffer +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBindSampler — bind a named sampler to a texturing target
+
+ void glBindSampler(
+ |
+ GLuint unit, | +
+ | GLuint sampler) ; |
+
unit
+
+
+ + Specifies the index of the texture unit to which the sampler is bound. +
+sampler
+
+
+ + Specifies the name of a sampler. +
+
+ glBindSampler
binds sampler
to the texture unit at index unit
.
+ sampler
must be zero or the name of a sampler object previously returned from a call to
+ glGenSamplers. unit
must be less than the value
+ of GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
.
+
+ When a sampler object is bound to a texture unit, its state supersedes that of + the texture object bound to that texture unit. If the sampler name zero is bound to + a texture unit, the currently bound texture's sampler state becomes active. A single + sampler object may be bound to multiple texture units simultaneously. +
+
+ GL_INVALID_VALUE
is generated if unit
is greater than or equal to the value of
+ GL_MAX_COMBIED_TEXTURE_IMAGE_UNITS
.
+
+ GL_INVALID_OPERATION
is generated if sampler
is not zero or a name previously
+ returned from a call to glGenSamplers, or if such a name has
+ been deleted by a call to glDeleteSamplers.
+
+ glGet with argument GL_SAMPLER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindSampler | +- | +✔ | +
+ glGenSamplers, + glDeleteSamplers, + glGet, + glSamplerParameter, + glGetSamplerParameter, + glGenTextures, + glBindTexture, + glDeleteTextures +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBindTexture — bind a named texture to a texturing target
+
+ void glBindTexture(
+ |
+ GLenum target, | +
+ | GLuint texture) ; |
+
target
+
+
+
+ Specifies the target to which the texture is bound.
+ Must be either
+ GL_TEXTURE_2D
,
+ GL_TEXTURE_3D
,
+ GL_TEXTURE_2D_ARRAY
, or
+ GL_TEXTURE_CUBE_MAP
,
+
texture
+
+
+ + Specifies the name of a texture. +
+
+ glBindTexture
binds the texture object with name texture
to the texture target specified
+ by target
. Calling glBindTexture
with
+ target
set to
+ GL_TEXTURE_2D
, GL_TEXTURE_3D
, GL_TEXTURE_2D_ARRAY
, or
+ GL_TEXTURE_CUBE_MAP
and texture
set to the name of the new texture binds the
+ texture name to that target. When a texture is bound to a target, the previous binding for that target is automatically broken.
+
+ Texture names are unsigned integers. The value zero is reserved to + represent the default texture for each texture target. + Texture names and the corresponding texture contents are local to + the shared object space of the current GL rendering context; + two rendering contexts share texture names only if they + explicitly enable sharing between contexts through the appropriate GL windows interfaces functions. +
++ You must use glGenTextures to generate a set of new texture names. +
+
+ When a texture is first bound, it assumes the specified target:
+ A texture first bound to GL_TEXTURE_2D
becomes two-dimensional texture, a
+ texture first bound to GL_TEXTURE_3D
becomes three-dimensional texture, a
+ texture first bound to GL_TEXTURE_2D_ARRAY
becomes two-dimensional arary texture, and a
+ texture first bound to GL_TEXTURE_CUBE_MAP
becomes a cube-mapped texture.
+ The state of a two-dimensional texture immediately after it is first bound is equivalent to the state of the
+ default GL_TEXTURE_2D
at GL initialization, and similarly for the other texture types.
+
+ While a texture is bound, GL operations on the target to which it is + bound affect the bound texture, and queries of the target to which it + is bound return state from the bound texture. + In effect, the texture targets become aliases for the textures currently + bound to them, and the texture name zero refers to the default textures + that were bound to them at initialization. +
+
+ A texture binding created with glBindTexture
remains active until a different
+ texture is bound to the same target, or until the bound texture is
+ deleted with glDeleteTextures.
+
+ Once created, a named texture may be re-bound to its same original target as often as needed.
+ It is usually much faster to use glBindTexture
to bind an existing named
+ texture to one of the texture targets than it is to reload the texture image
+ using glTexImage2D,
+ glTexImage3D or another similar function.
+
+ Texture binding is affected by the setting of the state GL_ACTIVE_TEXTURE
(see
+ glActiveTexture).
+ A texture object may be bound to more than one texture unit simultaneously.
+
+ GL_INVALID_ENUM
is generated if target
is not one of the allowable
+ values.
+
+ GL_INVALID_OPERATION
is generated if texture
was previously created with a target
+ that doesn't match that of target
.
+
+ glGet with argument GL_TEXTURE_BINDING_2D
,
+ GL_TEXTURE_BINDING_3D
, GL_TEXTURE_BINDING_2D_ARRAY
, or GL_TEXTURE_BINDING_CUBE_MAP
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindTexture | +✔ | +✔ | +
+ glDeleteTextures, + glGenTextures, + glGet, + glGetTexParameter, + glIsTexture, + glTexImage2D, + glTexImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glBindTransformFeedback — bind a transform feedback object
+
+ void glBindTransformFeedback(
+ |
+ GLenum target, | +
+ | GLuint id) ; |
+
target
+
+
+
+ Specifies the target to which to bind the transform feedback object id
. target
+ must be GL_TRANSFORM_FEEDBACK
.
+
id
+
+
+ + Specifies the name of a transform feedback object reserved by glGenTransformFeedbacks. +
+
+ glBindTransformFeedback
binds the transform feedback object with name id
to the current
+ GL state. id
must be a name previously returned from a call to
+ glGenTransformFeedbacks. If id
has not
+ previously been bound, a new transform feedback object with name id
and initialized with with the
+ default transform state vector is created.
+
+ In the initial state, a default transform feedback object is bound and treated as + a transform feedback object with a name of zero. If the name zero is subsequently bound, the default + transform feedback object is again bound to the GL state. +
++ While a transform feedback buffer object is bound, GL operations on the target + to which it is bound affect the bound transform feedback object, and queries of the + target to which a transform feedback object is bound return state from the bound + object. When buffer objects are bound for transform feedback, they are attached to + the currently bound transform feedback object. Buffer objects are used for transform feedback only if they are attached + to the currently bound transform feedback object. +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TRANSFORM_FEEDBACK
.
+
+ GL_INVALID_OPERATION
is generated if the transform feedback operation is
+ active on the currently bound transform feedback object, and that operation is not paused.
+
+ GL_INVALID_OPERATION
is generated if id
is not
+ zero or the name of a transform feedback object returned from a previous call to
+ glGenTransformFeedbacks, or
+ if such a name has been deleted by glDeleteTransformFeedbacks.
+
+ glGet with argument GL_TRANSFORM_FEEDBACK_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindTransformFeedback | +- | +✔ | +
+ glGenTransformFeedbacks, + glDeleteTransformFeedbacks, + glIsTransformFeedback, + glBeginTransformFeedback, + glPauseTransformFeedback, + glResumeTransformFeedback, + glEndTransformFeedback +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBindVertexArray — bind a vertex array object
+
+ void glBindVertexArray(
+ |
+ GLuint array) ; |
+
array
+
+
+ + Specifies the name of the vertex array to bind. +
+
+ glBindVertexArray
binds the vertex array object with name array
. array
+ is the name of a vertex array object previously returned from a call to glGenVertexArrays,
+ or zero to bind the default vertex array object binding.
+
+ If no vertex array object with name array
exists, one is created when array
is first bound. If the bind
+ is successful no change is made to the state of the vertex array object, and any previous vertex array object binding is broken.
+
+ GL_INVALID_OPERATION
is generated if array
is not zero or the name of a vertex array object
+ previously returned from a call to glGenVertexArrays.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBindVertexArray | +- | +✔ | +
+ glGenVertexArrays, + glDeleteVertexArrays + glVertexAttribPointer + glEnableVertexAttribArray +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBlendColor — set the blend color
+
+ void glBlendColor(
+ |
+ GLfloat red, | +
+ | GLfloat green, | +
+ | GLfloat blue, | +
+ | GLfloat alpha) ; |
+
red
,
+ green
,
+ blue
,
+
+
+ alpha
+
+
+
+ specify the components of GL_BLEND_COLOR
+
+ The GL_BLEND_COLOR
may be used to calculate the source and destination
+ blending factors. If destination framebuffer components use an unsigned normalized
+ fixed-point representation, the constant color components are clamped to the range
+ GL_BLEND_COLOR
is set to (0, 0, 0, 0).
+
+ glGet with an argument of GL_BLEND_COLOR
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBlendColor | +✔ | +✔ | +
+ glBlendEquation, + glBlendFunc, + glGet +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glBlendEquation — specify the equation used for both the RGB blend equation and the Alpha blend equation
+
+ void glBlendEquation(
+ |
+ GLenum mode) ; |
+
mode
+
+
+
+ specifies how source and destination colors are combined.
+ It must be GL_FUNC_ADD
, GL_FUNC_SUBTRACT
,
+ GL_FUNC_REVERSE_SUBTRACT
, GL_MIN
, GL_MAX
.
+
+ The blend equations determine how a new pixel (the ''source'' color) + is combined with a pixel already in the framebuffer (the ''destination'' + color). This function sets both the RGB blend equation and the alpha + blend equation to a single equation. +
+
+ Calling this function is equivalent to calling glBlendEquationSeparate
+ with modeRGB
and modeAlpha
both set to the value of mode
.
+
+ These equations use the source and destination blend factors + specified by either glBlendFunc or + glBlendFuncSeparate. + See glBlendFunc or glBlendFuncSeparate + for a description of the various blend factors. +
+
+ In the equations that follow, source and destination
+ color components are referred to as
+
+ Mode + | ++ RGB Components + | ++ Alpha Component + | +
---|---|---|
+ GL_FUNC_ADD
+ |
+ + + + + | ++ + | +
+ GL_FUNC_SUBTRACT
+ |
+ + + + + | ++ + | +
+ GL_FUNC_REVERSE_SUBTRACT
+ |
+ + + + + | ++ + | +
+ GL_MIN
+ |
+ + + + + | ++ + | +
+ GL_MAX
+ |
+ + + + + | ++ + | +
+
+
+ The results of these equations are clamped to the range
+
+ The GL_MIN
and GL_MAX
equations are useful for applications
+ that analyze image data (image thresholding against a constant color,
+ for example).
+ The GL_FUNC_ADD
equation is useful
+ for antialiasing and transparency, among other things.
+
+ Initially, both the RGB blend equation and the alpha blend equation are set to GL_FUNC_ADD
.
+
+
+
+ The GL_MIN
, and GL_MAX
equations do not use
+ the source or destination factors, only the source and destination colors.
+
+ GL_INVALID_ENUM
is generated if mode
is not one of
+ GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, GL_FUNC_REVERSE_SUBTRACT
,
+ GL_MAX
, or GL_MIN
.
+
+ glGet with an argument of GL_BLEND_EQUATION_RGB
+
+ glGet with an argument of GL_BLEND_EQUATION_ALPHA
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBlendEquation | +✔ | +✔ | +
+ glBlendColor, + glBlendEquationSeparate + glBlendFunc + glBlendFuncSeparate +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glBlendEquationSeparate — set the RGB blend equation and the alpha blend equation separately
+
+ void glBlendEquationSeparate(
+ |
+ GLenum modeRGB, | +
+ | GLenum modeAlpha) ; |
+
modeRGB
+
+
+
+ specifies the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined.
+ It must be GL_FUNC_ADD
, GL_FUNC_SUBTRACT
,
+ GL_FUNC_REVERSE_SUBTRACT
, GL_MIN
, GL_MAX
.
+
modeAlpha
+
+
+
+ specifies the alpha blend equation, how the alpha component of the source and destination colors are combined.
+ It must be GL_FUNC_ADD
, GL_FUNC_SUBTRACT
,
+ GL_FUNC_REVERSE_SUBTRACT
, GL_MIN
, GL_MAX
.
+
+ The blend equations determines how a new pixel (the ''source'' color) + is combined with a pixel already in the framebuffer (the ''destination'' + color). This function specifies one blend equation for the RGB-color + components and one blend equation for the alpha component. +
++ The blend equations use the source and destination blend factors + specified by either glBlendFunc or + glBlendFuncSeparate. + See glBlendFunc or glBlendFuncSeparate + for a description of the various blend factors. +
+
+ In the equations that follow, source and destination
+ color components are referred to as
+
+ Mode + | ++ RGB Components + | ++ Alpha Component + | +
---|---|---|
+ GL_FUNC_ADD
+ |
+ + + + + | ++ + | +
+ GL_FUNC_SUBTRACT
+ |
+ + + + + | ++ + | +
+ GL_FUNC_REVERSE_SUBTRACT
+ |
+ + + + + | ++ + | +
+ GL_MIN
+ |
+ + + + + | ++ + | +
+ GL_MAX
+ |
+ + + + + | ++ + | +
+
+
+ The results of these equations are clamped to the range
+
+ The GL_MIN
and GL_MAX
equations are useful for applications
+ that analyze image data (image thresholding against a constant color,
+ for example).
+ The GL_FUNC_ADD
equation is useful
+ for antialiasing and transparency, among other things.
+
+ Initially, both the RGB blend equation and the alpha blend equation are set to GL_FUNC_ADD
.
+
+
+
+ The GL_MIN
, and GL_MAX
equations do not use
+ the source or destination factors, only the source and destination colors.
+
+ GL_INVALID_ENUM
is generated if either modeRGB
or modeAlpha
is not one of
+ GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, GL_FUNC_REVERSE_SUBTRACT
,
+ GL_MAX
, or GL_MIN
.
+
+ glGet with an argument of GL_BLEND_EQUATION_RGB
+
+ glGet with an argument of GL_BLEND_EQUATION_ALPHA
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBlendEquationSeparate | +✔ | +✔ | +
+ glGetString, + glBlendColor, + glBlendEquation, + glBlendFunc, + glBlendFuncSeparate +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glBlendFunc — specify pixel arithmetic
+
+ void glBlendFunc(
+ |
+ GLenum sfactor, | +
+ | GLenum dfactor) ; |
+
sfactor
+
+
+
+ Specifies how the red, green, blue,
+ and alpha source blending factors are computed.
+ The initial value is GL_ONE
.
+
dfactor
+
+
+
+ Specifies how the red, green, blue,
+ and alpha destination blending factors are computed.
+ The following symbolic constants are accepted:
+ GL_ZERO
,
+ GL_ONE
,
+ GL_SRC_COLOR
,
+ GL_ONE_MINUS_SRC_COLOR
,
+ GL_DST_COLOR
,
+ GL_ONE_MINUS_DST_COLOR
,
+ GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ GL_DST_ALPHA
,
+ GL_ONE_MINUS_DST_ALPHA
.
+ GL_CONSTANT_COLOR
,
+ GL_ONE_MINUS_CONSTANT_COLOR
,
+ GL_CONSTANT_ALPHA
, and
+ GL_ONE_MINUS_CONSTANT_ALPHA
.
+ The initial value is GL_ZERO
.
+
+ Pixels can be drawn using a function that blends
+ the incoming (source) RGBA values with the RGBA values
+ that are already in the frame buffer (the destination values).
+ Blending is initially disabled.
+ Use glEnable and glDisable with argument GL_BLEND
+ to enable and disable blending.
+
+ glBlendFunc
defines the operation of blending when it is enabled.
+ sfactor
specifies which method is used to scale the
+ source color components.
+ dfactor
specifies which method is used to scale the
+ destination color components.
+ Both parameters must be one of the following symbolic constants:
+ GL_ZERO
,
+ GL_ONE
,
+ GL_SRC_COLOR
,
+ GL_ONE_MINUS_SRC_COLOR
,
+ GL_DST_COLOR
,
+ GL_ONE_MINUS_DST_COLOR
,
+ GL_SRC_ALPHA
,
+ GL_ONE_MINUS_SRC_ALPHA
,
+ GL_DST_ALPHA
,
+ GL_ONE_MINUS_DST_ALPHA
,
+ GL_CONSTANT_COLOR
,
+ GL_ONE_MINUS_CONSTANT_COLOR
,
+ GL_CONSTANT_ALPHA
,
+ GL_ONE_MINUS_CONSTANT_ALPHA
,
+ GL_SRC_ALPHA_SATURATE
,
+ The possible methods are described in the following table.
+ Each method defines four scale factors,
+ one each for red, green, blue, and alpha.
+ In the table and in subsequent equations, source
+ and destination color components are referred to as
+
+ Source and destination scale factors are referred to as
+
+ Prior to blending, unsigned normalized fixed-point color components undergo
+ an implied conversion to floating-point using equation 2.1. This conversion must
+ leave the values 0 and 1 invariant. Blending computations are treated as if carried
+ out in floating-point and will be performed with a precision and dynamic range no
+ lower than that used to represent destination components.
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
for the
+ framebuffer attachment corresponding to the destination buffer is GL_SRGB
,
+ the R, G, and B destination color values (after conversion from fixed-point
+ to floating-point) are considered to be encoded for the sRGB color space and
+ hence must be linearized prior to their use in blending. Each R, G, and B component
+ is converted in the same fashion described for sRGB texture components.
+
+
++ Parameter + | ++ + + + | +
---|---|
+ GL_ZERO
+ |
+ + + | +
+ GL_ONE
+ |
+ + + | +
+ GL_SRC_COLOR
+ |
+ + + | +
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ + + | +
+ GL_DST_COLOR
+ |
+ + + | +
+ GL_ONE_MINUS_DST_COLOR
+ |
+ + + | +
+ GL_SRC_ALPHA
+ |
+ + + | +
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ + + | +
+ GL_DST_ALPHA
+ |
+ + + | +
+ GL_ONE_MINUS_DST_ALPHA
+ |
+ + + | +
+ GL_CONSTANT_COLOR
+ |
+ + + | +
+ GL_ONE_MINUS_CONSTANT_COLOR
+ |
+ + + | +
+ GL_CONSTANT_ALPHA
+ |
+ + + | +
+ GL_ONE_MINUS_CONSTANT_ALPHA
+ |
+ + + | +
+ GL_SRC_ALPHA_SATURATE
+ |
+ + + | +
+ In the table, +
+
+
+ To determine the blended RGBA values of a pixel, + the system uses the following equations: +
+
+
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
for the framebuffer
+ attachment corresponding to the destination buffer is GL_SRGB
, the R, G, and B
+ values after blending are converted into the non-linear sRGB color space by computing
+
+ where cl is the R, G, or B element and cs is the result (effectively converted into an
+ sRGB color space).
+ If GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
is not GL_SRGB
, then
+ cs = cl:
+ The resulting cs values for R, G, and B, and the unmodified A form a new
+ RGBA color value. If the color buffer is fixed-point, each component is clamped
+ to the range [0; 1] and then converted to a fixed-point value using equation
+
+
+
+ Transparency is best implemented using blend function
+ (GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
)
+ with primitives sorted from farthest to nearest.
+ Note that this transparency calculation does not require
+ the presence of alpha bitplanes in the frame buffer.
+
+ Blend function
+ (GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
)
+ is also useful for rendering antialiased points and lines
+ in arbitrary order.
+
+ Incoming (source) alpha is correctly thought of as a material opacity,
+ ranging from 1.0
+ (
+ When more than one color buffer is enabled for drawing, + the GL performs blending separately for each enabled buffer, + using the contents of that buffer for destination color. + (See glDrawBuffers.) +
+
+ GL_INVALID_ENUM
is generated if either sfactor
+ or dfactor
is not an accepted value.
+
+ glGet with argument GL_BLEND_SRC
+
+ glGet with argument GL_BLEND_DST
+
+ glIsEnabled with argument GL_BLEND
+
+
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBlendFunc | +✔ | +✔ | +
+ glBlendColor, + glBlendEquation, + glBlendFuncSeparate, + glClear, + glDrawBuffers, + glEnable, +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glBlendFuncSeparate — specify pixel arithmetic for RGB and alpha components separately
+
+ void glBlendFuncSeparate(
+ |
+ GLenum srcRGB, | +
+ | GLenum dstRGB, | +
+ | GLenum srcAlpha, | +
+ | GLenum dstAlpha) ; |
+
srcRGB
+
+
+
+ Specifies how the red, green, and blue blending factors are computed.
+ The initial value is GL_ONE
.
+
dstRGB
+
+
+
+ Specifies how the red, green, and blue destination blending factors are
+ computed.
+ The initial value is GL_ZERO
.
+
srcAlpha
+
+
+
+ Specified how the alpha source blending factor is computed.
+ The initial value is GL_ONE
.
+
dstAlpha
+
+
+
+ Specified how the alpha destination blending factor is computed.
+ The initial value is GL_ZERO
.
+
+ Pixels can be drawn using a function that blends
+ the incoming (source) RGBA values with the RGBA values
+ that are already in the frame buffer (the destination values).
+ Blending is initially disabled.
+ Use glEnable and glDisable with argument GL_BLEND
+ to enable and disable blending.
+
+ glBlendFuncSeparate
defines the operation of blending when it is enabled.
+ srcRGB
specifies which method is used to scale the
+ source RGB-color components.
+ dstRGB
specifies which method is used to scale the
+ destination RGB-color components.
+ Likewise, srcAlpha
specifies which method is used to scale the source alpha
+ color component, and dstAlpha
specifies which method is used to scale the
+ destination alpha component.
+ The possible methods are described in the following table.
+ Each method defines four scale factors,
+ one each for red, green, blue, and alpha.
+
+ In the table and in subsequent equations, source and destination
+ color components are referred to as
+
+ Source and destination scale factors are referred to as
+
+ Prior to blending, unsigned normalized fixed-point color components undergo
+ an implied conversion to floating-point using equation 2.1. This conversion must
+ leave the values 0 and 1 invariant. Blending computations are treated as if carried
+ out in floating-point and will be performed with a precision and dynamic range no
+ lower than that used to represent destination components.
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
for the
+ framebuffer attachment corresponding to the destination buffer is GL_SRGB
,
+ the R, G, and B destination color values (after conversion from fixed-point
+ to floating-point) are considered to be encoded for the sRGB color space and
+ hence must be linearized prior to their use in blending. Each R, G, and B component
+ is converted in the same fashion described for sRGB texture components.
+
+
++ Parameter + | ++ RGB Factor + | ++ Alpha Factor + | +
---|---|---|
+ GL_ZERO
+ |
+ + + | ++ + | +
+ GL_ONE
+ |
+ + + | ++ + | +
+ GL_SRC_COLOR
+ |
+ + + | ++ + | +
+ GL_ONE_MINUS_SRC_COLOR
+ |
+ + + | ++ + | +
+ GL_DST_COLOR
+ |
+ + + | ++ + | +
+ GL_ONE_MINUS_DST_COLOR
+ |
+ + + | ++ + | +
+ GL_SRC_ALPHA
+ |
+ + + | ++ + | +
+ GL_ONE_MINUS_SRC_ALPHA
+ |
+ + + | ++ + | +
+ GL_DST_ALPHA
+ |
+ + + | ++ + | +
+ GL_ONE_MINUS_DST_ALPHA
+ |
+ + + | ++ + | +
+ GL_CONSTANT_COLOR
+ |
+ + + | ++ + | +
+ GL_ONE_MINUS_CONSTANT_COLOR
+ |
+ + + | ++ + | +
+ GL_CONSTANT_ALPHA
+ |
+ + + | ++ + | +
+ GL_ONE_MINUS_CONSTANT_ALPHA
+ |
+ + + | ++ + | +
+ GL_SRC_ALPHA_SATURATE
+ |
+ + + | ++ + | +
+ In the table, +
+
+
+ To determine the blended RGBA values of a pixel, + the system uses the following equations: +
+
+
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
for the framebuffer
+ attachment corresponding to the destination buffer is GL_SRGB
, the R, G, and B
+ values after blending are converted into the non-linear sRGB color space by computing
+
+ where cl is the R, G, or B element and cs is the result (effectively converted into an
+ sRGB color space).
+ If GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
is not GL_SRGB
, then
+ cs = cl:
+ The resulting cs values for R, G, and B, and the unmodified A form a new
+ RGBA color value. If the color buffer is fixed-point, each component is clamped
+ to the range [0; 1] and then converted to a fixed-point value using equation
+
+ Incoming (source) alpha is correctly thought of as a material opacity,
+ ranging from 1.0
+ (
+ When more than one color buffer is enabled for drawing, + the GL performs blending separately for each enabled buffer, + using the contents of that buffer for destination color. + (See glDrawBuffers.) +
+
+ GL_INVALID_ENUM
is generated if either srcRGB
or dstRGB
is not an
+ accepted value.
+
+ glGet with argument GL_BLEND_SRC_RGB
+
+ glGet with argument GL_BLEND_SRC_ALPHA
+
+ glGet with argument GL_BLEND_DST_RGB
+
+ glGet with argument GL_BLEND_DST_ALPHA
+
+ glIsEnabled with argument GL_BLEND
+
+
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBlendFuncSeparate | +✔ | +✔ | +
+ glBlendColor, + glBlendFunc, + glBlendEquation, + glBlendEquationSeparate, + glClear, + glDrawBuffers, + glEnable, +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glBlitFramebuffer — copy a block of pixels from the read framebuffer to the draw framebuffer
+
+ void glBlitFramebuffer(
+ |
+ GLint srcX0, | +
+ | GLint srcY0, | +
+ | GLint srcX1, | +
+ | GLint srcY1, | +
+ | GLint dstX0, | +
+ | GLint dstY0, | +
+ | GLint dstX1, | +
+ | GLint dstY1, | +
+ | GLbitfield mask, | +
+ | GLenum filter) ; |
+
srcX0
,
+ srcY0
,
+ srcX1
,
+
+
+ srcY1
+
+
+ + Specify the bounds of the source rectangle within the read buffer of the read framebuffer. +
+dstX0
,
+ dstY0
,
+ dstX1
,
+
+
+ dstY1
+
+
+ + Specify the bounds of the destination rectangle within the write buffer of the write framebuffer. +
+mask
+
+
+
+ The bitwise OR of the flags indicating which buffers are to be copied. The allowed flags are
+ GL_COLOR_BUFFER_BIT
, GL_DEPTH_BUFFER_BIT
and GL_STENCIL_BUFFER_BIT
.
+
filter
+
+
+
+ Specifies the interpolation to be applied if the image is stretched. Must be GL_NEAREST
or GL_LINEAR
.
+
+ glBlitFramebuffer
transfers a rectangle of pixel values from one region of the read framebuffer to another region in
+ the draw framebuffer. mask
is the bitwise OR of a number of values indicating which buffers are
+ to be copied. The values are GL_COLOR_BUFFER_BIT
, GL_DEPTH_BUFFER_BIT
, and
+ GL_STENCIL_BUFFER_BIT
. The pixels corresponding to these buffers are copied from the source rectangle bounded by the
+ locations (srcX0
; srcY0
) and (srcX1
; srcY1
)
+ to the destination rectangle bounded by the locations (dstX0
; dstY0
) and
+ (dstX1
; dstY1
). The lower bounds of the rectangle are inclusive, while the upper
+ bounds are exclusive.
+
+ The actual region taken from the read framebuffer is limited to the intersection of the source buffers being transferred, which may + include the color buffer selected by the read buffer, the depth buffer, and/or the stencil buffer depending on mask. The actual region + written to the draw framebuffer is limited to the intersection of the destination buffers being written, which may include multiple draw + buffers, the depth buffer, and/or the stencil buffer depending on mask. Whether or not the source or destination regions are altered due + to these limits, the scaling and offset applied to pixels being transferred is performed as though no such limits were present. +
+
+ If the sizes of the source and destination rectangles are not equal, filter
specifies the interpolation method that
+ will be applied to resize the source image , and must be GL_NEAREST
or GL_LINEAR
.
+ GL_LINEAR
is only a valid interpolation method for the color buffer. If filter
is not
+ GL_NEAREST
and mask
includes GL_DEPTH_BUFFER_BIT
or
+ GL_STENCIL_BUFFER_BIT
, no data is transferred and a GL_INVALID_OPERATION
error is generated.
+
+ If filter
is GL_LINEAR
and the source rectangle would require sampling outside the bounds of
+ the source framebuffer, values are read as if the GL_CLAMP_TO_EDGE
texture wrapping mode were applied.
+
+ When the color buffer is transferred, values are taken from the read buffer of the read framebuffer and written to each of the draw + buffers of the draw framebuffer. +
++ If the source and destination rectangles overlap or are the same, and the read and draw buffers are the same, the result of the operation + is undefined. +
+
+ If SAMPLE_BUFFERS
for the read framebuffer is greater than zero and SAMPLE_BUFFERS
for the
+ draw framebuffer is zero, the samples corresponding to each pixel location in the source are converted to a single sample before being
+ written to the destination.
+
+ GL_INVALID_OPERATION
is generated if mask
contains any of the GL_DEPTH_BUFFER_BIT
+ or GL_STENCIL_BUFFER_BIT
and filter
is not GL_NEAREST
.
+
+ GL_INVALID_OPERATION
is generated if mask
contains GL_COLOR_BUFFER_BIT
+ and any of the following conditions hold:
+
The read buffer contains fixed-point or floating-point values and any draw buffer contains + neither fixed-point nor floating-point values.
+The read buffer contains unsigned integer values and any draw buffer does not contain unsigned + integer values.
+The read buffer contains signed integer values and any draw buffer does not contain signed integer values.
++
+
+ GL_INVALID_OPERATION
is generated if mask
contains GL_DEPTH_BUFFER_BIT
or
+ GL_DEPTH_BUFFER_BIT
and the source and destination depth and stencil formats do not match.
+
+ GL_INVALID_OPERATION
is generated if filter
is GL_LINEAR
and the read buffer
+ contains integer data.
+
+ GL_INVALID_OPERATION
is generated if the value of GL_SAMPLE_BUFFERS
for the draw buffer is
+ greater than zero.
+
+ GL_INVALID_OPERATION
is generated if GL_SAMPLE_BUFFERS
for the read buffer is greater than
+ zero and the formats of draw and read buffers are not identical, or the source and destination rectangles are not defined with the same
+ (X0, Y0) and (X1, Y1) bounds.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the objects bound to GL_DRAW_FRAMEBUFFER_BINDING
+ or GL_READ_FRAMEBUFFER_BINDING
are not framebuffer complete.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBlitFramebuffer | +- | +✔ | +
+ glReadPixels + glCheckFramebufferStatus, + glGenFramebuffers + glBindFramebuffer + glDeleteFramebuffers +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBufferData — creates and initializes a buffer object's data store
+
+ void glBufferData(
+ |
+ GLenum target, | +
+ | GLsizeiptr size, | +
+ | const GLvoid * data, | +
+ | GLenum usage) ; |
+
target
+
+
+
+ Specifies the target buffer object.
+ The symbolic constant must be GL_ARRAY_BUFFER
,
+ GL_COPY_READ_BUFFER
,
+ GL_COPY_WRITE_BUFFER
,
+ GL_ELEMENT_ARRAY_BUFFER
,
+ GL_PIXEL_PACK_BUFFER
,
+ GL_PIXEL_UNPACK_BUFFER
,
+ GL_TRANSFORM_FEEDBACK_BUFFER
, or
+ GL_UNIFORM_BUFFER
.
+
size
+
+
+ + Specifies the size in bytes of the buffer object's new data store. +
+data
+
+
+
+ Specifies a pointer to data that will be copied into the data store for initialization,
+ or NULL
if no data is to be copied.
+
usage
+
+
+
+ Specifies the expected usage pattern of the data store. The symbolic constant must be
+ GL_STREAM_DRAW
, GL_STREAM_READ
, GL_STREAM_COPY
,
+ GL_STATIC_DRAW
, GL_STATIC_READ
, GL_STATIC_COPY
,
+ GL_DYNAMIC_DRAW
, GL_DYNAMIC_READ
, or GL_DYNAMIC_COPY
.
+
+ glBufferData
creates a new data store for the buffer object currently bound to
+ target
. Any pre-existing data store is deleted. The new data store is created with the
+ specified size
in bytes and usage
. If data
+ is not NULL
, the data store is initialized with data from this pointer. In its initial
+ state, the new data store is not mapped, it has a NULL
mapped pointer, and its mapped access
+ is GL_READ_WRITE
.
+
+ usage
is a hint to the GL implementation as to how a buffer object's data store will be
+ accessed. This enables the GL implementation to make more intelligent decisions that may significantly
+ impact buffer object performance. It does not, however, constrain the actual usage of the data store.
+ usage
can be broken down into two parts: first, the frequency of access (modification
+ and usage), and second, the nature of that access. The frequency of access may be one of these:
+
+ The data store contents will be modified once and used at most a few times. +
++ The data store contents will be modified once and used many times. +
++ The data store contents will be modified repeatedly and used many times. +
++ The nature of access may be one of these: +
++ The data store contents are modified by the application, and used as the source for GL drawing and + image specification commands. +
++ The data store contents are modified by reading data from the GL, and used to return that data + when queried by the application. +
++ The data store contents are modified by reading data from the GL, and used as the source for GL + drawing and image specification commands. +
+
+ If data
is NULL
, a data store of the specified size is still created,
+ but its contents remain uninitialized and thus undefined.
+
+ Clients must align data elements consistently with the requirements of the client
+ platform, with an additional base-level requirement that an offset within a buffer to
+ a datum comprising
+ GL_INVALID_ENUM
is generated if target
is not
+ one of the accepted buffer targets.
+
+ GL_INVALID_ENUM
is generated if usage
is not
+ GL_STREAM_DRAW
, GL_STREAM_READ
, GL_STREAM_COPY
,
+ GL_STATIC_DRAW
, GL_STATIC_READ
, GL_STATIC_COPY
,
+ GL_DYNAMIC_DRAW
, GL_DYNAMIC_READ
, or GL_DYNAMIC_COPY
.
+
+ GL_INVALID_VALUE
is generated if size
is negative.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ GL_OUT_OF_MEMORY
is generated if the GL is unable to create a data store with the specified size
.
+
+ glGetBufferParameter with argument GL_BUFFER_SIZE
or GL_BUFFER_USAGE
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBufferData | +✔ | +✔ | +
+ glBindBuffer, + glBufferSubData, + glMapBufferRange, + glUnmapBuffer +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glBufferSubData — updates a subset of a buffer object's data store
+
+ void glBufferSubData(
+ |
+ GLenum target, | +
+ | GLintptr offset, | +
+ | GLsizeiptr size, | +
+ | const GLvoid * data) ; |
+
target
+
+
+
+ Specifies the target buffer object.
+ The symbolic constant must be GL_ARRAY_BUFFER
,
+ GL_COPY_READ_BUFFER
,
+ GL_COPY_WRITE_BUFFER
,
+ GL_ELEMENT_ARRAY_BUFFER
,
+ GL_PIXEL_PACK_BUFFER
,
+ GL_PIXEL_UNPACK_BUFFER
,
+ GL_TRANSFORM_FEEDBACK_BUFFER
, or
+ GL_UNIFORM_BUFFER
.
+
offset
+
+
+ + Specifies the offset into the buffer object's data store where data replacement will begin, + measured in bytes. +
+size
+
+
+ + Specifies the size in bytes of the data store region being replaced. +
+data
+
+
+ + Specifies a pointer to the new data that will be copied into the data store. +
+
+ glBufferSubData
redefines some or all of the data store for the buffer object currently
+ bound to target
. Data starting at byte offset offset
and
+ extending for size
bytes is copied to the data store from the memory pointed to by
+ data
. An error is thrown if offset
and size
+ together define a range beyond the bounds of the buffer object's data store.
+
+ When replacing the entire data store, consider using glBufferSubData
rather
+ than completely recreating the data store with glBufferData
. This avoids the cost of
+ reallocating the data store.
+
+ Consider using multiple buffer objects to avoid stalling the rendering pipeline during data store updates.
+ If any rendering in the pipeline makes reference to data in the buffer object being updated by
+ glBufferSubData
, especially from the specific region being updated, that rendering must
+ drain from the pipeline before the data store can be updated.
+
+ Clients must align data elements consistently with the requirements of the client
+ platform, with an additional base-level requirement that an offset within a buffer to
+ a datum comprising
+ GL_INVALID_ENUM
is generated if target
is not
+ one of the accepted buffer targets.
+
+ GL_INVALID_VALUE
is generated if offset
or
+ size
is negative, or if together they define a region of memory
+ that extends beyond the buffer object's allocated data store.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ GL_INVALID_OPERATION
is generated if the buffer object being updated is mapped.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glBufferSubData | +✔ | +✔ | +
+ glBindBuffer, + glBufferData, + glMapBufferRange, + glUnmapBuffer +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glCheckFramebufferStatus — check the completeness status of a framebuffer
+
+ GLenum glCheckFramebufferStatus(
+ |
+ GLenum target) ; |
+
target
+
+
+ + Specify the target of the framebuffer completeness check. +
+
+ glCheckFramebufferStatus
queries the completeness status of the framebuffer object currently bound to target
.
+ target
must be GL_DRAW_FRAMEBUFFER
, GL_READ_FRAMEBUFFER
or GL_FRAMEBUFFER
.
+ GL_FRAMEBUFFER
is equivalent to GL_DRAW_FRAMEBUFFER
.
+
+ The return value is GL_FRAMEBUFFER_COMPLETE
if the framebuffer bound to target
is complete. Otherwise,
+ the return value is determined as follows:
+
+ GL_FRAMEBUFFER_UNDEFINED
is returned if target
is the default framebuffer, but the default framebuffer does not exist.
+
+ GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
is returned if any of the framebuffer attachment points are framebuffer incomplete.
+
+ GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
is returned if the framebuffer does not have at least one image attached to it.
+
+ GL_FRAMEBUFFER_UNSUPPORTED
is returned if depth and stencil attachments, if present, are not the same renderbuffer, or if
+ the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.
+
+ GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE
is returned if the value of GL_RENDERBUFFER_SAMPLES
is not the same
+ for all attached renderbuffers or, if the attached images are a mix of renderbuffers and textures, the value of GL_RENDERBUFFER_SAMPLES
+ is not zero.
+
+
++ Additionally, if an error occurs, zero is returned. +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_DRAW_FRAMEBUFFER
,
+ GL_READ_FRAMEBUFFER
or GL_FRAMEBUFFER
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCheckFramebufferStatus | +✔ | +✔ | +
+ glGenFramebuffers, + glDeleteFramebuffers + glBindFramebuffer +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glClear — clear buffers to preset values
+
+ void glClear(
+ |
+ GLbitfield mask) ; |
+
mask
+
+
+
+ Bitwise OR of masks that indicate the buffers to be cleared.
+ The three masks are
+ GL_COLOR_BUFFER_BIT
,
+ GL_DEPTH_BUFFER_BIT
, and
+ GL_STENCIL_BUFFER_BIT
.
+
+ glClear
sets the bitplane area of the window to values previously selected
+ by glClearColor
, glClearDepthf
, and
+ glClearStencil
.
+ Multiple color buffers can be cleared simultaneously by selecting
+ more than one buffer at a time using glDrawBuffers.
+
+ The pixel ownership test,
+ the scissor test,
+ sRGB conversion,
+ dithering, and the buffer writemasks affect the operation of glClear
.
+ The scissor box bounds the cleared region.
+ Alpha function,
+ blend function,
+ stenciling,
+ texture mapping,
+ and depth-buffering are ignored by glClear
.
+
+ glClear
takes a single argument that is the bitwise OR of several
+ values indicating which buffer is to be cleared.
+
+ The values are as follows: +
+GL_COLOR_BUFFER_BIT
+
+ + Indicates the buffers currently enabled for color + writing. +
+GL_DEPTH_BUFFER_BIT
+
+ + Indicates the depth buffer. +
+GL_STENCIL_BUFFER_BIT
+
+ + Indicates the stencil buffer. +
++ The value to which each buffer is cleared depends on the setting of the + clear value for that buffer. +
+
+ If a buffer is not present,
+ then a glClear
directed at that buffer has no effect.
+
+ GL_INVALID_VALUE
is generated if any bit other than the three defined
+ bits is set in mask
.
+
+ glGet with argument GL_DEPTH_CLEAR_VALUE
+
+ glGet with argument GL_COLOR_CLEAR_VALUE
+
+ glGet with argument GL_STENCIL_CLEAR_VALUE
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glClear | +✔ | +✔ | +
+ glClearBuffer, + glClearColor, + glClearDepthf, + glClearStencil, + glColorMask, + glDepthMask, + glDrawBuffers, + glScissor, + glStencilMask +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glClearBuffer — clear individual buffers of the currently bound draw framebuffer
+
+ void glClearBufferiv(
+ |
+ GLenum buffer, | +
+ | GLint drawBuffer, | +
+ | const GLint * value) ; |
+
+ void glClearBufferuiv(
+ |
+ GLenum buffer, | +
+ | GLint drawBuffer, | +
+ | const GLuint * value) ; |
+
+ void glClearBufferfv(
+ |
+ GLenum buffer, | +
+ | GLint drawBuffer, | +
+ | const GLfloat * value) ; |
+
+ void glClearBufferfi(
+ |
+ GLenum buffer, | +
+ | GLint drawBuffer, | +
+ | GLfloat depth, | +
+ | GLint stencil) ; |
+
buffer
+
+
+ + Specify the buffer to clear. +
+drawBuffer
+
+
+ + Specify a particular draw buffer to clear. +
+value
+
+
+ + For color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. + For depth buffers, a pointer to a single depth value to clear the buffer to. + For stencil buffers, a pointer to a single stencil value to clear the buffer to. +
+depth
+
+
+ + The value to clear a depth render buffer to. +
+stencil
+
+
+ + The value to clear a stencil render buffer to. +
+
+ glClearBuffer*
clears the specified buffer to the specified value(s). If buffer
is
+ GL_COLOR
, a particular draw buffer GL_DRAWBUFFER
i
is specified
+ by passing i
as drawBuffer
. In this case, value
points to
+ a four-element vector specifying the R, G, B and A color to clear that draw buffer to. The glClearBufferfv
,
+ glClearBufferiv
, and glClearBufferuiv
commands should be used to clear fixed-point,
+ signed integer, and unsigned integer color buffers respectively. Clamping and conversion for fixed-point color
+ buffers are performed in the same fashion as glClearColor.
+
+ If buffer
is GL_DEPTH
, drawBuffer
must be zero, and value
+ points to a single value to clear the depth buffer to. Only glClearBufferfv
should be used to clear
+ depth buffers. Clamping and conversion for fixed-point depth buffers are performed in the same fashion as
+ glClearDepthf.
+
+ If buffer
is GL_STENCIL
, drawBuffer
must be zero, and value
+ points to a single value to clear the stencil buffer to. Only glClearBufferiv
should be used to clear
+ stencil buffers. Masing and type conversion are performed in the same fashion as
+ glClearStencil.
+
+ glClearBufferfi
may be used to clear the depth and stencil buffers. buffer
must be
+ GL_DEPTH_STENCIL
and drawBuffer
must be zero. depth
and
+ stencil
are the depth and stencil values, respectively.
+
+ The result of glClearBuffer
is undefined if no conversion between the type of value
+ and the buffer being cleared is defined. However, this is not an error.
+
+ GL_INVALID_ENUM
is generated by glClearBufferif
, glClearBufferfv
+ and glClearBufferuiv
if buffer
is not GL_COLOR
,
+ GL_FRONT
, GL_BACK
, GL_LEFT
, GL_RIGHT
,
+ GL_FRONT_AND_BACK
, GL_DEPTH
or GL_STENCIL
.
+
+ GL_INVALID_ENUM
is generated by glClearBufferfi
if buffer
+ is not GL_DEPTH_STENCIL
.
+
+ GL_INVALID_VALUE
is generated if buffer
is GL_COLOR
,
+ GL_FRONT
, GL_BACK
, GL_LEFT
, GL_RIGHT
,
+ or GL_FRONT_AND_BACK
and drawBuffer
is greater than or equal to GL_MAX_DRAW_BUFFERS
.
+
+ GL_INVALID_VALUE
is generated if buffer
is GL_DEPTH
,
+ GL_STENCIL
or GL_DEPTH_STENCIL
and drawBuffer
is not zero.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glClearBufferiv
+ |
+ - | +✔ | +
+ glClearBufferuiv
+ |
+ - | +✔ | +
+ glClearBufferfv
+ |
+ - | +✔ | +
+ glClearBufferfi
+ |
+ - | +✔ | +
+ glClearColor, + glClearDepthf, + glClearStencil, + glClear +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glClearColor — specify clear values for the color buffers
+
+ void glClearColor(
+ |
+ GLfloat red, | +
+ | GLfloat green, | +
+ | GLfloat blue, | +
+ | GLfloat alpha) ; |
+
red
,
+ green
,
+ blue
,
+
+
+ alpha
+
+
+ + Specify the red, green, blue, and alpha values used when the + color buffers are cleared. + The initial values are all 0. +
+
+ glClearColor
specifies the red,
+ green,
+ blue,
+ and alpha values used by glClear to clear fixed- and
+ floating-point color buffers.
+ Unsigned normalized fixed point RGBA color buffers are cleared to color values derived by clamping each component of
+ the clear color to the range
+
+ glGet with argument GL_COLOR_CLEAR_VALUE
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glClearColor | +✔ | +✔ | +
+ glClear +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glClearDepthf — specify the clear value for the depth buffer
+
+ void glClearDepthf(
+ |
+ GLfloat depth) ; |
+
depth
+
+
+ + Specifies the depth value used when the depth buffer is cleared. The + initial value is 1. +
+
+ glClearDepthf
specifies the depth value used by glClear to clear the depth buffer.
+ When clearing a fixed-point depth buffer, values specified by glClearDepthf
are clamped to the range
+
+ glGet with argument GL_DEPTH_CLEAR_VALUE
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glClearDepthf | +✔ | +✔ | +
+ glClear +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glClearStencil — specify the clear value for the stencil buffer
+
+ void glClearStencil(
+ |
+ GLint s) ; |
+
s
+
+
+ + Specifies the index used when the stencil buffer is cleared. + The initial value is 0. +
+
+ glClearStencil
specifies the index used by glClear to clear the stencil buffer.
+ When clearing a stencil buffer, s
is masked with
+
+ glGet with argument GL_STENCIL_CLEAR_VALUE
+
+ glGet with argument GL_STENCIL_BITS
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glClearStencil | +✔ | +✔ | +
+ glClear, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glClientWaitSync — block and wait for a sync object to become signaled
+
+ GLenum glClientWaitSync(
+ |
+ GLsync sync, | +
+ | GLbitfield flags, | +
+ | GLuint64 timeout) ; |
+
sync
+
+
+ + The sync object whose status to wait on. +
+flags
+
+
+
+ A bitfield controlling the command flushing behavior. flags
may be GL_SYNC_FLUSH_COMMANDS_BIT
.
+
timeout
+
+
+
+ The timeout, specified in nanoseconds, for which the implementation should wait for sync
to become signaled.
+
+ glClientWaitSync
causes the client to block and wait for the sync object specified by sync
to become signaled. If
+ sync
is signaled when glClientWaitSync
is called, glClientWaitSync
returns immediately, otherwise
+ it will block and wait for up to timeout
nanoseconds for sync
to become signaled.
+
+ The return value is one of four status values: +
+
+ GL_ALREADY_SIGNALED
indicates that sync
was signaled at the time that glClientWaitSync
+ was called.
+
+ GL_TIMEOUT_EXPIRED
indicates that at least timeout
nanoseconds passed and sync
did not
+ become signaled.
+
+ GL_CONDITION_SATISFIED
indicates that sync
was signaled before the timeout expired.
+
+ GL_WAIT_FAILED
indicates that an error occurred. Additionally, an OpenGL error will be generated.
+
+
+
+ GL_INVALID_VALUE
is generated if sync
is not the name of an existing sync object.
+
+ GL_INVALID_VALUE
is generated if flags
contains any unsupported flag.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glClientWaitSync | +- | +✔ | +
+ glFenceSync, + glIsSync + glWaitSync +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glColorMask — enable and disable writing of frame buffer color components
+
+ void glColorMask(
+ |
+ GLboolean red, | +
+ | GLboolean green, | +
+ | GLboolean blue, | +
+ | GLboolean alpha) ; |
+
red
,
+ green
,
+ blue
,
+
+
+ alpha
+
+
+
+ Specify whether red, green, blue, and alpha are to be written
+ into the frame buffer.
+ The initial values are all GL_TRUE
,
+ indicating that the color components are written.
+
+ glColorMask
specifies whether the individual color components in the frame buffer
+ can or cannot be written. glColorMask
sets the mask for all active draw buffers.
+ If red
is GL_FALSE
,
+ for example,
+ no change is made to the red component of any pixel in any of the
+ color buffers,
+ regardless of the drawing operation attempted.
+
+ Changes to individual bits of components cannot be controlled. + Rather, + changes are either enabled or disabled for entire color components. +
+
+ glGet with argument GL_COLOR_WRITEMASK
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glColorMask | +✔ | +✔ | +
+ glClear, + glDepthMask, + glStencilMask +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glCompileShader — Compiles a shader object
+
+ void glCompileShader(
+ |
+ GLuint shader) ; |
+
shader
+
+
+ Specifies the shader object to be + compiled.
+glCompileShader
compiles the source
+ code strings that have been stored in the shader object
+ specified by shader
.
The compilation status will be stored as part of the
+ shader object's state. This value will be set to
+ GL_TRUE
if the shader was compiled without
+ errors and is ready for use, and GL_FALSE
+ otherwise. It can be queried by calling
+ glGetShaderiv
+ with arguments shader
and
+ GL_COMPILE_STATUS
.
Compilation of a shader can fail for a number of reasons + as specified by the OpenGL ES Shading Language Specification. + Whether or not the compilation was successful, information about + the compilation can be obtained from the shader object's + information log by calling + glGetShaderInfoLog.
+GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
glGetShaderInfoLog
+ with argument shader
glGetShaderiv
+ with arguments shader
and
+ GL_COMPILE_STATUS
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCompileShader | +✔ | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glCompressedTexImage2D — specify a two-dimensional texture image in a compressed format
+
+ void glCompressedTexImage2D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLenum internalformat, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLint border, | +
+ | GLsizei imageSize, | +
+ | const GLvoid * data) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+internalformat
+
+
+
+ Specifies the format of the compressed image data stored at address data
.
+
width
+
+
+ + Specifies the width of the texture image. + All implementations support 2D and cube-mapped texture images that are at least 2048 texels + wide. +
+height
+
+
+ + Specifies the height of the texture image. + All implementations support 2D and cube-mapped texture images that are at least 2048 texels + high. +
+border
+
+
+ + This value must be 0. +
+imageSize
+
+
+
+ Specifies the number of unsigned bytes of image data starting at the
+ address specified by data
.
+
data
+
+
+ + Specifies a pointer to the compressed image data in memory. +
++ Texturing allows elements of an image array to be read by shaders. +
+
+ glCompressedTexImage2D
loads a previously defined, and retrieved, compressed two-dimensional
+ texture image if target
is GL_TEXTURE_2D
, or one of the
+ cube map faces such as GL_TEXTURE_CUBE_MAP_POSITIVE_X
.
+ (see glTexImage2D).
+
+ internalformat
must be a compressed image format from Table 1 below,
+ or an extension-specified compressed-texture format.
+
+ imageSize
must be appropriate for the width
, height
and
+ depth
of the internalformat
specified. The size for an ETC/EAC image
+ is given in Table 1 below.
+
+ If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER
target
+ (see glBindBuffer) while a texture image is
+ specified, data
is treated as a byte offset into the buffer object's data store.
+
+
++ Compressed Internal Format + | ++ Base Internal Format + | ++ Image Size + | +
---|---|---|
+ GL_COMPRESSED_R11_EAC
+ |
+
+ GL_RED
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SIGNED_R11_EAC
+ |
+
+ GL_RED
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RG11_EAC
+ |
+
+ GL_RG
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_SIGNED_RG11_EAC
+ |
+
+ GL_RG
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_RGB8_ETC2
+ |
+
+ GL_RGB
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SRGB8_ETC2
+ |
+
+ GL_RGB
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RGBA8_ETC2_EAC
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+
+ GL_INVALID_ENUM
is generated if internalformat
is not one of the specific
+ compressed internal formats:
+ GL_COMPRESSED_R11_EAC
,
+ GL_COMPRESSED_SIGNED_R11_EAC
,
+ GL_COMPRESSED_RG11_EAC
,
+ GL_COMPRESSED_SIGNED_RG11_EAC
,
+ GL_COMPRESSED_RGB8_ETC2
,
+ GL_COMPRESSED_SRGB8_ETC2
,
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
,
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
,
+ GL_COMPRESSED_RGBA8_ETC2_EAC
, or
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
.
+
+ GL_INVALID_VALUE
is generated if imageSize
is not consistent with
+ the format, dimensions, and contents of the specified compressed image
+ data.
+
+ GL_INVALID_VALUE
is generated if border
is not 0.
+
+ GL_INVALID_OPERATION
is generated if parameter combinations are not
+ supported by the specific compressed internal format as specified in the
+ specific texture compression extension.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the buffer object's data store is currently mapped.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the data would be unpacked from the buffer
+ object such that the memory reads required would exceed the data store size.
+
+ Undefined results, including abnormal program termination, are generated if
+ data
is not encoded in a manner consistent with the extension
+ specification defining the internal compression format.
+
+ glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glCompressedTexImage2D
+ |
+ ✔ | +✔ | +
+ glActiveTexture, + glCompressedTexImage3D, + glCompressedTexSubImage2D, + glCompressedTexSubImage3D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glTexImage2D, + glTexImage3D, + glTexSubImage2D, + glTexSubImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glCompressedTexImage3D — specify a three-dimensional texture image in a compressed format
+
+ void glCompressedTexImage3D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLenum internalformat, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLsizei depth, | +
+ | GLint border, | +
+ | GLsizei imageSize, | +
+ | const GLvoid * data) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_3D
, or GL_TEXTURE_2D_ARRAY
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+internalformat
+
+
+
+ Specifies the format of the compressed image data stored at address data
.
+
width
+
+
+ + Specifies the width of the texture image. +
+height
+
+
+ + Specifies the height of the texture image. +
+depth
+
+
+ + Specifies the depth of the texture image. +
+border
+
+
+ + This value must be 0. +
+imageSize
+
+
+
+ Specifies the number of unsigned bytes of image data starting at the
+ address specified by data
.
+
data
+
+
+ + Specifies a pointer to the compressed image data in memory. +
++ Texturing allows elements of an image array to be read by shaders. +
+
+ glCompressedTexImage3D
loads a previously defined, and retrieved, compressed three-dimensional
+ texture image if target
is GL_TEXTURE_3D
(see glTexImage3D).
+
+ If target
is GL_TEXTURE_2D_ARRAY
, data
is
+ treated as an array of compressed 2D textures.
+
+ internalformat
must be a compressed image format from Table 1 below,
+ or an extension-specified compressed-texture format.
+
+ imageSize
must be appropriate for the width
, height
and
+ depth
of the internalformat
specified. The size for a single slice of ETC/EAC
+ is given in Table 1 below.
+
+ If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER
target
+ (see glBindBuffer) while a texture image is
+ specified, data
is treated as a byte offset into the buffer object's data store.
+
+
++ Compressed Internal Format + | ++ Base Internal Format + | ++ Image Size + | +
---|---|---|
+ GL_COMPRESSED_R11_EAC
+ |
+
+ GL_RED
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SIGNED_R11_EAC
+ |
+
+ GL_RED
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RG11_EAC
+ |
+
+ GL_RG
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_SIGNED_RG11_EAC
+ |
+
+ GL_RG
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_RGB8_ETC2
+ |
+
+ GL_RGB
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SRGB8_ETC2
+ |
+
+ GL_RGB
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RGBA8_ETC2_EAC
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+
+ GL_INVALID_ENUM
is generated if internalformat
is not one of the specific
+ compressed internal formats:
+ GL_COMPRESSED_R11_EAC
,
+ GL_COMPRESSED_SIGNED_R11_EAC
,
+ GL_COMPRESSED_RG11_EAC
,
+ GL_COMPRESSED_SIGNED_RG11_EAC
,
+ GL_COMPRESSED_RGB8_ETC2
,
+ GL_COMPRESSED_SRGB8_ETC2
,
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
,
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
,
+ GL_COMPRESSED_RGBA8_ETC2_EAC
, or
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
.
+
+ GL_INVALID_VALUE
is generated if imageSize
is not consistent with
+ the format, dimensions, and contents of the specified compressed image data.
+
+ GL_INVALID_VALUE
is generated if border
is not 0.
+
+ GL_INVALID_OPERATION
is generated if parameter combinations are not
+ supported by the specific compressed internal format as specified in the
+ specific texture compression extension. The ETC2/EAC texture compression algorithm
+ supports only two-dimensional images. If internalformat is an ETC2/EAC format,
+ glCompressedTexImage3D
will generate an INVALID_OPERATION error if target is not TEXTURE_2D_ARRAY.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the buffer object's data store is currently mapped.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the data would be unpacked from the buffer
+ object such that the memory reads required would exceed the data store size.
+
+ Undefined results, including abnormal program termination, are generated if data
is not encoded in a manner consistent with the extension specification defining the internal compression format.
+
+ glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCompressedTexImage3D | +- | +✔ | +
+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glCompressedTexSubImage3D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glTexImage2D, + glTexSubImage2D, + glTexSubImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glCompressedTexSubImage2D — specify a two-dimensional texture subimage in a compressed format
+
+ void glCompressedTexSubImage2D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLint xoffset, | +
+ | GLint yoffset, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLenum format, | +
+ | GLsizei imageSize, | +
+ | const GLvoid * data) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+xoffset
+
+
+ + Specifies a texel offset in the x direction within the texture array. +
+yoffset
+
+
+ + Specifies a texel offset in the y direction within the texture array. +
+width
+
+
+ + Specifies the width of the texture subimage. +
+height
+
+
+ + Specifies the height of the texture subimage. +
+format
+
+
+
+ Specifies the format of the compressed image data stored at address data
.
+
imageSize
+
+
+
+ Specifies the number of unsigned bytes of image data starting at the
+ address specified by data
.
+
data
+
+
+ + Specifies a pointer to the compressed image data in memory. +
++ Texturing allows elements of an image array to be read by shaders. +
+
+ glCompressedTexSubImage2D
redefines a contiguous subregion of an existing two-dimensional
+ texture image. The texels referenced by data
replace the portion of the
+ existing texture array with x indices xoffset
and
+ yoffset
and
+
+ format
must be a known compressed image format (such as GL_COMPRESSED_R11_EAC
)
+ or an extension-specified compressed-texture format.
+
+ If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER
target
+ (see glBindBuffer) while a texture image is
+ specified, data
is treated as a byte offset into the buffer object's data store.
+
+ GL_INVALID_ENUM
is generated if format
is not one of the specific
+ compressed internal formats:
+ GL_COMPRESSED_R11_EAC
,
+ GL_COMPRESSED_SIGNED_R11_EAC
,
+ GL_COMPRESSED_RG11_EAC
,
+ GL_COMPRESSED_SIGNED_RG11_EAC
,
+ GL_COMPRESSED_RGB8_ETC2
,
+ GL_COMPRESSED_SRGB8_ETC2
,
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
,
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
,
+ GL_COMPRESSED_RGBA8_ETC2_EAC
, or
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
.
+
+ GL_INVALID_VALUE
is generated if imageSize
is not consistent with
+ the format, dimensions, and contents of the specified compressed image
+ data.
+
+ GL_INVALID_OPERATION
is generated if parameter combinations are not
+ supported by the specific compressed internal format as specified in the
+ specific texture compression extension.
+
+ For ETC2/EAC images GL_INVALID_OPERATION
is generated if width
+ is not a multiple of four, and width
+ xoffset
is not equal
+ to the width of the texture level; if height
is not a multiple of four,
+ and height
+ yoffset
is not equal to the height of the texture level;
+ or if xoffset
or yoffset
is not a multiple of four.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the buffer object's data store is currently mapped.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the data would be unpacked from the buffer
+ object such that the memory reads required would exceed the data store size.
+
+ Undefined results, including abnormal program termination, are generated if
+ data
is not encoded in a manner consistent with the extension
+ specification defining the internal compression format.
+
+ glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCompressedTexSubImage2D | +✔ | +✔ | +
+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexImage3D, + glCompressedTexSubImage3D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glTexImage2D, + glTexImage3D, + glTexSubImage2D, + glTexSubImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glCompressedTexSubImage3D — specify a three-dimensional texture subimage in a compressed format
+
+ void glCompressedTexSubImage3D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLint xoffset, | +
+ | GLint yoffset, | +
+ | GLint zoffset, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLsizei depth, | +
+ | GLenum format, | +
+ | GLsizei imageSize, | +
+ | const GLvoid * data) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_3D
or GL_TEXTURE_2D_ARRAY
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+xoffset
+
+
+ + Specifies a texel offset in the x direction within the texture array. +
+yoffset
+
+
+ + Specifies a texel offset in the y direction within the texture array. +
+zoffset
+
+
+ + Specifies a texel offset in the z direction within the texture array. +
+width
+
+
+ + Specifies the width of the texture subimage. +
+height
+
+
+ + Specifies the height of the texture subimage. +
+depth
+
+
+ + Specifies the depth of the texture subimage. +
+format
+
+
+
+ Specifies the format of the compressed image data stored at address data
.
+
imageSize
+
+
+
+ Specifies the number of unsigned bytes of image data starting at the
+ address specified by data
.
+
data
+
+
+ + Specifies a pointer to the compressed image data in memory. +
++ Texturing allows elements of an image array to be read by shaders. +
+
+ glCompressedTexSubImage3D
redefines a contiguous subregion of an existing three-dimensional
+ or two-dimensional array texture image. The texels referenced by data
replace the portion of the
+ existing texture array with x indices xoffset
and
+ yoffset
and
+ zoffset
and
+
+ format
must be a known compressed image format (such as GL_COMPRESSED_R11_EAC
)
+ or an extension-specified compressed-texture format.
+
+ If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER
target
+ (see glBindBuffer) while a texture image is
+ specified, data
is treated as a byte offset into the buffer object's data store.
+
+ GL_INVALID_ENUM
is generated if format
is not one of the specific
+ compressed internal formats:
+ GL_COMPRESSED_R11_EAC
,
+ GL_COMPRESSED_SIGNED_R11_EAC
,
+ GL_COMPRESSED_RG11_EAC
,
+ GL_COMPRESSED_SIGNED_RG11_EAC
,
+ GL_COMPRESSED_RGB8_ETC2
,
+ GL_COMPRESSED_SRGB8_ETC2
,
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
,
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
,
+ GL_COMPRESSED_RGBA8_ETC2_EAC
, or
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
.
+
+ GL_INVALID_VALUE
is generated if imageSize
is not consistent with
+ the format, dimensions, and contents of the specified compressed image
+ data.
+
+ GL_INVALID_OPERATION
is generated if parameter combinations are not
+ supported by the specific compressed internal format as specified in the
+ specific texture compression extension. For ETC2/EAC images GL_INVALID_OPERATION
+ is generated if width
+ is not a multiple of four, and width
+ xoffset
is not equal
+ to the width of the texture level; if height
is not a multiple of four,
+ and height
+ yoffset
is not equal to the height of the texture level;
+ or if xoffset
or yoffset
is not a multiple of four. The ETC2/EAC
+ texture compression algorithm supports only two-dimensional images. If format is an ETC2/EAC format,
+ glCompressedTexSubImage3D
will generate an GL_INVALID_OPERATION
error
+ if target is not GL_TEXTURE_2D_ARRAY
.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the buffer object's data store is currently mapped.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the data would be unpacked from the buffer
+ object such that the memory reads required would exceed the data store size.
+
+ Undefined results, including abnormal program termination, are generated if
+ data
is not encoded in a manner consistent with the extension
+ specification defining the internal compression format.
+
+ glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCompressedTexSubImage3D | +- | +✔ | +
+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexImage3D, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glTexImage2D, + glTexImage3D, + glTexSubImage2D, + glTexSubImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glCopyBufferSubData — copy part of the data store of a buffer object to the data store of another buffer object
+
+ void glCopyBufferSubData(
+ |
+ GLenum readtarget, | +
+ | GLenum writetarget, | +
+ | GLintptr readoffset, | +
+ | GLintptr writeoffset, | +
+ | GLsizeiptr size) ; |
+
readtarget
+
+
+ + Specifies the target from whose data store data should be read. +
+writetarget
+
+
+ + Specifies the target to whose data store data should be written. +
+readoffset
+
+
+
+ Specifies the offset, in basic machine units, within the data store of readtarget
from which data should be read.
+
writeoffset
+
+
+
+ Specifies the offset, in basic machine units, within the data store of writetarget
to which data should be written.
+
size
+
+
+
+ Specifies the size, in basic machine units, of the data to be copied from readtarget
to writetarget
.
+
+ glCopyBufferSubData
copies part of the data store attached to readtarget
to the
+ data store attached to writetarget
. The number of basic machine units indicated by size
+ is copied from the source, at offset readoffset
to the destination at writeoffset
,
+ also in basic machine units.
+
+ readtarget
and writetarget
must be GL_ARRAY_BUFFER
,
+ GL_COPY_READ_BUFFER
, GL_COPY_WRITE_BUFFER
, GL_ELEMENT_ARRAY_BUFFER
,
+ GL_PIXEL_PACK_BUFFER
, GL_PIXEL_UNPACK_BUFFER
,
+ GL_TRANSFORM_FEEDBACK_BUFFER
or GL_UNIFORM_BUFFER
. Any of these targets may be used,
+ although the targets GL_COPY_READ_BUFFER
and GL_COPY_WRITE_BUFFER
are provided
+ specifically to allow copies between buffers without disturbing other GL state.
+
+ readoffset
, writeoffset
and size
must all be greater than or equal to
+ zero. Furthermore, readoffset
+ size
must not exceeed the size of the buffer
+ object bound to readtarget
, and writeoffset
+ size
must not exceeed the
+ size of the buffer bound to writetarget
. If the same buffer object is bound to both readtarget
+ and writetarget
, then the ranges specified by readoffset
, writeoffset
+ and size
must not overlap.
+
+ GL_INVALID_VALUE
is generated if any of readoffset
, writeoffset
+ or size
is negative, if readoffset
+ size
exceeds the
+ size of the buffer object bound to readtarget
or if writeoffset
+ size
+ exceeds the size of the buffer object bound to writetarget
.
+
+ GL_INVALID_VALUE
is generated if the same buffer object is bound to both readtarget
+ and writetarget
and the ranges [readoffset
, readoffset
+
+ size
) and [writeoffset
, writeoffset
+ size
)
+ overlap.
+
+ GL_INVALID_OPERATION
is generated if zero is bound to readtarget
or writetarget
.
+
+ GL_INVALID_OPERATION
is generated if the buffer object bound to either readtarget
or writetarget
+ is mapped.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCopyBufferSubData | +- | +✔ | +
+ glGenBuffers, + glBindBuffer, + glBufferData, + glBufferSubData, +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glCopyTexImage2D — copy pixels into a 2D texture image
+
+ void glCopyTexImage2D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLenum internalformat, | +
+ | GLint x, | +
+ | GLint y, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLint border) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+internalformat
+
+
+
+ Specifies the internal format of the texture.
+ Must be one of the following symbolic constants:
+ GL_ALPHA
,
+ GL_LUMINANCE
,
+ GL_LUMINANCE_ALPHA
,
+ GL_RGB
,
+ GL_RGBA
,
+ GL_R8
,
+ GL_RG8
,
+ GL_RGB565
,
+ GL_RGB8
,
+ GL_RGBA4
,
+ GL_RGB5_A1
,
+ GL_RGBA8
,
+ GL_RGB10_A2
,
+ GL_SRGB8
,
+ GL_SRGB8_ALPHA8
,
+ GL_R8I
,
+ GL_R8UI
,
+ GL_R16I
,
+ GL_R16UI
,
+ GL_R32I
,
+ GL_R32UI
,
+ GL_RG8I
,
+ GL_RG8UI
,
+ GL_RG16I
,
+ GL_RG16UI
,
+ GL_RG32I
,
+ GL_RG32UI
,
+ GL_RGBA8I
,
+ GL_RGBA8UI
,
+ GL_RGB10_A2UI
,
+ GL_RGBA16I
,
+ GL_RGBA16UI
,
+ GL_RGBA32I
,
+ GL_RGBA32UI
.
+
x
,
+
+
+ y
+
+
+ + Specify the window coordinates of the lower left corner + of the rectangular region of pixels to be copied. +
+width
+
+
+ + Specifies the width of the texture image. +
+height
+
+
+ + Specifies the height of the texture image. +
+border
+
+
+ + Specifies the width of the border. + Must be 0. +
+
+ glCopyTexImage2D
defines a two-dimensional texture image, or cube-map texture image
+ with pixels from the current
+ GL_READ_BUFFER
.
+
+ The screen-aligned pixel rectangle with lower left corner at (x
,
+ y
) and with a width of width
+ and a height of height
defines the texture array
+ at the mipmap level specified by level
.
+ internalformat
specifies the internal format of the texture array.
+
+ The pixels in the rectangle are processed exactly as if
+ glReadPixels had been called, but the process stops after
+ conversion to RGBA values. The error GL_INVALID_OPERATION
is generated if integer RGBA data is
+ required and the format of the current color buffer is not integer; or if floating- or fixed-point RGBA
+ data is required and the format of the current color buffer is integer.
+
+ Pixel ordering is such that lower
+
+ If any of the pixels within the specified rectangle of the current
+ GL_READ_BUFFER
are outside the window associated with the current
+ rendering context, then the values obtained for those pixels are undefined.
+
+ When internalformat
is one of the sRGB types, the GL does not automatically convert the source pixels to the sRGB color space.
+
+ An image with height or width of 0 indicates a NULL texture. +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater
+ than
+ GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if width
or
+ height
is less than 0 or greater than GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if border
is not 0.
+
+ GL_INVALID_VALUE
is generated if internalformat
is not an
+ accepted format.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCopyTexImage2D | +✔ | +✔ | +
+ glCopyTexSubImage2D, + glPixelStorei, + glTexImage2D, + glTexSubImage2D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glCopyTexSubImage2D — copy a two-dimensional texture subimage
+
+ void glCopyTexSubImage2D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLint xoffset, | +
+ | GLint yoffset, | +
+ | GLint x, | +
+ | GLint y, | +
+ | GLsizei width, | +
+ | GLsizei height) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+xoffset
+
+
+ + Specifies a texel offset in the x direction within the texture array. +
+yoffset
+
+
+ + Specifies a texel offset in the y direction within the texture array. +
+x
,
+
+
+ y
+
+
+ + Specify the window coordinates of the lower left corner + of the rectangular region of pixels to be copied. +
+width
+
+
+ + Specifies the width of the texture subimage. +
+height
+
+
+ + Specifies the height of the texture subimage. +
+
+ glCopyTexSubImage2D
replaces a rectangular portion of a two-dimensional texture image or
+ cube-map texture image with pixels from the current GL_READ_BUFFER
+ (rather than from main memory, as is the case for glTexSubImage2D).
+
+ The screen-aligned pixel rectangle with lower left corner at
+ width
and height height
replaces the portion of the
+ texture array with x indices xoffset
through
+ yoffset
through
+ level
.
+
+ The pixels in the rectangle are processed exactly as if
+ glReadPixels had been called, but the process stops after
+ conversion to RGBA values. The error GL_INVALID_OPERATION
is generated if integer RGBA data is
+ required and the format of the current color buffer is not integer; or if floating- or fixed-point RGBA
+ data is required and the format of the current color buffer is integer.
+
+ The destination rectangle in the texture array may not include any texels + outside the texture array as it was originally specified. + It is not an error to specify a subtexture with zero width or height, but + such a specification has no effect. +
+
+ If any of the pixels within the specified rectangle of the current
+ GL_READ_BUFFER
are outside the read window associated with the current
+ rendering context, then the values obtained for those pixels are undefined.
+
+ No change is made to the internalformat, width, + height, or border parameters of the specified texture + array or to texel values outside the specified subregion. +
++ glPixelStorei modes affect texture images. +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_OPERATION
is generated if the texture array has not been
+ defined by a previous glTexImage2D,
+ glCopyTexImage2D, or
+ glTexStorage2D operation.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if
+ GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if
+ GL_TEXTURE_WIDTH
,
+ GL_TEXTURE_HEIGHT
,
+ of the texture image being modified.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCopyTexSubImage2D | +✔ | +✔ | +
+ glCopyTexImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glReadBuffer, + glTexImage2D, + glTexImage3D, + glTexParameter, + glTexSubImage2D, + glTexSubImage3D +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glCopyTexSubImage3D — copy a three-dimensional texture subimage
+
+ void glCopyTexSubImage3D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLint xoffset, | +
+ | GLint yoffset, | +
+ | GLint zoffset, | +
+ | GLint x, | +
+ | GLint y, | +
+ | GLsizei width, | +
+ | GLsizei height) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_3D
or GL_TEXTURE_2D_ARRAY
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+xoffset
+
+
+ + Specifies a texel offset in the x direction within the texture array. +
+yoffset
+
+
+ + Specifies a texel offset in the y direction within the texture array. +
+zoffset
+
+
+ + Specifies a texel offset in the z direction within the texture array. +
+x
,
+
+
+ y
+
+
+ + Specify the window coordinates of the lower left corner + of the rectangular region of pixels to be copied. +
+width
+
+
+ + Specifies the width of the texture subimage. +
+height
+
+
+ + Specifies the height of the texture subimage. +
+
+ glCopyTexSubImage3D
replaces a rectangular portion of a three-dimensional
+ or two-dimensional array texture image with pixels from the current GL_READ_BUFFER
(rather
+ than from main memory, as is the case for glTexSubImage3D).
+
+ The screen-aligned pixel rectangle with lower left corner at
+ (x
, y
) and with
+ width width
and height height
replaces the portion of the
+ texture array with x indices xoffset
through
+ yoffset
through
+ zoffset
and at the mipmap level specified by level
.
+
+ The pixels in the rectangle are processed exactly as if + glReadPixels had been called, but the process stops after + conversion to RGBA values. +
++ The destination rectangle in the texture array may not include any texels + outside the texture array as it was originally specified. + It is not an error to specify a subtexture with zero width or height, but + such a specification has no effect. +
+
+ If any of the pixels within the specified rectangle of the current
+ GL_READ_BUFFER
are outside the read window associated with the current
+ rendering context, then the values obtained for those pixels are undefined.
+
+ No change is made to the internalformat, width, + height, depth, or border parameters of the specified texture + array or to texel values outside the specified subregion. +
++ glPixelStorei modes affect texture images. +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_3D
or
+ GL_TEXTURE_2D_ARRAY
.
+
+ GL_INVALID_OPERATION
is generated if the texture array has not
+ been defined by a previous glTexImage3D or
+ glTexStorage3D operation.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if
+ GL_MAX_3D_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if
+ GL_TEXTURE_WIDTH
,
+ GL_TEXTURE_HEIGHT
,
+ GL_TEXTURE_DEPTH
+ of the texture image being modified.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCopyTexSubImage3D | +- | +✔ | +
+ glCopyTexImage2D, + glCopyTexSubImage2D, + glPixelStorei, + glReadBuffer, + glTexImage2D, + glTexImage3D, + glTexParameter, + glTexSubImage2D, + glTexSubImage3D +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glCreateProgram — Creates a program object
+
+ GLuint glCreateProgram(
+ |
+ void) ; |
+
glCreateProgram
creates an empty
+ program object and returns a non-zero value by which it can be
+ referenced. A program object is an object to which shader
+ objects can be attached. This provides a mechanism to specify
+ the shader objects that will be linked to create a program. It
+ also provides a means for checking the compatibility of the
+ shaders that will be used to create a program (for instance,
+ checking the compatibility between a vertex shader and a
+ fragment shader). When no longer needed as part of a program
+ object, shader objects can be detached.
One or more executables are created in a program object by + successfully attaching shader objects to it with + glAttachShader, + successfully compiling the shader objects with + glCompileShader, + and successfully linking the program object with + glLinkProgram. + These executables are made part of current state when + glUseProgram + is called. Program objects can be deleted by calling + glDeleteProgram. + The memory associated with the program object will be deleted + when it is no longer part of current rendering state for any + context.
+Like buffer and texture objects, the name space for + program objects may be shared across a set of contexts, as long + as the server sides of the contexts share the same address + space. If the name space is shared across contexts, any attached + objects and the data associated with those attached objects are + shared as well.
+Applications are responsible for providing the + synchronization across API calls when objects are accessed from + different execution threads.
+This function returns 0 if an error occurs creating the program object.
+glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib + with a valid program object and the index of an active attribute + variable
+glGetActiveUniform + with a valid program object and the index of an active uniform + variable
+glGetAttachedShaders + with a valid program object
+glGetAttribLocation + with a valid program object and the name of an attribute + variable
+glGetProgramiv + with a valid program object and the parameter to be queried
+glGetProgramInfoLog + with a valid program object
+glGetUniform + with a valid program object and the location of a uniform + variable
+glGetUniformLocation + with a valid program object and the name of a uniform + variable
+ ++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCreateProgram | +✔ | +✔ | +
glAttachShader, + glBindAttribLocation, + glCreateShader, + glDeleteProgram, + glDetachShader, + glLinkProgram, + glUniform, + glUseProgram, + glValidateProgram
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glCreateShader — Creates a shader object
+
+ GLuint glCreateShader(
+ |
+ GLenum shaderType) ; |
+
shaderType
+
+
+ Specifies the type of shader to be created.
+ Must be one of GL_VERTEX_SHADER
+ or GL_FRAGMENT_SHADER
.
glCreateShader
creates an empty
+ shader object and returns a non-zero value by which it can be
+ referenced. A shader object is used to maintain the source code
+ strings that define a shader. shaderType
+ indicates the type of shader to be created. Three types of shaders
+ are supported. A shader of type
+ GL_VERTEX_SHADER
is a shader that is
+ intended to run on the programmable vertex processor. A shader of
+ type GL_FRAGMENT_SHADER
is a shader that is
+ intended to run on the programmable fragment processor.
When created, a shader object's
+ GL_SHADER_TYPE
parameter is set to either
+ GL_VERTEX_SHADER
or
+ GL_FRAGMENT_SHADER
, depending on the value
+ of shaderType
.
Like buffer and texture objects, the name space for + shader objects may be shared across a set of contexts, as long + as the server sides of the contexts share the same address + space. If the name space is shared across contexts, any attached + objects and the data associated with those attached objects are + shared as well.
+Applications are responsible for providing the + synchronization across API calls when objects are accessed from + different execution threads.
+This function returns 0 if an error occurs creating the + shader object.
+GL_INVALID_ENUM
is generated if
+ shaderType
is not an accepted value.
glGetShaderiv + with a valid shader object and the parameter to be queried
+glGetShaderInfoLog + with a valid shader object
+glGetShaderSource + with a valid shader object
+ ++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glCreateShader
+ |
+ ✔ | +✔ | +
glAttachShader, + glCompileShader, + glDeleteShader, + glDetachShader, + glShaderSource +
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glCullFace — specify whether front- or back-facing polygons can be culled
+
+ void glCullFace(
+ |
+ GLenum mode) ; |
+
mode
+
+
+
+ Specifies whether front- or back-facing polygons are candidates for culling.
+ Symbolic constants
+ GL_FRONT
, GL_BACK
, and GL_FRONT_AND_BACK
are accepted.
+ The initial value is GL_BACK
.
+
+ glCullFace
specifies whether front- or back-facing polygons are culled
+ (as specified by mode) when polygon culling is enabled. Polygon
+ culling is initially disabled.
+ To enable and disable polygon culling, call the
+ glEnable and glDisable commands
+ with the argument GL_CULL_FACE
.
+
+ glFrontFace specifies which of the clockwise and counterclockwise polygons + are front-facing and back-facing. + See glFrontFace. +
+
+ If mode
is GL_FRONT_AND_BACK
, no polygons are drawn, but other
+ primitives such as points and lines are drawn.
+
+ GL_INVALID_ENUM
is generated if mode
is not an accepted value.
+
+ glIsEnabled with argument GL_CULL_FACE
+
+ glGet with argument GL_CULL_FACE_MODE
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glCullFace | +✔ | +✔ | +
+ glEnable, + glFrontFace +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glDeleteBuffers — delete named buffer objects
+
+ void glDeleteBuffers(
+ |
+ GLsizei n, | +
+ | const GLuint * buffers) ; |
+
n
+
+
+ + Specifies the number of buffer objects to be deleted. +
+buffers
+
+
+ + Specifies an array of buffer objects to be deleted. +
+
+ glDeleteBuffers
deletes n
buffer objects named by the elements of the array buffers
.
+ After a buffer object is deleted it has no contents, and its name is again unused. Unused names in
+ buffers
that have been marked as used for the purposes of
+ glGenBuffers are marked as unused again.
+ Unused names in buffers are silently ignored, as is the value zero. If a buffer object is deleted while it is bound,
+ all bindings to that object in the current context are reset to zero. Bindings to that buffer in other contexts are not affected.
+
+ glDeleteBuffers
silently ignores 0's and names that do not correspond to
+ existing buffer objects.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsBuffer +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteBuffers | +✔ | +✔ | +
+ glBindBuffer, + glGenBuffers, + glGet +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDeleteFramebuffers — delete framebuffer objects
+
+ void glDeleteFramebuffers(
+ |
+ GLsizei n, | +
+ | GLuint *framebuffers) ; |
+
n
+
+
+ + Specifies the number of framebuffer objects to be deleted. +
+framebuffers
+
+
+
+ A pointer to an array containing n
framebuffer objects to be deleted.
+
+ glDeleteFramebuffers
deletes the n
framebuffer objects whose names are stored in
+ the array addressed by framebuffers
. Unused names in framebuffers
+ that have been marked as used for the purposes of
+ glGenFramebuffers are marked as unused again.
+ The name zero is reserved by the GL and is silently ignored, should it
+ occur in framebuffers
, as are other unused names. Once a framebuffer object is deleted, its name is again
+ unused and it has no attachments. If a framebuffer that is currently bound to one or more of the targets GL_DRAW_FRAMEBUFFER
+ or GL_READ_FRAMEBUFFER
is deleted, it is as though glBindFramebuffer
+ had been executed with the corresponding target
and framebuffer
zero.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteFramebuffers | +✔ | +✔ | +
+ glGenFramebuffers, + glBindFramebuffer, + glCheckFramebufferStatus +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDeleteProgram — Deletes a program object
+
+ void glDeleteProgram(
+ |
+ GLuint program) ; |
+
program
+
+
+ Specifies the program object to be + deleted.
+glDeleteProgram
frees the memory and
+ invalidates the name associated with the program object
+ specified by program.
This command
+ effectively undoes the effects of a call to
+ glCreateProgram.
If a program object is in use as part of current rendering
+ state, it will be flagged for deletion, but it will not be
+ deleted until it is no longer part of current state for any
+ rendering context. If a program object to be deleted has shader
+ objects attached to it, those shader objects will be
+ automatically detached but not deleted unless they have already
+ been flagged for deletion by a previous call to
+ glDeleteShader.
+ A value of 0 for program
will be silently
+ ignored.
To determine whether a program object has been flagged for
+ deletion, call
+ glGetProgramiv
+ with arguments program
and
+ GL_DELETE_STATUS
.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
glGet
+ with argument GL_CURRENT_PROGRAM
glGetProgramiv
+ with arguments program
and
+ GL_DELETE_STATUS
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteProgram | +✔ | +✔ | +
glCreateShader, + glDetachShader, + glUseProgram +
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDeleteQueries — delete named query objects
+
+ void glDeleteQueries(
+ |
+ GLsizei n, | +
+ | const GLuint * ids) ; |
+
n
+
+
+ + Specifies the number of query objects to be deleted. +
+ids
+
+
+ + Specifies an array of query objects to be deleted. +
+
+ glDeleteQueries
deletes n
query objects named by the elements of the array ids
.
+ After a query object is deleted, its name is again unused. Unused names in ids
+ that have been marked as used for the purposes of
+ glGenQueries are marked as unused again.
+ If an active query object is deleted its name immediately becomes unused, but the underlying object
+ is not deleted until it is no longer active.
+
+ glDeleteQueries
silently ignores 0's and names that do not correspond to
+ existing query objects.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsQuery +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteQueries | +- | +✔ | +
+ glBeginQuery, + glEndQuery, + glGenQueries, + glGetQueryiv, + glGetQueryObjectuiv +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDeleteRenderbuffers — delete renderbuffer objects
+
+ void glDeleteRenderbuffers(
+ |
+ GLsizei n, | +
+ | GLuint *renderbuffers) ; |
+
n
+
+
+ + Specifies the number of renderbuffer objects to be deleted. +
+renderbuffers
+
+
+
+ A pointer to an array containing n
renderbuffer objects to be deleted.
+
+ glDeleteRenderbuffers
deletes the n
renderbuffer objects whose names are stored in
+ the array addressed by renderbuffers
. Unused names in renderbuffers
+ that have been marked as used for the purposes of glGenRenderbuffers
+ are marked as unused again. The name zero is reserved by the GL and is silently ignored, should it
+ occur in renderbuffers
, as are other unused names. Once a renderbuffer object is deleted, its name is again
+ unused and it has no contents. If a renderbuffer that is currently bound to the target GL_RENDERBUFFER
+ is deleted, it is as though glBindRenderbuffer
+ had been executed with a target
of GL_RENDERBUFFER
and a name
of zero.
+
+ If a renderbuffer object is attached to one or more attachment points in the currently bound framebuffer, then it as if
+ glFramebufferRenderbuffer had been called, with a renderbuffer
+ of zero for each attachment point to which this image was attached in the currently bound framebuffer. In other words,
+ this renderbuffer object is first detached from all attachment ponits in the currently bound framebuffer. Note that the renderbuffer
+ image is specifically not detached from any non-bound framebuffers.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteRenderbuffers | +✔ | +✔ | +
+ glGenRenderbuffers, + glFramebufferRenderbuffer, + glRenderbufferStorage, + glRenderbufferStorageMultisample +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDeleteSamplers — delete named sampler objects
+
+ void glDeleteSamplers(
+ |
+ GLsizei n, | +
+ | const GLuint * samplers) ; |
+
n
+
+
+ + Specifies the number of sampler objects to be deleted. +
+samplers
+
+
+ + Specifies an array of sampler objects to be deleted. +
+
+ glDeleteSamplers
deletes n
sampler objects named by the elements of the array samplers
.
+ After a sampler object is deleted, its name is again unused. If a sampler object that is currently
+ bound to one or more texture units is deleted, it is as though
+ glBindSampler is called once for each texture unit
+ to which the sampler is bound, with unit
set to the texture unit and
+ sampler
set to zero. Unused names in samplers
that have been marked as
+ used for the purposes of glGenSamplers are marked as unused again.
+ Unused names in samplers
are silently ignored, as is the reserved name zero.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsSampler +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteSamplers | +- | +✔ | +
+ glGenSamplers, + glBindSampler, + glDeleteSamplers, + glIsSampler +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDeleteShader — Deletes a shader object
+
+ void glDeleteShader(
+ |
+ GLuint shader) ; |
+
shader
+
+
+ Specifies the shader object to be deleted.
+glDeleteShader
frees the memory and
+ invalidates the name associated with the shader object specified
+ by shader
. This command effectively
+ undoes the effects of a call to
+ glCreateShader.
If a shader object to be deleted is attached to a program
+ object, it will be flagged for deletion, but it will not be
+ deleted until it is no longer attached to any program object,
+ for any rendering context (i.e., it must be detached from
+ wherever it was attached before it will be deleted). A value of
+ 0 for shader
will be silently
+ ignored.
To determine whether an object has been flagged for
+ deletion, call
+ glGetShaderiv
+ with arguments shader
and
+ GL_DELETE_STATUS
.
GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
glGetAttachedShaders + with the program object to be queried
+glGetShaderiv
+ with arguments shader
and
+ GL_DELETE_STATUS
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteShader | +✔ | +✔ | +
glCreateProgram, + glCreateShader, + glDetachShader, + glUseProgram
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDeleteSync — delete a sync object
+
+ void glDeleteSync(
+ |
+ GLsync sync) ; |
+
sync
+
+
+ + The sync object to be deleted. +
+
+ glDeleteSync
deletes the sync object specified by sync
. If the fence command
+ corresponding to the specified sync object has completed, or if no glWaitSync
+ or glClientWaitSync commands are blocking on sync
,
+ the object is deleted immediately. Otherwise, sync
is flagged for deletion and will be deleted when
+ it is no longer associated with any fence command and is no longer blocking any glWaitSync
+ or glClientWaitSync command. In either case, after
+ glDeleteSync
returns, the name sync
is invalid and can no longer be used to
+ refer to the sync object.
+
+ glDeleteSync
will silently ignore a sync
value of zero.
+
+ GL_INVALID_VALUE
is generated if sync
is neither zero or the name of a sync object.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteSync | +- | +✔ | +
+ glFenceSync, + glWaitSync, + glClientWaitSync +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDeleteTextures — delete named textures
+
+ void glDeleteTextures(
+ |
+ GLsizei n, | +
+ | const GLuint * textures) ; |
+
n
+
+
+ + Specifies the number of textures to be deleted. +
+textures
+
+
+ + Specifies an array of textures to be deleted. +
+
+ glDeleteTextures
deletes n
textures named by the elements of the array textures
.
+ After a texture is deleted, it has no contents or dimensionality,
+ and its name is again unused.
+ If a texture that is currently bound is deleted, the binding reverts
+ to 0 (the default texture).
+
+ Unused names in textures
that have been marked as used for the purposes of
+ glGenTextures are marked as unused again.
+ glDeleteTextures
silently ignores 0's and names that do not correspond to
+ existing textures.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsTexture +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteTextures | +✔ | +✔ | +
+ glBindTexture, + glCopyTexImage2D, + glGenTextures, + glGet, + glGetTexParameter, + glTexImage2D, + glTexStorage2D, + glTexImage3D, + glTexStorage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glDeleteTransformFeedbacks — delete transform feedback objects
+
+ void glDeleteTransformFeedbacks(
+ |
+ GLsizei n, | +
+ | const GLuint *ids) ; |
+
n
+
+
+ + Specifies the number of transform feedback objects to delete. +
+ids
+
+
+ + Specifies an array of names of transform feedback objects to delete. +
+
+ glDeleteTransformFeedbacks
deletes the n
transform feedback objects
+ whose names are stored in the array ids
. Unused names in ids
+ that have been marked as used for the purposes of glGenTransformFeedbacks,
+ are marked as unused again. Unused names in ids
are
+ ignored, as is the name zero. After a transform feedback object is deleted, its name is again unused and it
+ has no contents. If an active transform feedback object is deleted, its name immediately becomes unused, but
+ the underlying object is not deleted until it is no longer active.
+
+ glGet with argument GL_TRANSFORM_FEEDBACK_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteTransformFeedbacks | +- | +✔ | +
+ glGenTransformFeedbacks, + glBindTransformFeedback, + glIsTransformFeedback, + glBeginTransformFeedback, + glPauseTransformFeedback, + glResumeTransformFeedback, + glEndTransformFeedback +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDeleteVertexArrays — delete vertex array objects
+
+ void glDeleteVertexArrays(
+ |
+ GLsizei n, | +
+ | const GLuint *arrays) ; |
+
n
+
+
+ + Specifies the number of vertex array objects to be deleted. +
+arrays
+
+
+
+ Specifies the address of an array containing the n
names of the objects to be deleted.
+
+ glDeleteVertexArrays
deletes n
vertex array objects whose names are stored in the
+ array addressed by arrays
. Once a vertex array object is deleted it has no contents and its name is
+ again unused. If a vertex array object that is currently bound is deleted, the binding for that object reverts to zero
+ and the default vertex array becomes current.
+
+ Unused names in arrays
that have been marked as used for the purposes of
+ glGenVertexArrays,
+ are marked as unused again. Unused names in arrays
are silently ignored, as is the value zero.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDeleteVertexArrays | +- | +✔ | +
+ glGenVertexArrays, + glIsVertexArray, + glBindVertexArray +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDepthFunc — specify the value used for depth buffer comparisons
+
+ void glDepthFunc(
+ |
+ GLenum func) ; |
+
func
+
+
+
+ Specifies the depth comparison function.
+ Symbolic constants
+ GL_NEVER
,
+ GL_LESS
,
+ GL_EQUAL
,
+ GL_LEQUAL
,
+ GL_GREATER
,
+ GL_NOTEQUAL
,
+ GL_GEQUAL
, and
+ GL_ALWAYS
are accepted.
+ The initial value is GL_LESS
.
+
+ glDepthFunc
specifies the function used to compare each incoming pixel depth value
+ with the depth value present in the depth buffer.
+ The comparison is performed only if depth testing is enabled.
+ (See glEnable and glDisable of GL_DEPTH_TEST
.)
+
+ func
specifies the conditions under which the pixel will be drawn.
+ The comparison functions are as follows:
+
GL_NEVER
+
+ + Never passes. +
+GL_LESS
+
+ + Passes if the incoming depth value is less than the stored depth value. +
+GL_EQUAL
+
+ + Passes if the incoming depth value is equal to the stored depth value. +
+GL_LEQUAL
+
+ + Passes if the incoming depth value is less than or equal to + the stored depth value. +
+GL_GREATER
+
+ + Passes if the incoming depth value is greater than the stored depth value. +
+GL_NOTEQUAL
+
+ + Passes if the incoming depth value is not equal to the stored depth value. +
+GL_GEQUAL
+
+ + Passes if the incoming depth value is greater than or equal to + the stored depth value. +
+GL_ALWAYS
+
+ + Always passes. +
+
+ The initial value of func
is GL_LESS
.
+ Initially, depth testing is disabled. If depth testing is disabled or if no
+ depth buffer exists, it is as if the depth test always passes.
+
+ Even if the depth buffer exists and the depth mask is non-zero, the
+ depth buffer is not updated if the depth test is disabled. In order to
+ unconditionally write to the depth buffer, the depth test should be enabled
+ and set to GL_ALWAYS
.
+
+ GL_INVALID_ENUM
is generated if func
is not an accepted value.
+
+ glGet with argument GL_DEPTH_FUNC
+
+ glIsEnabled with argument GL_DEPTH_TEST
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDepthFunc | +✔ | +✔ | +
+ glDepthRangef, + glEnable, + glPolygonOffset +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glDepthMask — enable or disable writing into the depth buffer
+
+ void glDepthMask(
+ |
+ GLboolean flag) ; |
+
flag
+
+
+
+ Specifies whether the depth buffer is enabled for writing.
+ If flag
is GL_FALSE
,
+ depth buffer writing is disabled.
+ Otherwise, it is enabled.
+ Initially, depth buffer writing is enabled.
+
+ glDepthMask
specifies whether the depth buffer is enabled for writing.
+ If flag
is GL_FALSE
,
+ depth buffer writing is disabled.
+ Otherwise, it is enabled.
+ Initially, depth buffer writing is enabled.
+
+ glGet with argument GL_DEPTH_WRITEMASK
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDepthMask | +✔ | +✔ | +
+ glColorMask, + glDepthFunc, + glDepthRangef, + glStencilMask +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glDepthRangef — specify mapping of depth values from normalized device coordinates to window coordinates
+
+ void glDepthRangef(
+ |
+ GLfloat n, | +
+ | GLfloat f) ; |
+
n
+
+
+ + Specifies the mapping of the near clipping plane to window coordinates. + The initial value is 0. +
+f
+
+
+ + Specifies the mapping of the far clipping plane to window coordinates. + The initial value is 1. +
+
+ After clipping and division by w,
+ depth coordinates range from
+ glDepthRangef
specifies a linear mapping of the normalized depth coordinates
+ in this range to window depth coordinates.
+ If a fixed-point depth representation is used, the parameters n
and f
+ are clamped to the range [0 to 1] when computing window z.
+
+ The setting of (0,1) maps the near plane to 0 and + the far plane to 1. + With this mapping, + the depth buffer range is fully utilized. +
+
+ It is not necessary that n
be less than f
.
+ Reverse mappings such as
+
+ glGet with argument GL_DEPTH_RANGE
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDepthRangef | +✔ | +✔ | +
+ glDepthFunc, + glPolygonOffset, + glViewport +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glDetachShader — Detaches a shader object from a program object to which it is attached
+
+ void glDetachShader(
+ |
+ GLuint program, | +
+ | GLuint shader) ; |
+
program
+
+
+ Specifies the program object from which to + detach the shader object.
+shader
+
+
+ Specifies the shader object to be + detached.
+glDetachShader
detaches the shader
+ object specified by shader
from the
+ program object specified by program
. This
+ command can be used to undo the effect of the command
+ glAttachShader.
If shader
has already been flagged
+ for deletion by a call to
+ glDeleteShader
+ and it is not attached to any other program object, it will be
+ deleted after it has been detached.
GL_INVALID_VALUE
is generated if either
+ program
or shader
+ is a value that was not generated by OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_OPERATION
is generated if
+ shader
is not attached to
+ program
.
glGetAttachedShaders + with the handle of a valid program object
+glGetShaderiv
+ with arguments shader
and
+ GL_DELETE_STATUS
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDetachShader | +✔ | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDrawArrays — render primitives from array data
+
+ void glDrawArrays(
+ |
+ GLenum mode, | +
+ | GLint first, | +
+ | GLsizei count) ; |
+
mode
+
+
+
+ Specifies what kind of primitives to render.
+ Symbolic constants
+ GL_POINTS
,
+ GL_LINE_STRIP
,
+ GL_LINE_LOOP
,
+ GL_LINES
,
+ GL_TRIANGLE_STRIP
,
+ GL_TRIANGLE_FAN
and
+ GL_TRIANGLES
+ are accepted.
+
first
+
+
+ + Specifies the starting index in the enabled arrays. +
+count
+
+
+ + Specifies the number of indices to be rendered. +
+
+ glDrawArrays
specifies multiple geometric primitives
+ with very few subroutine calls. It is possible to prespecify
+ separate arrays of attributes and use them to
+ construct a sequence of primitives with a single
+ call to glDrawArrays
.
+
+ When glDrawArrays
is called, it uses count
sequential elements from each
+ enabled array to construct a sequence of geometric primitives,
+ beginning with element first
. mode
specifies what kind of
+ primitives are constructed and how the array elements
+ construct those primitives.
+
+ To enable and disable a generic vertex attribute array, call + glEnableVertexAttribArray and + glDisableVertexAttribArray. +
++ If an array corresponding to a generic attribute required by a vertex shader + is not enabled, then the corresponding element is taken from the current generic + attribute state. +
+
+ GL_INVALID_ENUM
is generated if mode
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated if count
is negative.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to an
+ enabled array and the buffer object's data store is currently mapped.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound framebuffer is not
+ framebuffer complete (i.e. the return value from
+ glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE
).
+
+ GL_INVALID_OPERATION
is generated if recording the vertices of a primitive to the buffer objects being
+ used for transform feedback purposes would result in either exceeding the limits of any buffer object’s size,
+ or in exceeding the end position offset
+ size
- 1, as set
+ by glBindBufferRange.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDrawArrays | +✔ | +✔ | +
+ glCheckFramebufferStatus, + glDisableVertexAttribArray, + glDrawArraysInstanced, + glDrawElements, + glDrawElementsInstanced, + glDrawRangeElements, + glEnableVertexAttribArray +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glDrawArraysInstanced — draw multiple instances of a range of elements
+
+ void glDrawArraysInstanced(
+ |
+ GLenum mode, | +
+ | GLint first, | +
+ | GLsizei count, | +
+ | GLsizei primcount) ; |
+
mode
+
+
+
+ Specifies what kind of primitives to render. Symbolic constants GL_POINTS
,
+ GL_LINE_STRIP
, GL_LINE_LOOP
, GL_LINES
,
+ GL_TRIANGLE_STRIP
, GL_TRIANGLE_FAN
and GL_TRIANGLES
+ are accepted.
+
first
+
+
+ + Specifies the starting index in the enabled arrays. +
+count
+
+
+ + Specifies the number of indices to be rendered. +
+primcount
+
+
+ + Specifies the number of instances of the specified range of indices to be rendered. +
+
+ glDrawArraysInstanced
behaves identically to glDrawArrays
+ except that primcount
instances of the range of elements are executed. Those attributes
+ that have divisor N where N is other than zero
+ (as specified by glVertexAttribDivisor)
+ advance once every N instances. Thus, the element transferred from instanced
+ vertex attributes is given by:
+
+
+ The value of instance
may be read by a vertex shader as gl_InstanceID
.
+
+ To enable and disable a generic vertex attribute array, call + glEnableVertexAttribArray and + glDisableVertexAttribArray. +
++ If an array corresponding to a generic attribute required by a vertex shader + is not enabled, then the corresponding element is taken from the current generic + attribute state. +
+
+ GL_INVALID_ENUM
is generated if mode
is not one of
+ the accepted values.
+
+ GL_INVALID_VALUE
is generated if count
or primcount
are negative.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to an
+ enabled array and the buffer object's data store is currently mapped.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound framebuffer is not
+ framebuffer complete (i.e. the return value from
+ glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE
).
+
+ GL_INVALID_OPERATION
is generated if recording the vertices of a primitive to the buffer objects being
+ used for transform feedback purposes would result in either exceeding the limits of any buffer object’s size,
+ or in exceeding the end position offset
+ size
- 1, as set
+ by glBindBufferRange.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDrawArraysInstanced | +- | +✔ | +
+ glCheckFramebufferStatus, + glDisableVertexAttribArray, + glDrawArrays, + glDrawElements, + glDrawElementsInstanced, + glEnableVertexAttribArray , + glVertexAttribDivisor +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDrawBuffers — Specifies a list of color buffers to be drawn into
+
+ void glDrawBuffers(
+ |
+ GLsizei n, | +
+ | const GLenum *bufs) ; |
+
n
+
+
+ Specifies the number of buffers in
+ bufs
.
bufs
+
+
+ Points to an array of symbolic constants + specifying the buffers into which fragment colors or + data values will be written.
+glDrawBuffers
defines an array of
+ buffers into which outputs from the fragment shader data will
+ be written. If a fragment shader writes a value
+ to one or more user defined output
+ variables, then the value of each variable will be written into the
+ buffer specified at a location within bufs
+ corresponding to the location assigned to that user defined output.
+ The draw buffer used for user defined outputs assigned to locations
+ greater than or equal to n
is implicitly set
+ to GL_NONE
and any data written to such an output
+ is discarded.
The symbolic constants contained in
+ bufs
must be one of the following, depending on
+ whether GL is bound to the default framebuffer or not:
GL_NONE
+
+ The fragment shader output value is not written into + any color buffer.
+GL_BACK
+
+ The fragment shader output value is written into the + back color buffer.
+GL_COLOR_ATTACHMENT
+
+ n
+
+
+ The fragment shader output value is written into the
+ nth color attachment of the current framebuffer.
+ n may range from zero to the value of
+ GL_MAX_COLOR_ATTACHMENTS
.
Except for GL_NONE
, the preceding
+ symbolic constants may not appear more than once in
+ bufs
. The maximum number of draw buffers
+ supported is implementation dependent and can be queried by
+ calling
+ glGet
+ with the argument GL_MAX_DRAW_BUFFERS
.
If a fragment shader does not write to a user defined output variable,
+ the values of the fragment
+ colors following shader execution are undefined. For each
+ fragment generated in this situation, a different value may be
+ written into each of the buffers specified by
+ bufs
.
GL_INVALID_ENUM
is generated if one of the
+ values in bufs
is not an accepted
+ value.
GL_INVALID_OPERATION
is generated if the GL is bound
+ to the default framebuffer and n
is not 1, or if the value in
+ bufs
is one of the GL_COLOR_ATTACHMENT
n
+ tokens.
GL_INVALID_OPERATION
is generated if the GL is bound
+ to a framebuffer object and the ith buffer listed in bufs
+ is anything other than GL_NONE
or
+ GL_COLOR_ATTACHMENTS
i.
GL_INVALID_VALUE
is generated if
+ n
is less than 0 or greater than
+ GL_MAX_DRAW_BUFFERS
.
glGet
+ with argument GL_MAX_DRAW_BUFFERS
glGet
+ with argument GL_DRAW_BUFFER
i where
+ i indicates the number of the draw buffer
+ whose value is to be queried.
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDrawBuffers | +- | +✔ | +
+ glReadBuffer +
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDrawElements — render primitives from array data
+
+ void glDrawElements(
+ |
+ GLenum mode, | +
+ | GLsizei count, | +
+ | GLenum type, | +
+ | const GLvoid * indices) ; |
+
mode
+
+
+
+ Specifies what kind of primitives to render.
+ Symbolic constants
+ GL_POINTS
,
+ GL_LINE_STRIP
,
+ GL_LINE_LOOP
,
+ GL_LINES
,
+ GL_TRIANGLE_STRIP
,
+ GL_TRIANGLE_FAN
and
+ GL_TRIANGLES
+ are accepted.
+
count
+
+
+ + Specifies the number of elements to be rendered. +
+type
+
+
+
+ Specifies the type of the values in indices
. Must be one of
+ GL_UNSIGNED_BYTE
, GL_UNSIGNED_SHORT
, or
+ GL_UNSIGNED_INT
.
+
indices
+
+
+
+ Specifies a byte offset (cast to a pointer type) into the buffer bound to GL_ELEMENT_ARRAY_BUFFER
+ to start reading indices from. If no buffer is bound, specifies a pointer to the location where the indices are stored.
+
+ glDrawElements
specifies multiple geometric primitives
+ with very few subroutine calls. It is possible to prespecify
+ separate arrays of attributes and use them to
+ construct a sequence of primitives with a single
+ call to glDrawElements
.
+
+ When glDrawElements
is called, it uses count
sequential elements from an
+ enabled array, starting at indices
to construct a sequence of
+ geometric primitives. mode
specifies what kind of primitives are
+ constructed and how the array elements construct these primitives. If
+ more than one array is enabled, each is used.
+
+ To enable and disable a generic vertex attribute array, call + glEnableVertexAttribArray and + glDisableVertexAttribArray. +
++ If an array corresponding to a generic attribute required by a vertex shader + is not enabled, then the corresponding element is taken from the current generic + attribute state. +
+
+ GL_INVALID_ENUM
is generated if mode
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated if count
is negative.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to an
+ enabled array or the element array and the buffer object's data store is currently mapped.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound framebuffer is not
+ framebuffer complete (i.e. the return value from
+ glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE
).
+
+ GL_INVALID_OPERATION
is generated if transform feedback is active and not paused.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDrawElements | +✔ | +✔ | +
+ glCheckFramebufferStatus, + glDisableVertexAttribArray, + glDrawArrays, + glDrawArraysInstanced, + glDrawElementsInstanced, + glDrawRangeElements, + glEnableVertexAttribArray +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glDrawElementsInstanced — draw multiple instances of a set of elements
+
+ void glDrawElementsInstanced(
+ |
+ GLenum mode, | +
+ | GLsizei count, | +
+ | GLenum type, | +
+ | const void * indices, | +
+ | GLsizei primcount) ; |
+
mode
+
+
+
+ Specifies what kind of primitives to render.
+ Symbolic constants
+ GL_POINTS
,
+ GL_LINE_STRIP
,
+ GL_LINE_LOOP
,
+ GL_LINES
,
+ GL_TRIANGLE_STRIP
,
+ GL_TRIANGLE_FAN
and
+ GL_TRIANGLES
+ are accepted.
+
count
+
+
+ + Specifies the number of elements to be rendered. +
+type
+
+
+
+ Specifies the type of the values in indices
. Must be one of GL_UNSIGNED_BYTE
,
+ GL_UNSIGNED_SHORT
, or GL_UNSIGNED_INT
.
+
indices
+
+
+
+ Specifies a byte offset (cast to a pointer type) into the buffer bound to GL_ELEMENT_ARRAY_BUFFER
+ to start reading indices from. If no buffer is bound, specifies a pointer to the location where the indices are stored.
+
primcount
+
+
+ + Specifies the number of instances of the specified range of indices to be rendered. +
+
+ glDrawElementsInstanced
behaves identically to glDrawElements
+ except that primcount
instances of the set of elements are executed. Those attributes
+ that have divisor N where N is other than zero
+ (as specified by glVertexAttribDivisor)
+ advance once every N instances. Thus, the element transferred from instanced
+ vertex attributes is given by:
+
+
+ The value of instance
may be read by a vertex shader as gl_InstanceID
.
+
+ To enable and disable a generic vertex attribute array, call + glEnableVertexAttribArray and + glDisableVertexAttribArray. +
++ If an array corresponding to a generic attribute required by a vertex shader + is not enabled, then the corresponding element is taken from the current generic + attribute state. +
+
+ GL_INVALID_ENUM
is generated if mode
is not one of GL_POINTS
,
+ GL_LINE_STRIP
, GL_LINE_LOOP
, GL_LINES
,
+ GL_TRIANGLE_STRIP
, GL_TRIANGLE_FAN
, or GL_TRIANGLES
.
+
+ GL_INVALID_VALUE
is generated if count
or primcount
are negative.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to an
+ enabled array and the buffer object's data store is currently mapped.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound framebuffer is not
+ framebuffer complete (i.e. the return value from
+ glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE
).
+
+ GL_INVALID_OPERATION
is generated if transform feedback is active and not paused.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDrawElementsInstanced | +- | +✔ | +
+ glCheckFramebufferStatus, + glDisableVertexAttribArray, + glDrawElements, + glDrawArrays, + glDrawArraysInstanced, + glDrawRangeElements, + glEnableVertexAttribArray, + glVertexAttribDivisor +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glDrawRangeElements — render primitives from array data
+
+ void glDrawRangeElements(
+ |
+ GLenum mode, | +
+ | GLuint start, | +
+ | GLuint end, | +
+ | GLsizei count, | +
+ | GLenum type, | +
+ | const GLvoid * indices) ; |
+
mode
+
+
+
+ Specifies what kind of primitives to render.
+ Symbolic constants
+ GL_POINTS
,
+ GL_LINE_STRIP
,
+ GL_LINE_LOOP
,
+ GL_LINES
,
+ GL_TRIANGLE_STRIP
,
+ GL_TRIANGLE_FAN
and
+ GL_TRIANGLES
+ are accepted.
+
start
+
+
+
+ Specifies the minimum array index contained in indices
.
+
end
+
+
+
+ Specifies the maximum array index contained in indices
.
+
count
+
+
+ + Specifies the number of elements to be rendered. +
+type
+
+
+
+ Specifies the type of the values in indices
. Must be one of
+ GL_UNSIGNED_BYTE
, GL_UNSIGNED_SHORT
, or
+ GL_UNSIGNED_INT
.
+
indices
+
+
+
+ Specifies a byte offset (cast to a pointer type) into the buffer bound to GL_ELEMENT_ARRAY_BUFFER
+ to start reading indices from. If no buffer is bound, specifies a pointer to the location where the indices are stored.
+
+ glDrawRangeElements
is a restricted form of glDrawElements. mode
, count
,
+ and type
match the corresponding arguments to glDrawElements, with
+ the additional constraint that all values in the arrays count
must lie
+ between start
and end
, inclusive.
+
+ Implementations denote recommended maximum amounts of vertex and
+ index data,
+ which may be queried by calling glGet with argument
+ GL_MAX_ELEMENTS_VERTICES
and GL_MAX_ELEMENTS_INDICES
.
+ If
+ GL_MAX_ELEMENTS_VERTICES
, or if count
is greater than the value of
+ GL_MAX_ELEMENTS_INDICES
, then the call may operate at reduced
+ performance. There is no requirement that all vertices in the range
+
+ When glDrawRangeElements
is called, it uses count
sequential elements from an
+ enabled array, starting at start
to construct a sequence of
+ geometric primitives. mode
specifies what kind of primitives are
+ constructed, and how the array elements construct these primitives. If
+ more than one array is enabled, each is used.
+
+ To enable and disable a generic vertex attribute array, call + glEnableVertexAttribArray and + glDisableVertexAttribArray. +
++ If an array corresponding to a generic attribute required by a vertex shader + is not enabled, then the corresponding element is taken from the current generic + attribute state. +
+
+ It is an error for indices to lie outside the range
+
+ GL_INVALID_ENUM
is generated if mode
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated if count
is negative.
+
+ GL_INVALID_VALUE
is generated if
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to an
+ enabled array or the element array and the buffer object's data store is currently mapped.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound framebuffer is not
+ framebuffer complete (i.e. the return value from
+ glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE
).
+
+ GL_INVALID_OPERATION
is generated if transform feedback is active and not paused.
+
+ glGet with argument GL_MAX_ELEMENTS_VERTICES
+
+ glGet with argument GL_MAX_ELEMENTS_INDICES
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glDrawRangeElements | +- | +✔ | +
+ glCheckFramebufferStatus, + glDisableVertexAttribArray, + glDrawArrays, + glDrawElements, + glDrawArraysInstanced, + glDrawElementsInstanced, + glEnableVertexAttribArray, +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glEnable — enable or disable server-side GL capabilities
+
+ void glEnable(
+ |
+ GLenum cap) ; |
+
+ void glDisable(
+ |
+ GLenum cap) ; |
+
cap
+
+
+ + Specifies a symbolic constant indicating a GL capability. +
+
+ glEnable
and
+ glDisable
+ enable and disable various capabilities. Use
+ glIsEnabled
+ or
+ glGet
+ to determine the current setting of any capability. The initial
+ value for each capability with the exception of
+ GL_DITHER
is GL_FALSE
.
+ The initial value for GL_DITHER
is
+ GL_TRUE
.
+
+ Both glEnable
and glDisable take a single argument, cap
,
+ which can assume one of the following values:
+
GL_BLEND
+
+ + If enabled, + blend the computed fragment color values with the values in the color + buffers. See glBlendFunc. +
+GL_CULL_FACE
+
+ +
++ If enabled, + cull polygons based on their winding in window coordinates. + See glCullFace. +
+GL_DEPTH_TEST
+
+ + If enabled, + do depth comparisons and update the depth buffer. Note that even if + the depth buffer exists and the depth mask is non-zero, the + depth buffer is not updated if the depth test is disabled. See + glDepthFunc and + glDepthRangef. +
+GL_DITHER
+ + If enabled, + dither color components or indices before they are written to the + color buffer. +
+GL_POLYGON_OFFSET_FILL
+
+ + If enabled, an offset is added to depth values of a polygon's + fragments before the depth comparison is performed. + See glPolygonOffset. +
+GL_PRIMITIVE_RESTART_FIXED_INDEX
+
+
+ Enables primitive restarting. If enabled, any one of the draw commands
+ which transfers a set of generic attribute array elements to the GL will restart
+ the primitive when the index of the vertex is equal to
+
+ where n is 8, 16 or 32 if the type is
+ GL_UNSIGNED_BYTE
,
+ GL_UNSIGNED_SHORT
, or
+ GL_UNSIGNED_INT
, respectively.
+
GL_RASTERIZER_DISCARD
+
+ + If enabled, primitives are discarded immediately before the rasterization stage, + but after the optional transform feedback stage. + glClear and + glClearBuffer* commands + are also ignored. +
+GL_SAMPLE_ALPHA_TO_COVERAGE
+
+ + If enabled, + compute a temporary coverage value where each bit is determined by the + alpha value at the corresponding sample location. The temporary coverage + value is then ANDed with the fragment coverage value. +
+GL_SAMPLE_COVERAGE
+
+
+ If enabled,
+ the fragment's coverage is ANDed with the temporary coverage value. If
+ GL_SAMPLE_COVERAGE_INVERT
is set to GL_TRUE
, invert the coverage
+ value.
+ See glSampleCoverage.
+
GL_SCISSOR_TEST
+
+ + If enabled, + discard fragments that are outside the scissor rectangle. + See glScissor. +
+GL_STENCIL_TEST
+
+ + If enabled, + do stencil testing and update the stencil buffer. + See glStencilFunc and glStencilOp. +
+
+ GL_INVALID_ENUM
is generated if cap
is not one of the values
+ listed previously.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glEnable
+ |
+ ✔ | +✔ | +
+ glDisable
+ |
+ ✔ | +✔ | +
+ glBlendFunc, + glCullFace, + glDepthFunc, + glDepthRangef, + glGet, + glIsEnabled, + glPolygonOffset, + glSampleCoverage, + glScissor, + glStencilFunc, + glStencilOp, +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glEnableVertexAttribArray — Enable or disable a generic vertex attribute array
+
+ void glEnableVertexAttribArray(
+ |
+ GLuint index) ; |
+
+ void glDisableVertexAttribArray(
+ |
+ GLuint index) ; |
+
index
+
+
+ Specifies the index of the generic vertex + attribute to be enabled or disabled.
+glEnableVertexAttribArray
enables the
+ generic vertex attribute array specified by
+ index
.
+ glDisableVertexAttribArray
disables the
+ generic vertex attribute array specified by
+ index
. By default, all generic vertex
+ attribute arrays are disabled. If enabled, the values in the generic vertex
+ attribute array will be accessed and used for rendering when
+ calls are made to vertex array commands such as
+ glDrawArrays,
+ glDrawArraysInstanced,
+ glDrawElements,
+ glDrawElementsInstanced,
+ or
+ glDrawRangeElements.
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to
+ GL_MAX_VERTEX_ATTRIBS
.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttrib
+ with arguments index
and
+ GL_VERTEX_ATTRIB_ARRAY_ENABLED
+
+ glGetVertexAttribPointerv
+ with arguments index
and
+ GL_VERTEX_ATTRIB_ARRAY_POINTER
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glEnableVertexAttribArray
+ |
+ ✔ | +✔ | +
+ glDisableVertexAttribArray
+ |
+ ✔ | +✔ | +
+ glBindAttribLocation, + glDrawArrays, + glDrawArraysInstanced, + glDrawElements, + glDrawElementsInstanced, + glDrawRangeElements, + glVertexAttrib, + glVertexAttribPointer +
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glFenceSync — create a new sync object and insert it into the GL command stream
+
+ GLsync glFenceSync(
+ |
+ GLenum condition, | +
+ | GLbitfield flags) ; |
+
condition
+
+
+
+ Specifies the condition that must be met to set the sync object's state to signaled. condition
+ must be GL_SYNC_GPU_COMMANDS_COMPLETE
.
+
flags
+
+
+
+ Specifies a bitwise combination of flags controlling the behavior of the sync object. No flags are presently defined
+ for this operation and flags
must be zero.[1]
+
+ glFenceSync
creates a new fence sync object, inserts a fence command into the GL command stream and
+ associates it with that sync object, and returns a non-zero name corresponding to the sync object.
+
+ When the specified condition
of the sync object is satisfied by the fence command, the sync object
+ is signaled by the GL, causing any glWaitSync,
+ glClientWaitSync commands blocking in sync
+ to unblock. No other state is affected by glFenceSync
or by the execution
+ of the associated fence command.
+
+ condition
must be GL_SYNC_GPU_COMMANDS_COMPLETE
. This condition is satisfied by
+ completion of the fence command corresponding to the sync object and all preceding commands in the same command stream.
+ The sync object will not be signaled until all effects from these commands on GL client and server state and the
+ framebuffer are fully realized. Note that completion of the fence command occurs once the state of the corresponding sync
+ object has been changed, but commands waiting on that sync object may not be unblocked until after the fence command completes.
+
+ GL_INVALID_ENUM
is generated if condition
is not
+ GL_SYNC_GPU_COMMANDS_COMPLETE
.
+
+ GL_INVALID_VALUE
is generated if flags
is not zero.
+
+ Additionally, if glFenceSync
fails, it will return zero.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glFenceSync | +- | +✔ | +
+ glDeleteSync, + glGetSynciv, + glWaitSync, + glClientWaitSync +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+[1]
+ flags
is a placeholder for anticipated future extensions of fence sync object capabilities.
+
glFinish — block until all GL execution is complete
+
+ void glFinish(
+ |
+ void) ; |
+
+ glFinish
does not return until the effects of all previously
+ called GL commands are complete.
+ Such effects include all changes to GL state,
+ all changes to connection state,
+ and all changes to the frame buffer contents.
+
+ glFinish
requires a round trip to the server.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glFinish | +✔ | +✔ | +
+ glFlush +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glFlush — force execution of GL commands in finite time
+
+ void glFlush(
+ |
+ void) ; |
+
+ Different GL implementations buffer commands in several different locations,
+ including network buffers and the graphics accelerator itself.
+ glFlush
empties all of these buffers,
+ causing all issued commands to be executed as quickly as
+ they are accepted by the actual rendering engine.
+ Though this execution may not be completed in any particular
+ time period,
+ it does complete in finite time.
+
+ Because any GL program might be executed over a network,
+ or on an accelerator that buffers commands,
+ all programs should call glFlush
whenever they count on having
+ all of their previously issued commands completed.
+ For example,
+ call glFlush
before waiting for user input that depends on
+ the generated image.
+
+ glFlush
can return at any time.
+ It does not wait until the execution of all previously
+ issued GL commands is complete.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glFlush | +✔ | +✔ | +
+ glFinish +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glFlushMappedBufferRange — indicate modifications to a range of a mapped buffer
+
+ GLsync glFlushMappedBufferRange(
+ |
+ GLenum target, | +
+ | GLintptr offset, | +
+ | GLsizeiptr length) ; |
+
target
+
+
+
+ Specifies the target of the flush operation. target
must be GL_ARRAY_BUFFER
,
+ GL_COPY_READ_BUFFER
, GL_COPY_WRITE_BUFFER
, GL_ELEMENT_ARRAY_BUFFER
,
+ GL_PIXEL_PACK_BUFFER
, GL_PIXEL_UNPACK_BUFFER
,
+ GL_TRANSFORM_FEEDBACK_BUFFER
, or GL_UNIFORM_BUFFER
.
+
offset
+
+
+ + Specifies the start of the buffer subrange, in basic machine units. +
+length
+
+
+ + Specifies the length of the buffer subrange, in basic machine units. +
+
+ glFlushMappedBufferRange
indicates that modifications have been made to a range of a mapped buffer.
+ The buffer must previously have been mapped with the GL_MAP_FLUSH_EXPLICIT
flag. offset
+ and length
indicate the modified subrange of the mapping, in basic units. The specified subrange to flush
+ is relative to the start of the currently mapped range of the buffer. glFlushMappedBufferRange
may be called
+ multiple times to indicate distinct subranges of the mapping which require flushing.
+
+ GL_INVALID_VALUE
is generated if offset
or length
+ is negative, or if offset
+ length
exceeds the size of the mapping.
+
+ GL_INVALID_OPERATION
is generated if zero is bound to target
.
+
+ GL_INVALID_OPERATION
is generated if the buffer bound to target
is not
+ mapped, or is mapped without the GL_MAP_FLUSH_EXPLICIT
flag.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glFlushMappedBufferRange | +- | +✔ | +
+ glMapBufferRange, + glUnmapBuffer +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glFramebufferRenderbuffer — attach a renderbuffer as a logical buffer to the currently bound framebuffer object
+
+ GLsync glFramebufferRenderbuffer(
+ |
+ GLenum target, | +
+ | GLenum attachment, | +
+ | GLenum renderbuffertarget, | +
+ | GLuint renderbuffer) ; |
+
target
+
+
+
+ Specifies the framebuffer target. target
must be GL_DRAW_FRAMEBUFFER
,
+ GL_READ_FRAMEBUFFER
, or GL_FRAMEBUFFER
. GL_FRAMEBUFFER
+ is equivalent to GL_DRAW_FRAMEBUFFER
.
+
attachment
+
+
+ + Specifies the attachment point of the framebuffer. +
+renderbuffertarget
+
+
+
+ Specifies the renderbuffer target and must be GL_RENDERBUFFER
.
+
renderbuffer
+
+
+
+ Specifies the name of an existing renderbuffer object of type renderbuffertarget
to attach.
+
+ glFramebufferRenderbuffer
attaches a renderbuffer as one of the logical buffers of the
+ currently bound framebuffer object. renderbuffer
is the name of the renderbuffer object
+ to attach and must be either zero, or the name of an existing renderbuffer object of type renderbuffertarget
.
+ If renderbuffer
is not zero and if glFramebufferRenderbuffer
is
+ successful, then the renderbuffer name renderbuffer
will be used as the logical buffer
+ identified by attachment
of the framebuffer currently bound to target
.
+
+ The value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
for the specified attachment point is
+ set to GL_RENDERBUFFER
and the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
+ is set to renderbuffer
. All other state values of the attachment point specified by
+ attachment
are set to their default values. No change is made to the state of the renderbuuffer
+ object and any previous attachment to the attachment
logical buffer of the framebuffer
+ target
is broken.
+
+ Calling glFramebufferRenderbuffer
with the renderbuffer name zero will detach the image, if any,
+ identified by attachment
, in the framebuffer currently bound to target
.
+ All state values of the attachment point specified by attachment in the object bound to target are set to their default values.
+
+ Setting attachment
to the value GL_DEPTH_STENCIL_ATTACHMENT
is a special
+ case causing both the depth and stencil attachments of the framebuffer object to be set to renderbuffer
,
+ which should have the base internal format GL_DEPTH_STENCIL
.
+
+ GL_INVALID_ENUM
is generated if target
is not one of the accepted tokens.
+
+ GL_INVALID_ENUM
is generated if renderbuffertarget
is not GL_RENDERBUFFER
.
+
+ GL_INVALID_OPERATION
is generated if zero is bound to target
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glFramebufferRenderbuffer | +✔ | +✔ | +
+ glGenFramebuffers, + glBindFramebuffer, + glGenRenderbuffers, + glFramebufferTexture, + glFramebufferTexture2D, + glFramebufferTextureLayer +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glFramebufferTexture2D — attach a level of a texture object as a logical buffer to the currently bound framebuffer object
+
+ void glFramebufferTexture2D(
+ |
+ GLenum target, | +
+ | GLenum attachment, | +
+ | GLenum textarget, | +
+ | GLuint texture, | +
+ | GLint level) ; |
+
target
+
+
+
+ Specifies the framebuffer target. target
must be GL_DRAW_FRAMEBUFFER
,
+ GL_READ_FRAMEBUFFER
, or GL_FRAMEBUFFER
. GL_FRAMEBUFFER
+ is equivalent to GL_DRAW_FRAMEBUFFER
.
+
attachment
+
+
+
+ Specifies the attachment point of the framebuffer. attachment
must be
+ GL_COLOR_ATTACHMENT
i, GL_DEPTH_ATTACHMENT
,
+ GL_STENCIL_ATTACHMENT
or GL_DEPTH_STENCIL_ATTACHMENT
.
+
textarget
+
+
+ + Specifies a 2D texture target, or for cube map textures, which face is to be attached. +
+texture
+
+
+
+ Specifies the texture object to attach to the framebuffer attachment point named by attachment
.
+
level
+
+
+
+ Specifies the mipmap level of texture
to attach.
+
+ glFramebufferTexture2D
attaches a selected mipmap level or image of a texture object as one of the
+ logical buffers of the framebuffer object currently bound to target
. target
must
+ be GL_DRAW_FRAMEBUFFER
, GL_READ_FRAMEBUFFER
, or GL_FRAMEBUFFER
.
+ GL_FRAMEBUFFER
is equivalent to GL_DRAW_FRAMEBUFFER
.
+
+ attachment
specifies the logical attachment of the framebuffer and must be
+ GL_COLOR_ATTACHMENT
i, GL_DEPTH_ATTACHMENT
,
+ GL_STENCIL_ATTACHMENT
or GL_DEPTH_STENCIL_ATTACHMENT
.
+ i in GL_COLOR_ATTACHMENT
i may range from zero to
+ the value of GL_MAX_COLOR_ATTACHMENTS
- 1. Attaching a level of a texture to
+ GL_DEPTH_STENCIL_ATTACHMENT
is equivalent to attaching that level to both the
+ GL_DEPTH_ATTACHMENT
and the GL_STENCIL_ATTACHMENT
+ attachment points simultaneously.
+
+ textarget
specifies what type of texture is named by texture
, and for
+ cube map textures, specifies the face that is to be attached. If texture
is not zero, it
+ must be the name of an existing two dimensional texture with textarget
set to GL_TEXTURE_2D
,
+ unless it is a cube map texture, in which case textarget
must be
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
, GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
, GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ If texture
is non-zero, the specified level
of the texture object named
+ texture
is attached to the framebuffer attachment point named by attachment
.
+
+ If textarget
is one of GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_POSITIVE_Z
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
, then level
must be greater
+ than or equal to zero and less than or equal to log2 of the value of
+ GL_MAX_CUBE_MAP_TEXTURE_SIZE
. If textarget
is GL_TEXTURE_2D
,
+ level
must be greater than or equal to zero and no larger than log2
+ of the value of GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_ENUM
is generated if target
is not one of the accepted tokens.
+
+ GL_INVALID_ENUM
is generated if renderbuffertarget
is not GL_RENDERBUFFER
.
+
+ GL_INVALID_OPERATION
is generated if zero is bound to target
.
+
+ GL_INVALID_OPERATION
is generated if textarget
and texture
+ are not compatible.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glFramebufferTexture2D | +✔ | +✔ | +
+ glGenFramebuffers, + glBindFramebuffer, + glGenRenderbuffers, + glFramebufferRenderbuffer, + glFramebufferTextureLayer, +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glFramebufferTextureLayer — attach a single layer of a texture to a framebuffer
+
+ void glFramebufferTextureLayer(
+ |
+ GLenum target, | +
+ | GLenum attachment, | +
+ | GLuint texture, | +
+ | GLint level, | +
+ | GLint layer) ; |
+
target
+
+
+
+ Specifies the framebuffer target. target
must be GL_DRAW_FRAMEBUFFER
,
+ GL_READ_FRAMEBUFFER
, or GL_FRAMEBUFFER
. GL_FRAMEBUFFER
+ is equivalent to GL_DRAW_FRAMEBUFFER
.
+
attachment
+
+
+
+ Specifies the attachment point of the framebuffer. attachment
must be
+ GL_COLOR_ATTACHMENT
i, GL_DEPTH_ATTACHMENT
,
+ GL_STENCIL_ATTACHMENT
or GL_DEPTH_STENCIL_ATTACHMMENT
.
+
texture
+
+
+
+ Specifies the texture object to attach to the framebuffer attachment point named by attachment
.
+
level
+
+
+
+ Specifies the mipmap level of texture
to attach.
+
layer
+
+
+
+ Specifies the layer of texture
to attach.
+
+ glFramebufferTextureLayer
operates like glFramebufferTexture2D,
+ except that only a single layer of the texture level, given by layer
, is attached to the attachment point.
+ If texture
is not zero, layer
must be greater than or equal to zero.
+ texture
must either be zero or the name of an existing three-dimensional texture, or a two-dimensional
+ array texture.
+
+ If texture
is a 3D texture, then level
must be greater
+ than or equal to zero and less than or equal to log2 of the value of
+ GL_MAX_3D_TEXTURE_SIZE
. If texture
is a 2D array texture,
+ level
must be greater than or equal to zero and no larger than log2
+ of the value of GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_ENUM
is generated if target
is not one of the accepted tokens.
+
+ GL_INVALID_ENUM
is generated if attachment
is not one of the accepted tokens.
+
+ GL_INVALID_VALUE
is generated if texture
is not zero or the name of an existing
+ texture object.
+
+ GL_INVALID_VALUE
is generated if texture
is not zero and layer
+ is negative.
+
+ GL_INVALID_VALUE
is generated if
+ texture
is not zero and
+ layer
is greater than the value of
+ GL_MAX_3D_TEXTURE_SIZE
minus one for a 3D
+ texture or greater than the value of
+ GL_MAX_ARRAY_TEXTURE_LAYERS
minus one for a
+ 2D array texture.
+
+ GL_INVALID_OPERATION
is generated if zero is bound to target
.
+
+ GL_INVALID_OPERATION
is generated if texture
is not zero or the name of an existing
+ three-dimensional texture, or a two-dimensional array texture.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glFramebufferTextureLayer | +- | +✔ | +
+ glGenFramebuffers, + glBindFramebuffer, + glGenRenderbuffers, + glFramebufferRenderbuffer, + glFramebufferTexture2D, +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glFrontFace — define front- and back-facing polygons
+
+ void glFrontFace(
+ |
+ GLenum mode) ; |
+
mode
+
+
+
+ Specifies the orientation of front-facing polygons.
+ GL_CW
and GL_CCW
are accepted.
+ The initial value is GL_CCW
.
+
+ In a scene composed entirely of opaque closed surfaces,
+ back-facing polygons are never visible.
+ Eliminating these invisible polygons has the obvious benefit
+ of speeding up the rendering of the image.
+ To enable and disable elimination of back-facing polygons, call glEnable
+ and glDisable with argument GL_CULL_FACE
.
+
+ The projection of a polygon to window coordinates is said to have
+ clockwise winding if an imaginary object following the path
+ from its first vertex,
+ its second vertex,
+ and so on,
+ to its last vertex,
+ and finally back to its first vertex,
+ moves in a clockwise direction about the interior of the polygon.
+ The polygon's winding is said to be counterclockwise if the imaginary
+ object following the same path moves in a counterclockwise direction
+ about the interior of the polygon.
+ glFrontFace
specifies whether polygons with clockwise winding in window coordinates,
+ or counterclockwise winding in window coordinates,
+ are taken to be front-facing.
+ Passing GL_CCW
to mode
selects counterclockwise polygons as
+ front-facing;
+ GL_CW
selects clockwise polygons as front-facing.
+ By default, counterclockwise polygons are taken to be front-facing.
+
+ GL_INVALID_ENUM
is generated if mode
is not an accepted value.
+
+ glGet with argument GL_FRONT_FACE
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glFrontFace | +✔ | +✔ | +
+ glCullFace, +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glGenBuffers — generate buffer object names
+
+ void glGenBuffers(
+ |
+ GLsizei n, | +
+ | GLuint * buffers) ; |
+
n
+
+
+ + Specifies the number of buffer object names to be generated. +
+buffers
+
+
+ + Specifies an array in which the generated buffer object names are stored. +
+
+ glGenBuffers
returns n
buffer object names in buffers
.
+ There is no guarantee that the names form a contiguous set of integers;
+ however, it is guaranteed that none of the returned names was in use
+ immediately before the call to glGenBuffers
.
+
+ Buffer object names returned by a call to glGenBuffers
are not returned by
+ subsequent calls, unless they are first deleted with
+ glDeleteBuffers.
+
+ The names returned in buffers
are marked as used, for the purposes of glGenBuffers
only,
+ but they acquire state and type only when they are first bound by calling
+ glBindBuffer.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsBuffer +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGenBuffers | +✔ | +✔ | +
+ glBindBuffer, + glDeleteBuffers, + glGet +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGenFramebuffers — generate framebuffer object names
+
+ void glGenFramebuffers(
+ |
+ GLsizei n, | +
+ | GLuint *framebuffers) ; |
+
n
+
+
+ + Specifies the number of framebuffer object names to generate. +
+framebuffers
+
+
+ + Specifies an array in which the generated framebuffer object names are stored. +
+
+ glGenFramebuffers
returns n
framebuffer object names in framebuffers
.
+ There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names
+ was in use immediately before the call to glGenFramebuffers
.
+
+ Framebuffer object names returned by a call to glGenFramebuffers
are not returned by subsequent calls, unless
+ they are first deleted with glDeleteFramebuffers.
+
+ The names returned in framebuffers
are marked as used, for the purposes of glGenFramebuffers
only,
+ but they acquire state and type only when they are first bound.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsFramebuffer, + glGetFramebufferAttachmentParameteriv +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGenFramebuffers | +✔ | +✔ | +
+ glBindFramebuffer, + glDeleteFramebuffers, + glGet +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGenQueries — generate query object names
+
+ void glGenQueries(
+ |
+ GLsizei n, | +
+ | GLuint * ids) ; |
+
n
+
+
+ + Specifies the number of query object names to be generated. +
+ids
+
+
+ + Specifies an array in which the generated query object names are stored. +
+
+ glGenQueries
returns n
query object names in ids
.
+ There is no guarantee that the names form a contiguous set of integers;
+ however, it is guaranteed that none of the returned names was in use
+ immediately before the call to glGenQueries
.
+
+ Query object names returned by a call to glGenQueries
are not returned by
+ subsequent calls, unless they are first deleted with
+ glDeleteQueries.
+
+ The names returned in ids
are marked as used, for the purposes of glGenQueries
only,
+ but no query objects are associated with the returned query object names until they are first used by calling
+ glBeginQuery.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsQuery +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGenQueries | +- | +✔ | +
+ glBeginQuery, + glDeleteQueries, + glEndQuery, + glGet +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGenRenderbuffers — generate renderbuffer object names
+
+ void glGenRenderbuffers(
+ |
+ GLsizei n, | +
+ | GLuint *renderbuffers) ; |
+
n
+
+
+ + Specifies the number of renderbuffer object names to generate. +
+renderbuffers
+
+
+ + Specifies an array in which the generated renderbuffer object names are stored. +
+
+ glGenRenderbuffers
returns n
renderbuffer object names in renderbuffers
.
+ There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names
+ was in use immediately before the call to glGenRenderbuffers
.
+
+ Renderbuffer object names returned by a call to glGenRenderbuffers
are not returned by subsequent calls, unless
+ they are first deleted with glDeleteRenderbuffers.
+
+ The names returned in renderbuffers
are marked as used, for the purposes of glGenRenderbuffers
only,
+ but they acquire state and type only when they are first bound.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGenRenderbuffers | +✔ | +✔ | +
+ glBindRenderbuffer, + glFramebufferRenderbuffer, + glDeleteRenderbuffers +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGenSamplers — generate sampler object names
+
+ void glGenSamplers(
+ |
+ GLsizei n, | +
+ | GLuint *samplers) ; |
+
n
+
+
+ + Specifies the number of sampler object names to generate. +
+samplers
+
+
+ + Specifies an array in which the generated sampler object names are stored. +
+
+ glGenSamplers
returns n
sampler object names in samplers
.
+ There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names
+ was in use immediately before the call to glGenSamplers
.
+
+ Sampler object names returned by a call to glGenSamplers
are not returned by subsequent calls, unless
+ they are first deleted with glDeleteSamplers.
+
+ The names returned in samplers
are marked as used, for the purposes of glGenSamplers
only,
+ but they acquire state and type only when they are first used as a parameter to
+ glBindSampler,
+ glSamplerParameter*,
+ glGetSamplerParameter* or
+ glIsSampler.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsSampler, + glGetSamplerParameter +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGenSamplers | +- | +✔ | +
+ glBindSampler, + glDeleteSamplers, + glIsSampler, + glGetSamplerParameter, + glSamplerParameter +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGenTextures — generate texture names
+
+ void glGenTextures(
+ |
+ GLsizei n, | +
+ | GLuint * textures) ; |
+
n
+
+
+ + Specifies the number of texture names to be generated. +
+textures
+
+
+ + Specifies an array in which the generated texture names are stored. +
+
+ glGenTextures
returns n
texture names in textures
.
+ There is no guarantee that the names form a contiguous set of integers;
+ however, it is guaranteed that none of the returned names was in use
+ immediately before the call to glGenTextures
.
+
+ Texture names returned by a call to glGenTextures
are not returned by
+ subsequent calls, unless they are first deleted with
+ glDeleteTextures.
+
+ The names returned in textures
are marked as used, for the purposes of glGenTextures
only,
+ but they acquire state and dimensionality only when they are first bound using glBindTexture.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsTexture +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGenTextures | +✔ | +✔ | +
+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glGet, + glGetTexParameter, + glTexImage2D, + glTexImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glGenTransformFeedbacks — reserve transform feedback object names
+
+ void glGenTransformFeedbacks(
+ |
+ GLsizei n, | +
+ | GLuint *ids) ; |
+
n
+
+
+ + Specifies the number of transform feedback object names to reserve. +
+ids
+
+
+ + Specifies an array of into which the reserved names will be written. +
+
+ glGenTransformFeedbacks
returns n
transform feedback object names in ids
.
+ There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names
+ was in use immediately before the call to glGenTransformFeedbacks
.
+
+ Transform feedback object names returned by a call to glGenTransformFeedbacks
are not returned by subsequent calls, unless
+ they are first deleted with glDeleteTransformFeedbacks.
+
+ The names returned in ids
are marked as used, for the purposes of glGenTransformFeedbacks
only,
+ but they acquire state and type only when they are first bound.
+
+ glGet with argument GL_TRANSFORM_FEEDBACK_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGenTransformFeedbacks | +- | +✔ | +
+ glDeleteTransformFeedbacks, + glBindTransformFeedback, + glIsTransformFeedback, + glBeginTransformFeedback, + glPauseTransformFeedback, + glResumeTransformFeedback, + glEndTransformFeedback +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGenVertexArrays — generate vertex array object names
+
+ void glGenVertexArrays(
+ |
+ GLsizei n, | +
+ | GLuint *arrays) ; |
+
n
+
+
+ + Specifies the number of vertex array object names to generate. +
+arrays
+
+
+ + Specifies an array in which the generated vertex array object names are stored. +
+
+ glGenVertexArrays
returns n
vertex array object names in arrays
.
+ There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names
+ was in use immediately before the call to glGenVertexArrays
.
+
+ Vertex array object names returned by a call to glGenVertexArrays
are not returned by subsequent calls, unless
+ they are first deleted with glDeleteVertexArrays.
+
+ The names returned in arrays
are marked as used, for the purposes of glGenVertexArrays
only,
+ but they acquire state and type only when they are first bound.
+
+ GL_INVALID_VALUE
is generated if n
is negative.
+
+ glIsVertexArray +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGenVertexArrays | +- | +✔ | +
+ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGenerateMipmap — generate mipmaps for a specified texture target
+
+ void glGenerateMipmap(
+ |
+ GLenum target) ; |
+
target
+
+
+
+ Specifies the target to which the texture whose mimaps to generate is bound. target
must
+ be GL_TEXTURE_2D
, GL_TEXTURE_3D
,
+ GL_TEXTURE_2D_ARRAY
or GL_TEXTURE_CUBE_MAP
.
+
+ glGenerateMipmap
generates mipmaps for the texture attached
+ to target
of the active texture unit. For cube map textures,
+ a GL_INVALID_OPERATION
error is generated if the texture
+ attached to target
is not cube complete.
+
+ Mipmap generation replaces texel array levels
+
+ The internal formats of the derived mipmap arrays all match those of the
+
+ GL_INVALID_ENUM
is generated if target
is not
+ one of the accepted texture targets.
+
+ GL_INVALID_OPERATION
is generated if target
is
+ GL_TEXTURE_CUBE_MAP
and the texture bound to the GL_TEXTURE_CUBE_MAP
+ target of the active texture unit is not cube complete.
+
+ GL_INVALID_OPERATION
is generated if the
+
+ GL_INVALID_OPERATION
is generated if the
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGenerateMipmap | +✔ | +✔ | +
+ glTexImage2D, + glBindTexture, + glGenTextures +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGet — return the value or values of a selected parameter
+
+ void glGetBooleanv(
+ |
+ GLenum pname, | +
+ | GLboolean * data) ; |
+
+ void glGetFloatv(
+ |
+ GLenum pname, | +
+ | GLfloat * data) ; |
+
+ void glGetIntegerv(
+ |
+ GLenum pname, | +
+ | GLint * data) ; |
+
+ void glGetInteger64v(
+ |
+ GLenum pname, | +
+ | GLint64 * data) ; |
+
+ void glGetIntegeri_v(
+ |
+ GLenum target, | +
+ | GLuint index, | +
+ | GLint * data) ; |
+
+ void glGetInteger64i_v(
+ |
+ GLenum target, | +
+ | GLuint index, | +
+ | GLint64 * data) ; |
+
pname
+
+
+ + Specifies the parameter value to be returned. + The symbolic constants in the list below are accepted. +
+target
+
+
+
+ Specifies the parameter value to be returned
+ for indexed versions of glGet
.
+ The symbolic constants in the list below are accepted.
+
index
+
+
+ + Specifies the index of the particular element being queried. +
+data
+
+
+ + Returns the value or values of the specified parameter. +
+
+ These commands return values for simple state variables in GL.
+ pname
is a symbolic constant indicating the state variable to be returned,
+ and params
is a pointer to an array of the indicated type in
+ which to place the returned data.
+
+ Type conversion is performed if params
has a different type than
+ the state variable value being requested.
+ If glGetBooleanv
is called,
+ a floating-point (or integer) value is converted to GL_FALSE
if
+ and only if it is 0.0 (or 0).
+ Otherwise,
+ it is converted to GL_TRUE
.
+ If glGetIntegerv
is called, boolean values are returned as
+ GL_TRUE
or GL_FALSE
, and most floating-point values are
+ rounded to the nearest integer value. Floating-point colors and
+ normals, however, are returned with a linear mapping that maps 1.0 to
+ the most positive representable integer value
+ and
+ glGetFloatv
is called,
+ boolean values are returned as GL_TRUE
or GL_FALSE
,
+ and integer values are converted to floating-point values.
+
+ The following symbolic constants are accepted by pname
:
+
GL_ACTIVE_TEXTURE
+
+
+ params
returns a single value indicating the active multitexture unit.
+ The initial value is GL_TEXTURE0
.
+ See glActiveTexture.
+
GL_ALIASED_LINE_WIDTH_RANGE
+
+
+ params
returns a pair of values indicating the range of
+ widths supported for aliased lines. See glLineWidth.
+
GL_ALIASED_POINT_SIZE_RANGE
+
+
+ params
returns two values:
+ the smallest and largest supported sizes for
+ points. The smallest size must be at most 1, and the largest size must
+ be at least 1.
+
GL_ALPHA_BITS
+
+
+ params
returns one value,
+ the number of alpha bitplanes in the color buffer of the
+ currently bound draw framebuffer. This is defined only if all color attachments
+ of the draw framebuffer have identical formats, in which case the number of alpha bits
+ of color attachment zero are returned.
+
GL_ARRAY_BUFFER_BINDING
+
+
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_ARRAY_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindBuffer.
+
GL_BLEND
+
+
+ params
returns a single boolean value indicating whether blending is
+ enabled. The initial value is GL_FALSE
.
+ See glBlendFunc.
+
GL_BLEND_COLOR
+
+
+ params
returns four values,
+ the red, green, blue, and alpha values which are the components of
+ the blend color.
+ See glBlendColor.
+
GL_BLEND_DST_ALPHA
+
+
+ params
returns one value,
+ the symbolic constant identifying the alpha destination blend
+ function. The initial value is GL_ZERO
.
+ See glBlendFunc and glBlendFuncSeparate.
+
GL_BLEND_DST_RGB
+
+
+ params
returns one value,
+ the symbolic constant identifying the RGB destination blend
+ function. The initial value is GL_ZERO
.
+ See glBlendFunc and glBlendFuncSeparate.
+
GL_BLEND_EQUATION_ALPHA
+
+
+ params
returns one value, a symbolic constant indicating whether
+ the Alpha blend equation is GL_FUNC_ADD
, GL_FUNC_SUBTRACT
,
+ GL_FUNC_REVERSE_SUBTRACT
, GL_MIN
or GL_MAX
.
+ See glBlendEquationSeparate.
+
GL_BLEND_EQUATION_RGB
+
+
+ params
returns one value, a symbolic constant indicating whether
+ the RGB blend equation is GL_FUNC_ADD
, GL_FUNC_SUBTRACT
,
+ GL_FUNC_REVERSE_SUBTRACT
, GL_MIN
or GL_MAX
.
+ See glBlendEquationSeparate.
+
GL_BLEND_SRC_ALPHA
+
+
+ params
returns one value,
+ the symbolic constant identifying the alpha source blend function. The initial
+ value is GL_ONE
.
+ See glBlendFunc and glBlendFuncSeparate.
+
GL_BLEND_SRC_RGB
+
+
+ params
returns one value,
+ the symbolic constant identifying the RGB source blend function. The initial
+ value is GL_ONE
.
+ See glBlendFunc and glBlendFuncSeparate.
+
GL_BLUE_BITS
+
+
+ params
returns one value,
+ the number of blue bitplanes in the color buffer of the
+ currently bound draw framebuffer. This is defined only if all color attachments
+ of the draw framebuffer have identical formats, in which case the number of blue bits
+ of color attachment zero are returned.
+
GL_COLOR_CLEAR_VALUE
+
+
+ params
returns four values:
+ the red, green, blue, and alpha values used to clear the color buffers.
+ Integer values,
+ if requested,
+ are linearly mapped from the internal floating-point representation such
+ that 1.0 returns the most positive representable integer value,
+ and
+
+ returns the most negative representable integer
+ value. The initial value is (0, 0, 0, 0).
+ See glClearColor.
+
GL_COLOR_WRITEMASK
+
+
+ params
returns four boolean values:
+ the red, green, blue, and alpha write enables for the color
+ buffers. The initial value is (GL_TRUE
, GL_TRUE
,
+ GL_TRUE
, GL_TRUE
).
+ See glColorMask.
+
GL_COMPRESSED_TEXTURE_FORMATS
+
+
+ params
returns a list of symbolic
+ constants of length GL_NUM_COMPRESSED_TEXTURE_FORMATS
+ indicating which compressed texture formats are available.
+ See glCompressedTexImage2D.
+
GL_COPY_READ_BUFFER_BINDING
+
+
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_COPY_READ_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindBuffer.
+
GL_COPY_WRITE_BUFFER_BINDING
+
+
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_COPY_WRITE_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindBuffer.
+
GL_CULL_FACE
+
+
+ params
returns a single boolean value indicating whether polygon culling
+ is enabled. The initial value is GL_FALSE
.
+ See glCullFace.
+
GL_CULL_FACE_MODE
+
+
+ params
returns a single value indicating the mode of polygon culling.
+ The initial value is GL_BACK
.
+ See glCullFace.
+
GL_CURRENT_PROGRAM
+
+
+ params
returns one value,
+ the name of the program object that is currently active, or 0 if no program object is active.
+ See glUseProgram.
+
GL_DEPTH_BITS
+
+
+ params
returns one value,
+ the number of bitplanes in the depth buffer of the
+ currently bound framebuffer.
+
GL_DEPTH_CLEAR_VALUE
+
+
+ params
returns one value,
+ the value that is used to clear the depth buffer.
+ Integer values,
+ if requested,
+ are linearly mapped from the internal floating-point representation such
+ that 1.0 returns the most positive representable integer value,
+ and
+
+ returns the most negative representable integer
+ value. The initial value is 1.
+ See glClearDepthf.
+
GL_DEPTH_FUNC
+
+
+ params
returns one value,
+ the symbolic constant that indicates the depth comparison
+ function. The initial value is GL_LESS
.
+ See glDepthFunc.
+
GL_DEPTH_RANGE
+
+
+ params
returns two values:
+ the near and far mapping limits for the depth buffer.
+ Integer values,
+ if requested,
+ are linearly mapped from the internal floating-point representation such
+ that 1.0 returns the most positive representable integer value,
+ and
+
+ returns the most negative representable integer
+ value. The initial value is (0, 1).
+ See glDepthRangef.
+
GL_DEPTH_TEST
+
+
+ params
returns a single boolean value indicating whether depth testing
+ of fragments is enabled. The initial value is GL_FALSE
.
+ See glDepthFunc and glDepthRangef.
+
GL_DEPTH_WRITEMASK
+
+
+ params
returns a single boolean value indicating if the depth buffer
+ is enabled for writing. The initial value is GL_TRUE
.
+ See glDepthMask.
+
GL_DITHER
+
+
+ params
returns a single boolean value indicating whether dithering of
+ fragment colors and indices is enabled. The initial value is GL_TRUE
.
+
GL_DRAW_BUFFER
+
+ i
+
+
+
+ params
returns one value,
+ a symbolic constant indicating which buffers are being drawn to by the corresponding output color.
+ See glDrawBuffers.
+ The initial value of GL_DRAW_BUFFER0
is GL_BACK
. The
+ initial values of draw buffers for all other output colors is GL_NONE
.
+
GL_DRAW_FRAMEBUFFER_BINDING
+
+
+ params
returns one value,
+ the name of the framebuffer object currently bound to the GL_DRAW_FRAMEBUFFER
target.
+ If the default framebuffer is bound, this value will be zero. The initial value is zero.
+ See glBindFramebuffer.
+
GL_ELEMENT_ARRAY_BUFFER_BINDING
+
+
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_ELEMENT_ARRAY_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindBuffer.
+
GL_FRAGMENT_SHADER_DERIVATIVE_HINT
+
+
+ params
returns one value,
+ a symbolic constant indicating the mode of the derivative accuracy hint
+ for fragment shaders. The initial value
+ is GL_DONT_CARE
.
+ See glHint.
+
GL_FRONT_FACE
+
+
+ params
returns a single value indicating the winding order
+ of polygon front faces.
+ The initial value is GL_CCW
.
+ See glFrontFace.
+
GL_GENERATE_MIPMAP_HINT
+
+
+ params
returns one value,
+ a symbolic constant indicating the mode of the generate mipmap quality hint.
+ The initial value
+ is GL_DONT_CARE
.
+ See glHint.
+
GL_GREEN_BITS
+
+
+ params
returns one value,
+ the number of green bitplanes in the color buffer of the
+ currently bound draw framebuffer. This is defined only if all color attachments
+ of the draw framebuffer have identical formats, in which case the number of green bits
+ of color attachment zero are returned.
+
GL_IMPLEMENTATION_COLOR_READ_FORMAT
+
+
+ params
returns one value, the format
+ chosen by the implementation in which pixels may be read from the
+ color buffer of the currently bound framebuffer in conjunction with
+ GL_IMPLEMENTATION_COLOR_READ_TYPE
.
+ See glReadPixels.
+
GL_IMPLEMENTATION_COLOR_READ_TYPE
+
+
+ params
returns one value, the type
+ chosen by the implementation with which pixels may be read from the
+ color buffer of the currently bound framebuffer in conjunction with
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT
.
+ See glReadPixels.
+
GL_LINE_WIDTH
+
+ +
+
+ params
returns one value,
+ the line width as specified with glLineWidth. The initial value is
+ 1.
+
GL_MAJOR_VERSION
+
+
+ params
returns one value,
+ the major version number of the OpenGL ES API supported by the current context.
+ This must be 3.
+
GL_MAX_3D_TEXTURE_SIZE
+
+
+ params
returns one value,
+ a rough estimate of the largest 3D texture that the GL can handle.
+ The value must be at least 256. See glTexImage3D.
+
GL_MAX_ARRAY_TEXTURE_LAYERS
+
+
+ params
returns one value.
+ The value indicates the maximum number of layers allowed in an array texture, and must be at least 256.
+ See glTexImage2D.
+
GL_MAX_COLOR_ATTACHMENTS
+
+
+ params
returns one value, the maximum number
+ of color attachment points in a framebuffer object.
+ The value must be at least 4.
+ See glFramebufferRenderbuffer
+ and glFramebufferTexture2D.
+
GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS
+
+
+ params
returns one value,
+ the number of words for fragment shader uniform variables in all uniform
+ blocks (including default). The value must be at least
+ GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
+
+ GL_MAX_UNIFORM_BLOCK_SIZE
* GL_MAX_FRAGMENT_UNIFORM_BLOCKS
/ 4.
+ See glUniform.
+
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
+
+
+ params
returns one value, the maximum supported texture image units that
+ can be used to access texture maps from the vertex shader and the fragment processor combined.
+ If both the vertex shader and the fragment processing stage access the same texture image
+ unit, then that counts as using two texture image units against this limit.
+ The value must be at least 32.
+ See glActiveTexture.
+
GL_MAX_COMBINED_UNIFORM_BLOCKS
+
+
+ params
returns one value,
+ the maximum number of uniform blocks per program. The value must be at least 24.
+ See glUniformBlockBinding.
+
GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS
+
+
+ params
returns one value,
+ the number of words for vertex shader uniform variables in all uniform
+ blocks (including default). The value must be at least .
+ GL_MAX_VERTEX_UNIFORM_COMPONENTS
+
+ GL_MAX_UNIFORM_BLOCK_SIZE
* GL_MAX_VERTEX_UNIFORM_BLOCKS
/ 4.
+ See glUniform.
+
GL_MAX_CUBE_MAP_TEXTURE_SIZE
+
+
+ params
returns one value.
+ The value gives a rough estimate of the largest cube-map texture that
+ the GL can handle. The value must be at least 2048.
+ See glTexImage2D.
+
GL_MAX_DRAW_BUFFERS
+
+
+ params
returns one value, the maximum number
+ of simultaneous outputs that may be written in a fragment shader.
+ The value must be at least 4.
+ See glDrawBuffers.
+
GL_MAX_ELEMENT_INDEX
+
+
+ params
returns one value,
+ the maximum index supported by the implementation.
+ The value must be at least
+ .
+
GL_MAX_ELEMENTS_INDICES
+
+
+ params
returns one value,
+ the recommended maximum number of vertex array indices.
+ See glDrawRangeElements.
+
GL_MAX_ELEMENTS_VERTICES
+
+
+ params
returns one value,
+ the recommended maximum number of vertex array vertices.
+ See glDrawRangeElements.
+
GL_MAX_FRAGMENT_INPUT_COMPONENTS
+
+
+ params
returns one value,
+ the maximum number of components of the inputs read by the fragment shader, which must be at least 60.
+
GL_MAX_FRAGMENT_UNIFORM_BLOCKS
+
+
+ params
returns one value,
+ the maximum number of uniform blocks per fragment shader. The value must be at least 12.
+ See glUniformBlockBinding.
+
GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
+
+
+ params
returns one value,
+ the maximum number of individual floating-point, integer, or boolean values that can be held
+ in uniform variable storage for a fragment shader. The value must be at least 896.
+ See glUniform.
+
GL_MAX_FRAGMENT_UNIFORM_VECTORS
+
+
+ params
returns one value,
+ the maximum number of vector floating-point, integer, or boolean values that can be held
+ in uniform variable storage for a fragment shader. The value must be at least 224.
+ See glUniform.
+
GL_MAX_PROGRAM_TEXEL_OFFSET
+
+
+ params
returns one value,
+ the maximum texel offset allowed in a texture lookup, which must be at least 7.
+
GL_MAX_RENDERBUFFER_SIZE
+
+
+ params
returns one value.
+ The value indicates the maximum supported size for renderbuffers and must be at least 2048.
+ See glFramebufferRenderbuffer.
+
GL_MAX_SAMPLES
+
+
+ params
returns one value.
+ The value indicates the maximum supported number of samples for multisampling.
+ The value must be at least 4.
+ See glGetInternalformativ.
+
GL_MAX_SERVER_WAIT_TIMEOUT
+
+
+ params
returns one value,
+ the maximum glWaitSync timeout interval.
+
GL_MAX_TEXTURE_IMAGE_UNITS
+
+
+ params
returns one value, the maximum supported texture image units that
+ can be used to access texture maps from the fragment shader.
+ The value must be at least 16.
+ See glActiveTexture.
+
GL_MAX_TEXTURE_LOD_BIAS
+
+
+ params
returns one value,
+ the maximum, absolute value of the texture level-of-detail bias. The
+ value must be at least 2.0.
+
GL_MAX_TEXTURE_SIZE
+
+
+ params
returns one value.
+ The value gives a rough estimate of the largest texture that
+ the GL can handle. The value must be at least 2048.
+ See glTexImage2D.
+
GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS
+
+
+ params
returns one value,
+ the maximum number of components which can be written to a single transform feedback buffer in
+ interleaved mode. The value must be at least 64.
+ See glTransformFeedbackVaryings.
+
GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
+
+
+ params
returns one value,
+ the maximum separate attributes or outputs which can be captured in separate
+ transform feedback mode. The value must be at least 4.
+ See glTransformFeedbackVaryings.
+
GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
+
+
+ params
returns one value,
+ the maximum number of components which can be written per attribute or output in separate
+ transform feedback mode. The value must be at least 4.
+ See glTransformFeedbackVaryings.
+
GL_MAX_UNIFORM_BLOCK_SIZE
+
+
+ params
returns one value,
+ the maximum size in basic machine units of a uniform block.
+ The value must be at least 16384.
+ See glUniformBlockBinding.
+
GL_MAX_UNIFORM_BUFFER_BINDINGS
+
+
+ params
returns one value,
+ the maximum number of uniform buffer binding points on the context, which must be at least 24.
+
GL_MAX_VARYING_COMPONENTS
+
+
+ params
returns one value,
+ the number components for varying variables, which must be at least 60.
+
GL_MAX_VARYING_VECTORS
+
+
+ params
returns one value,
+ the maximum number of interpolators available for processing varying variables used by
+ vertex and fragment shaders. This value represents the number of vector
+ values that can be interpolated; varying variables declared as matrices and arrays
+ will consume multiple interpolators. The value must be at least 15.
+
GL_MAX_VERTEX_ATTRIBS
+
+
+ params
returns one value,
+ the maximum number of 4-component generic vertex attributes accessible to a vertex shader.
+ The value must be at least 16.
+ See glVertexAttrib.
+
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
+
+
+ params
returns one value, the maximum supported texture image units that
+ can be used to access texture maps from the vertex shader. The value may be at least 16.
+ See glActiveTexture.
+
GL_MAX_VERTEX_OUTPUT_COMPONENTS
+
+ +
+
+ params
returns one value,
+ the maximum number of components of output written by a vertex shader, which must be at least 64.
+
GL_MAX_VERTEX_UNIFORM_BLOCKS
+
+ +
+
+ params
returns one value,
+ the maximum number of uniform blocks per vertex shader. The value must be at least 12.
+ See glUniformBlockBinding.
+
GL_MAX_VERTEX_UNIFORM_COMPONENTS
+
+ +
+
+ params
returns one value,
+ the maximum number of individual floating-point, integer, or boolean values that can be held
+ in uniform variable storage for a vertex shader. The value must be at least 1024.
+ See glUniform.
+
GL_MAX_VERTEX_UNIFORM_VECTORS
+
+ +
+
+ params
returns one value,
+ the maximum number of vector floating-point, integer, or boolean values that can be held
+ in uniform variable storage for a vertex shader. The value must be at least 256.
+ See glUniform.
+
GL_MAX_VIEWPORT_DIMS
+
+ +
+
+ params
returns two values:
+ the maximum supported width and height of the viewport.
+ These must be at least as large as the visible dimensions of the display
+ being rendered to.
+ See glViewport.
+
GL_MIN_PROGRAM_TEXEL_OFFSET
+
+ +
+
+ params
returns one value,
+ the minimum texel offset allowed in a texture lookup, which must be at most -8.
+
GL_MINOR_VERSION
+
+ +
+
+ params
returns one value,
+ the minor version number of the OpenGL ES API supported by the current context.
+
GL_NUM_COMPRESSED_TEXTURE_FORMATS
+
+ +
+
+ params
returns a single integer value indicating the number of available
+ compressed texture formats. The minimum value is 10.
+ See glCompressedTexImage2D.
+
GL_NUM_EXTENSIONS
+
+ +
+
+ params
returns one value,
+ the number of extensions supported by the GL implementation for the current context.
+ See glGetString.
+
GL_NUM_PROGRAM_BINARY_FORMATS
+
+ +
+
+ params
returns a single integer value indicating the number of available
+ program binary formats. The minimum value is 0.
+ See glProgramBinary.
+
GL_NUM_SHADER_BINARY_FORMATS
+
+ +
+
+ params
returns a single integer value indicating the number of available
+ shader binary formats. The minimum value is 0.
+ See glShaderBinary.
+
GL_PACK_ALIGNMENT
+
+ +
+
+ params
returns one value,
+ the byte alignment used for writing pixel data to memory. The initial
+ value is 4.
+ See glPixelStorei.
+
GL_PACK_ROW_LENGTH
+
+ +
+
+ params
returns one value,
+ the row length used for writing pixel data to memory. The initial value is
+ 0.
+ See glPixelStorei.
+
GL_PACK_SKIP_PIXELS
+
+ +
+
+ params
returns one value,
+ the number of pixel locations skipped before the first pixel is written
+ into memory. The initial value is 0.
+ See glPixelStorei.
+
GL_PACK_SKIP_ROWS
+
+ +
+
+ params
returns one value,
+ the number of rows of pixel locations skipped before the first pixel is written
+ into memory. The initial value is 0.
+ See glPixelStorei.
+
GL_PIXEL_PACK_BUFFER_BINDING
+
+
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_PIXEL_PACK_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindBuffer.
+
GL_PIXEL_UNPACK_BUFFER_BINDING
+
+
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_PIXEL_UNPACK_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindBuffer.
+
GL_POLYGON_OFFSET_FACTOR
+
+
+ params
returns one value,
+ the scaling factor used to determine the variable offset that is added
+ to the depth value of each fragment generated when a polygon is
+ rasterized. The initial value is 0.
+ See glPolygonOffset.
+
GL_POLYGON_OFFSET_FILL
+
+
+ params
returns a single boolean value indicating whether polygon offset
+ is enabled for polygons. The initial value is GL_FALSE
.
+ See glPolygonOffset.
+
GL_POLYGON_OFFSET_UNITS
+
+
+ params
returns one value.
+ This value is multiplied by an implementation-specific value and then
+ added to the depth value of each fragment
+ generated when a polygon is rasterized. The initial value is 0.
+ See glPolygonOffset.
+
GL_PRIMITIVE_RESTART_FIXED_INDEX
+
+
+ params
returns a single boolean value indicating whether primitive restart
+ with a fixed index is enabled. The initial value is GL_FALSE
.
+
GL_PROGRAM_BINARY_FORMATS
+
+
+ params
returns a list of symbolic
+ constants of length GL_NUM_PROGRAM_BINARY_FORMATS
+ indicating which program binary formats are available.
+ See glProgramBinary.
+
GL_RASTERIZER_DISCARD
+
+
+ params
returns one value,
+ a single boolean value indicating whether primitives are discarded immediately before
+ the rasterization stage, but after the optional transform feedback stage.
+ See glEnable.
+
GL_READ_BUFFER
+
+
+ params
returns one value,
+ a symbolic constant indicating which color buffer is selected for
+ reading. The initial value is GL_BACK
.
+ See
+ glReadPixels.
+
GL_READ_FRAMEBUFFER_BINDING
+
+
+ params
returns one value,
+ the name of the framebuffer object currently bound to the GL_READ_FRAMEBUFFER
target.
+ If the default framebuffer is bound, this value will be zero. The initial value is zero.
+ See glBindFramebuffer.
+
GL_RED_BITS
+
+
+ params
returns one value,
+ the number of red bitplanes in the color buffer of the
+ currently bound draw framebuffer. This is defined only if all color attachments
+ of the draw framebuffer have identical formats, in which case the number of red bits
+ of color attachment zero are returned.
+
GL_RENDERBUFFER_BINDING
+
+ +
+
+ params
returns a single value, the name of the renderbuffer object
+ currently bound to the target GL_RENDERBUFFER
. If no renderbuffer object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindRenderbuffer.
+
GL_SAMPLE_ALPHA_TO_COVERAGE
+
+ +
+
+ params
returns a single boolean value indicating whether modification
+ of sample coverage based on alpha is
+ enabled. The initial value is GL_FALSE
.
+ See glSampleCoverage.
+
GL_SAMPLE_BUFFERS
+
+ +
+
+ params
returns a single integer value indicating the number of sample buffers
+ associated with the framebuffer.
+ See glSampleCoverage.
+
GL_SAMPLE_COVERAGE
+
+ +
+
+ params
returns a single boolean value indicating whether modification
+ of sample coverage based on the value specified by
+ glSampleCoverage is
+ enabled. The initial value is GL_FALSE
.
+
GL_SAMPLE_COVERAGE_INVERT
+
+ +
+
+ params
returns a single boolean value indicating if the temporary
+ coverage value should be inverted.
+ See glSampleCoverage.
+
GL_SAMPLE_COVERAGE_VALUE
+
+ +
+
+ params
returns a single positive floating-point value indicating the
+ current sample coverage value.
+ See glSampleCoverage.
+
GL_SAMPLER_BINDING
+
+ +
+
+ params
returns a single value, the name of the sampler object
+ currently bound to the active texture unit. The initial value is 0.
+ See glBindSampler.
+
GL_SAMPLES
+
+ +
+
+ params
returns a single integer value indicating the coverage mask size.
+ See glSampleCoverage.
+
GL_SCISSOR_BOX
+
+ +
+
+ params
returns four values:
+ the
+
+ and
+
+ window coordinates of the scissor box,
+ followed by its width and height.
+ Initially the
+
+ and
+
+ window coordinates are both 0 and the
+ width and height are set to the size of the window.
+ See glScissor.
+
GL_SCISSOR_TEST
+
+ +
+
+ params
returns a single boolean value indicating whether scissoring is
+ enabled. The initial value is GL_FALSE
.
+ See glScissor.
+
GL_SHADER_BINARY_FORMATS
+
+ +
+
+ params
returns a list of symbolic
+ constants of length GL_NUM_SHADER_BINARY_FORMATS
+ indicating which shader binary formats are available.
+ See glShaderBinary.
+
GL_SHADER_COMPILER
+
+ +
+
+ params
returns a single boolean value indicating whether
+ a shader compiler is supported. This value is always GL_TRUE
.
+ See glCompileShader.
+
GL_STENCIL_BACK_FAIL
+
+ +
+
+ params
returns one value,
+ a symbolic constant indicating what action is taken for back-facing polygons when the stencil
+ test fails. The initial value is GL_KEEP
.
+ See glStencilOpSeparate.
+
GL_STENCIL_BACK_FUNC
+
+ +
+
+ params
returns one value,
+ a symbolic constant indicating what function is used for back-facing polygons to compare the
+ stencil reference value with the stencil buffer value. The initial value
+ is GL_ALWAYS
.
+ See glStencilFuncSeparate.
+
GL_STENCIL_BACK_PASS_DEPTH_FAIL
+
+ +
+
+ params
returns one value,
+ a symbolic constant indicating what action is taken for back-facing polygons when the stencil
+ test passes,
+ but the depth test fails. The initial value is GL_KEEP
.
+ See glStencilOpSeparate.
+
GL_STENCIL_BACK_PASS_DEPTH_PASS
+
+ +
+
+ params
returns one value,
+ a symbolic constant indicating what action is taken for back-facing polygons when the stencil
+ test passes and the depth test passes. The initial value is GL_KEEP
.
+ See glStencilOpSeparate.
+
GL_STENCIL_BACK_REF
+
+ +
+
+ params
returns one value,
+ the reference value that is compared with the contents of the stencil
+ buffer for back-facing polygons. The initial value is 0.
+ See glStencilFuncSeparate.
+
GL_STENCIL_BACK_VALUE_MASK
+
+ +
+
+ params
returns one value,
+ the mask that is used for back-facing polygons to mask both the stencil reference value and the
+ stencil buffer value before they are compared. The initial value is all 1's.
+ See glStencilFuncSeparate.
+
GL_STENCIL_BACK_WRITEMASK
+
+ +
+
+ params
returns one value,
+ the mask that controls writing of the stencil bitplanes for back-facing polygons. The initial value
+ is all 1's.
+ See glStencilMaskSeparate.
+
GL_STENCIL_BITS
+
+
+ params
returns one value,
+ the number of bitplanes in the stencil buffer of the
+ currently bound framebuffer.
+
GL_STENCIL_CLEAR_VALUE
+
+ +
+
+ params
returns one value,
+ the index to which the stencil bitplanes are cleared. The initial value is
+ 0.
+ See glClearStencil.
+
GL_STENCIL_FAIL
+
+ +
+
+ params
returns one value,
+ a symbolic constant indicating what action is taken when the stencil
+ test fails. The initial value is GL_KEEP
.
+ See glStencilOp.
+ This stencil state only affects non-polygons
+ and front-facing polygons. Back-facing polygons use separate stencil state.
+ See glStencilOpSeparate.
+
GL_STENCIL_FUNC
+
+ +
+
+ params
returns one value,
+ a symbolic constant indicating what function is used to compare the
+ stencil reference value with the stencil buffer value. The initial value
+ is GL_ALWAYS
.
+ See glStencilFunc.
+ This stencil state only affects non-polygons
+ and front-facing polygons. Back-facing polygons use separate stencil state.
+ See glStencilFuncSeparate.
+
GL_STENCIL_PASS_DEPTH_FAIL
+
+ +
+
+ params
returns one value,
+ a symbolic constant indicating what action is taken when the stencil
+ test passes,
+ but the depth test fails. The initial value is GL_KEEP
.
+ See glStencilOp.
+ This stencil state only affects non-polygons
+ and front-facing polygons. Back-facing polygons use separate stencil state.
+ See glStencilOpSeparate.
+
GL_STENCIL_PASS_DEPTH_PASS
+
+ +
+
+ params
returns one value,
+ a symbolic constant indicating what action is taken when the stencil
+ test passes and the depth test passes. The initial value is GL_KEEP
.
+ See glStencilOp.
+ This stencil state only affects non-polygons
+ and front-facing polygons. Back-facing polygons use separate stencil state.
+ See glStencilOpSeparate.
+
GL_STENCIL_REF
+
+ +
+
+ params
returns one value,
+ the reference value that is compared with the contents of the stencil
+ buffer. The initial value is 0.
+ See glStencilFunc.
+ This stencil state only affects non-polygons
+ and front-facing polygons. Back-facing polygons use separate stencil state.
+ See glStencilFuncSeparate.
+
GL_STENCIL_TEST
+
+ +
+
+ params
returns a single boolean value indicating whether stencil testing
+ of fragments is enabled. The initial value is GL_FALSE
.
+ See glStencilFunc and glStencilOp.
+
GL_STENCIL_VALUE_MASK
+
+ +
+
+ params
returns one value,
+ the mask that is used to mask both the stencil reference value and the
+ stencil buffer value before they are compared. The initial value is all 1's.
+ See glStencilFunc.
+ This stencil state only affects non-polygons
+ and front-facing polygons. Back-facing polygons use separate stencil state.
+ See glStencilFuncSeparate.
+
GL_STENCIL_WRITEMASK
+
+ +
+
+ params
returns one value,
+ the mask that controls writing of the stencil bitplanes. The initial value
+ is all 1's.
+ See glStencilMask.
+ This stencil state only affects non-polygons
+ and front-facing polygons. Back-facing polygons use separate stencil state.
+ See glStencilMaskSeparate.
+
GL_SUBPIXEL_BITS
+
+ +
+
+ params
returns one value,
+ an estimate of the number of bits of subpixel resolution that are used to
+ position rasterized geometry in window coordinates. The value must be at least 4.
+
GL_TEXTURE_BINDING_2D
+
+ +
+
+ params
returns a single value, the name of the texture
+ currently bound to the target GL_TEXTURE_2D
. The initial value is 0.
+ See glBindTexture.
+
GL_TEXTURE_BINDING_2D_ARRAY
+
+ +
+
+ params
returns a single value, the name of the texture
+ currently bound to the target GL_TEXTURE_2D_ARRAY
. The initial value is 0.
+ See glBindTexture.
+
GL_TEXTURE_BINDING_3D
+
+ +
+
+ params
returns a single value, the name of the texture
+ currently bound to the target GL_TEXTURE_3D
. The initial value is 0.
+ See glBindTexture.
+
GL_TEXTURE_BINDING_CUBE_MAP
+
+ +
+
+ params
returns a single value, the name of the texture
+ currently bound to the target GL_TEXTURE_CUBE_MAP
. The initial value is 0.
+ See glBindTexture.
+
GL_TRANSFORM_FEEDBACK_BINDING
+
+ +
+
+ params
returns a single value, the name of the transform feedback object
+ currently bound to the GL_TRANSFORM_FEEDBACK
target. If no transform feedback object
+ is bound to this target, 0 is returned. The initial value is 0.
+ See glBindTransformFeedback.
+
GL_TRANSFORM_FEEDBACK_ACTIVE
+
+ +
+
+ params
returns a single boolean value indicating if the currently
+ bound transform feedback object is active.
+ See glBeginTransformFeedback
+ and glResumeTransformFeedback.
+
GL_TRANSFORM_FEEDBACK_BUFFER_BINDING
+
+ +
+
+ When used with non-indexed variants of glGet
(such as glGetIntegerv
),
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_TRANSFORM_FEEDBACK_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned.
+ When used with indexed variants of glGet
(such as glGetIntegeri_v
),
+ params
returns a single value, the name of the buffer object
+ bound to the indexed transform feedback attribute stream. The initial value is 0 for all targets.
+ See glBindBuffer, glBindBufferBase, and
+ glBindBufferRange.
+
GL_TRANSFORM_FEEDBACK_PAUSED
+
+ +
+
+ params
returns a single boolean value indicating if the currently
+ bound transform feedback object is paused.
+ See glPauseTransformFeedback.
+
GL_TRANSFORM_FEEDBACK_BUFFER_SIZE
+
+ +
+
+ When used with indexed variants of glGet
(such as glGetInteger64i_v
),
+ params
returns a single value, the size of the binding range for each
+ transform feedback attribute stream. The initial value is 0 for all streams.
+ See glBindBufferRange.
+
GL_TRANSFORM_FEEDBACK_BUFFER_START
+
+ +
+
+ When used with indexed variants of glGet
(such as glGetInteger64i_v
),
+ params
returns a single value, the start offset of the binding range for each
+ transform feedback attribute stream. The initial value is 0 for all streams.
+ See glBindBufferRange.
+
GL_UNIFORM_BUFFER_BINDING
+
+ +
+
+ When used with non-indexed variants of glGet
(such as glGetIntegerv
),
+ params
returns a single value, the name of the buffer object
+ currently bound to the target GL_UNIFORM_BUFFER
. If no buffer object
+ is bound to this target, 0 is returned.
+ When used with indexed variants of glGet
(such as glGetIntegeri_v
),
+ params
returns a single value, the name of the buffer object
+ bound to the indexed uniform buffer binding point. The initial value is 0 for all targets.
+ See glBindBuffer, glBindBufferBase, and
+ glBindBufferRange.
+
GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT
+
+ +
+
+ params
returns a single value, the minimum required alignment
+ for uniform buffer sizes and offset. The initial value is 1.
+ See glUniformBlockBinding.
+
GL_UNIFORM_BUFFER_SIZE
+
+ +
+
+ When used with indexed variants of glGet
(such as glGetInteger64i_v
),
+ params
returns a single value, the size of the binding range for each
+ indexed uniform buffer binding. The initial value is 0 for all bindings.
+ See glBindBufferRange.
+
GL_UNIFORM_BUFFER_START
+
+ +
+
+ When used with indexed variants of glGet
(such as glGetInteger64i_v
),
+ params
returns a single value, the start offset of the binding range for each
+ indexed uniform buffer binding. The initial value is 0 for all bindings.
+ See glBindBufferRange.
+
GL_UNPACK_ALIGNMENT
+
+ +
+
+ params
returns one value,
+ the byte alignment used for reading pixel data from memory. The initial
+ value is 4.
+ See glPixelStorei.
+
GL_UNPACK_IMAGE_HEIGHT
+
+ +
+
+ params
returns one value,
+ the image height used for reading pixel data from memory. The initial
+ is 0.
+ See glPixelStorei.
+
GL_UNPACK_ROW_LENGTH
+
+ +
+
+ params
returns one value,
+ the row length used for reading pixel data from memory. The initial value
+ is 0.
+ See glPixelStorei.
+
GL_UNPACK_SKIP_IMAGES
+
+ +
+
+ params
returns one value,
+ the number of pixel images skipped before the first pixel is read
+ from memory. The initial value is 0.
+ See glPixelStorei.
+
GL_UNPACK_SKIP_PIXELS
+
+ +
+
+ params
returns one value,
+ the number of pixel locations skipped before the first pixel is read
+ from memory. The initial value is 0.
+ See glPixelStorei.
+
GL_UNPACK_SKIP_ROWS
+
+ +
+
+ params
returns one value,
+ the number of rows of pixel locations skipped before the first pixel is read
+ from memory. The initial value is 0.
+ See glPixelStorei.
+
GL_VERTEX_ARRAY_BINDING
+
+ +
+
+ params
returns a single value, the name of the vertex array object
+ currently bound. If no vertex array object is bound, 0 is returned. The initial value is 0.
+ See glBindVertexArray.
+
GL_VIEWPORT
+
+ +
+
+ params
returns four values:
+ the
+
+ and
+
+ window coordinates of the viewport,
+ followed by its width and height.
+ Initially the
+
+ and
+
+ window coordinates are both set to 0,
+ and the width and height are set to the width and height of the window into
+ which the GL will do its rendering.
+ See glViewport.
+
+ Many of the boolean parameters can also be queried more easily using + glIsEnabled. +
+
+ The following parameters return the associated value for the active texture unit:
+ GL_TEXTURE_2D
, GL_TEXTURE_BINDING_2D
,
+ GL_TEXTURE_3D
and GL_TEXTURE_BINDING_3D
.
+
+ GL_INVALID_ENUM
is generated if pname
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated on either glGetIntegeri_v
,
+ or glGetInteger64i_v
if
+ index
is outside of the valid range for the indexed state target
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glGetBooleanv
+ |
+ ✔ | +✔ | +
+ glGetFloatv
+ |
+ ✔ | +✔ | +
+ glGetIntegerv
+ |
+ ✔ | +✔ | +
+ glGetInteger64v
+ |
+ - | +✔ | +
+ glGetIntegeri_v
+ |
+ - | +✔ | +
+ glGetInteger64i_v
+ |
+ - | +✔ | +
+ glGetActiveUniform, + glGetAttachedShaders, + glGetAttribLocation, + glGetBufferParameter, + glGetBufferPointerv, + glGetError, + glGetProgramiv, + glGetProgramInfoLog, + glGetQueryiv, + glGetQueryObjectuiv, + glGetShaderiv, + glGetShaderInfoLog, + glGetShaderSource, + glGetString, + glGetTexParameter, + glGetUniform, + glGetUniformLocation, + glGetVertexAttrib, + glGetVertexAttribPointerv, + glIsEnabled +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glGetActiveAttrib — Returns information about an active attribute variable for the specified program object
+
+ void glGetActiveAttrib(
+ |
+ GLuint program, | +
+ | GLuint index, | +
+ | GLsizei bufSize, | +
+ | GLsizei *length, | +
+ | GLint *size, | +
+ | GLenum *type, | +
+ | GLchar *name) ; |
+
program
+
+
+ Specifies the program object to be + queried.
+index
+
+
+ Specifies the index of the attribute variable + to be queried.
+bufSize
+
+
+ Specifies the maximum number of characters
+ OpenGL is allowed to write in the character buffer
+ indicated by name
.
length
+
+
+ Returns the number of characters actually
+ written by OpenGL in the string indicated by
+ name
(excluding the null
+ terminator) if a value other than
+ NULL
is passed.
size
+
+
+ Returns the size of the attribute + variable.
+type
+
+
+ Returns the data type of the attribute + variable.
+name
+
+
+ Returns a null terminated string containing + the name of the attribute variable.
+glGetActiveAttrib
returns information
+ about an active attribute variable in the program object
+ specified by program
. The number of
+ active attributes can be obtained by calling
+ glGetProgramiv
+ with the value GL_ACTIVE_ATTRIBUTES
. A
+ value of zero for index
selects the first
+ active attribute variable. Permissible values for
+ index
range from zero to the number of
+ active attribute variables minus one.
Attribute variables have arbitrary names and obtain their values
+ through numbered generic vertex attributes. An attribute
+ variable is considered active
+ if it is determined during the link operation that it may be
+ accessed during program execution. Therefore,
+ program
should have previously been the
+ target of a call to
+ glLinkProgram,
+ but it is not necessary for it to have been linked
+ successfully.
The size of the character buffer required to store the
+ longest attribute variable name in
+ program
can be obtained by calling
+ glGetProgramiv
+ with the value
+ GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
. This value
+ should be used to allocate a buffer of sufficient size to store
+ the returned attribute name. The size of this character buffer
+ is passed in bufSize
, and a pointer to
+ this character buffer is passed in
+ name
.
glGetActiveAttrib
returns the name of
+ the attribute variable indicated by
+ index
, storing it in the character buffer
+ specified by name
. The string returned
+ will be null terminated. The actual number of characters written
+ into this buffer is returned in length
,
+ and this count does not include the null termination character.
+ If the length of the returned string is not required, a value of
+ NULL
can be passed in the
+ length
argument.
The type
argument will return a
+ pointer to the attribute variable's data type. The symbolic
+ constants GL_FLOAT
,
+ GL_FLOAT_VEC2
,
+ GL_FLOAT_VEC3
,
+ GL_FLOAT_VEC4
,
+ GL_FLOAT_MAT2
,
+ GL_FLOAT_MAT3
,
+ GL_FLOAT_MAT4
,
+ GL_FLOAT_MAT2x3
,
+ GL_FLOAT_MAT2x4
,
+ GL_FLOAT_MAT3x2
,
+ GL_FLOAT_MAT3x4
,
+ GL_FLOAT_MAT4x2
,
+ GL_FLOAT_MAT4x3
,
+ GL_INT
,
+ GL_INT_VEC2
,
+ GL_INT_VEC3
,
+ GL_INT_VEC4
,
+ GL_UNSIGNED_INT
,
+ GL_UNSIGNED_INT_VEC2
,
+ GL_UNSIGNED_INT_VEC3
, or
+ GL_UNSIGNED_INT_VEC4
may be returned. The
+ size
argument will return the size of the
+ attribute, in units of the type returned in
+ type
.
This function will return as much information as it can
+ about the specified active attribute variable. If no information
+ is available, length
will be 0, and
+ name
will be an empty string. This
+ situation could occur if this function is called after a link
+ operation that failed. If an error occurs, the return values
+ length
, size
,
+ type
, and name
+ will be unmodified.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to the
+ number of active attribute variables in
+ program
.
GL_INVALID_VALUE
is generated if
+ bufSize
is less than 0.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
.
glGetProgramiv
+ with argument GL_ACTIVE_ATTRIBUTES
or
+ GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
.
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetActiveAttrib | +✔ | +✔ | +
glBindAttribLocation, + glLinkProgram, + glVertexAttrib, + glVertexAttribPointer
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetActiveUniform — Returns information about an active uniform variable for the specified program object
+
+ void glGetActiveUniform(
+ |
+ GLuint program, | +
+ | GLuint index, | +
+ | GLsizei bufSize, | +
+ | GLsizei *length, | +
+ | GLint *size, | +
+ | GLenum *type, | +
+ | GLchar *name) ; |
+
program
+
+
+ Specifies the program object to be + queried.
+index
+
+
+ Specifies the index of the uniform variable to + be queried.
+bufSize
+
+
+ Specifies the maximum number of characters
+ OpenGL is allowed to write in the character buffer
+ indicated by name
.
length
+
+
+ Returns the number of characters actually
+ written by OpenGL in the string indicated by
+ name
(excluding the null
+ terminator) if a value other than
+ NULL
is passed.
size
+
+
+ Returns the size of the uniform + variable.
+type
+
+
+ Returns the data type of the uniform + variable.
+name
+
+
+ Returns a null terminated string containing + the name of the uniform variable.
+glGetActiveUniform
returns
+ information about an active uniform variable in the program
+ object specified by program
. The number
+ of active uniform variables can be obtained by calling
+ glGetProgramiv
+ with the value GL_ACTIVE_UNIFORMS
. A value
+ of zero for index
selects the first active
+ uniform variable. Permissible values for
+ index
range from zero to the number of
+ active uniform variables minus one.
Shaders may use either built-in uniform variables,
+ user-defined uniform variables, or both. Built-in uniform
+ variables have a prefix of "gl_" and reference
+ existing OpenGL state or values derived from such state (e.g.,
+ gl_DepthRange
, see the OpenGL
+ Shading Language specification for a complete list.)
+ User-defined uniform variables have arbitrary names and obtain
+ their values from the application through calls to
+ glUniform.
+ A uniform variable (either built-in or user-defined) is
+ considered active if it is determined during the link operation
+ that it may be accessed during program execution. Therefore,
+ program
should have previously been the
+ target of a call to
+ glLinkProgram,
+ but it is not necessary for it to have been linked
+ successfully.
The size of the character buffer required to store the
+ longest uniform variable name in program
+ can be obtained by calling
+ glGetProgramiv
+ with the value
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
. This value
+ should be used to allocate a buffer of sufficient size to store
+ the returned uniform variable name. The size of this character
+ buffer is passed in bufSize
, and a
+ pointer to this character buffer is passed in
+ name.
glGetActiveUniform
returns the name
+ of the uniform variable indicated by
+ index
, storing it in the character buffer
+ specified by name
. The string returned
+ will be null terminated. The actual number of characters written
+ into this buffer is returned in length
,
+ and this count does not include the null termination character.
+ If the length of the returned string is not required, a value of
+ NULL
can be passed in the
+ length
argument.
The type
+ argument will return a pointer to the uniform variable's data
+ type. The symbolic constants returned for uniform types are shown in the
+ table below.
+
+ Returned Symbolic Contant + | +Shader Uniform Type + | +
---|---|
+ GL_FLOAT
+ |
+
+ float
+ |
+
+ GL_FLOAT_VEC2
+ |
+
+ vec2
+ |
+
+ GL_FLOAT_VEC3
+ |
+
+ vec3
+ |
+
+ GL_FLOAT_VEC4
+ |
+
+ vec4
+ |
+
+ GL_INT
+ |
+
+ int
+ |
+
+ GL_INT_VEC2
+ |
+
+ ivec2
+ |
+
+ GL_INT_VEC3
+ |
+
+ ivec3
+ |
+
+ GL_INT_VEC4
+ |
+
+ ivec4
+ |
+
+ GL_UNSIGNED_INT
+ |
+
+ unsigned int
+ |
+
+ GL_UNSIGNED_INT_VEC2
+ |
+
+ uvec2
+ |
+
+ GL_UNSIGNED_INT_VEC3
+ |
+
+ uvec3
+ |
+
+ GL_UNSIGNED_INT_VEC4
+ |
+
+ uvec4
+ |
+
+ GL_BOOL
+ |
+
+ bool
+ |
+
+ GL_BOOL_VEC2
+ |
+
+ bvec2
+ |
+
+ GL_BOOL_VEC3
+ |
+
+ bvec3
+ |
+
+ GL_BOOL_VEC4
+ |
+
+ bvec4
+ |
+
+ GL_FLOAT_MAT2
+ |
+
+ mat2
+ |
+
+ GL_FLOAT_MAT3
+ |
+
+ mat3
+ |
+
+ GL_FLOAT_MAT4
+ |
+
+ mat4
+ |
+
+ GL_FLOAT_MAT2x3
+ |
+
+ mat2x3
+ |
+
+ GL_FLOAT_MAT2x4
+ |
+
+ mat2x4
+ |
+
+ GL_FLOAT_MAT3x2
+ |
+
+ mat3x2
+ |
+
+ GL_FLOAT_MAT3x4
+ |
+
+ mat3x4
+ |
+
+ GL_FLOAT_MAT4x2
+ |
+
+ mat4x2
+ |
+
+ GL_FLOAT_MAT4x3
+ |
+
+ mat4x3
+ |
+
+ GL_SAMPLER_2D
+ |
+
+ sampler2D
+ |
+
+ GL_SAMPLER_3D
+ |
+
+ sampler3D
+ |
+
+ GL_SAMPLER_CUBE
+ |
+
+ samplerCube
+ |
+
+ GL_SAMPLER_2D_SHADOW
+ |
+
+ sampler2DShadow
+ |
+
+ GL_SAMPLER_2D_ARRAY
+ |
+
+ sampler2DArray
+ |
+
+ GL_SAMPLER_2D_ARRAY_SHADOW
+ |
+
+ sampler2DArrayShadow
+ |
+
+ GL_SAMPLER_CUBE_SHADOW
+ |
+
+ samplerCubeShadow
+ |
+
+ GL_INT_SAMPLER_2D
+ |
+
+ isampler2D
+ |
+
+ GL_INT_SAMPLER_3D
+ |
+
+ isampler3D
+ |
+
+ GL_INT_SAMPLER_CUBE
+ |
+
+ isamplerCube
+ |
+
+ GL_INT_SAMPLER_2D_ARRAY
+ |
+
+ isampler2DArray
+ |
+
+ GL_UNSIGNED_INT_SAMPLER_2D
+ |
+
+ usampler2D
+ |
+
+ GL_UNSIGNED_INT_SAMPLER_3D
+ |
+
+ usampler3D
+ |
+
+ GL_UNSIGNED_INT_SAMPLER_CUBE
+ |
+
+ usamplerCube
+ |
+
+ GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
+ |
+
+ usampler2DArray
+ |
+
+
+If one or more elements of an array are active, the name
+ of the array is returned in name
, the
+ type is returned in type
, and the
+ size
parameter returns the highest array
+ element index used, plus one, as determined by the compiler
+ and/or linker. Only one active uniform variable will be reported
+ for a uniform array. If the active uniform is an array, the uniform
+ name returned in name
will always
+ be the name of the uniform array appended with "[0]".
Uniform variables that are declared as structures or + arrays of structures will not be returned directly by this + function. Instead, each of these uniform variables will be + reduced to its fundamental components containing the + "." and "[]" operators such that each of the + names is valid as an argument to + glGetUniformLocation. + Each of these reduced uniform variables is counted as one active + uniform variable and is assigned an index. A valid name cannot + be a structure, an array of structures, or a subcomponent of a + vector or matrix.
+The size of the uniform variable will be returned in
+ size
. Uniform variables other than arrays
+ will have a size of 1. Structures and arrays of structures will
+ be reduced as described earlier, such that each of the names
+ returned will be a data type in the earlier list. If this
+ reduction results in an array, the size returned will be as
+ described for uniform arrays; otherwise, the size returned will
+ be 1.
The list of active uniform variables may include both + built-in uniform variables (which begin with the prefix + "gl_") as well as user-defined uniform variable + names.
+This function will return as much information as it can
+ about the specified active uniform variable. If no information
+ is available, length
will be 0, and
+ name
will be an empty string. This
+ situation could occur if this function is called after a link
+ operation that failed. If an error occurs, the return values
+ length
, size
,
+ type
, and name
+ will be unmodified.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to the
+ number of active uniform variables in
+ program
.
GL_INVALID_VALUE
is generated if
+ bufSize
is less than 0.
glGet
+ with argument GL_MAX_VERTEX_UNIFORM_COMPONENTS
,
+ GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
,
+ GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS
, or
+ GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS
.
glGetProgramiv
+ with argument GL_ACTIVE_UNIFORMS
or
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
.
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetActiveUniform | +✔ | +✔ | +
glGetUniform, + glGetUniformLocation, + glLinkProgram, + glUniform, + glUseProgram
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetActiveUniformBlockName — retrieve the name of an active uniform block
+
+ void glGetActiveUniformBlockName(
+ |
+ GLuint program, | +
+ | GLuint uniformBlockIndex, | +
+ | GLsizei bufSize, | +
+ | GLsizei *length, | +
+ | GLchar *uniformBlockName) ; |
+
program
+
+
+ + Specifies the name of a program containing the uniform block. +
+uniformBlockIndex
+
+
+
+ Specifies the index of the uniform block within program
.
+
bufSize
+
+
+
+ Specifies the size of the buffer addressed by uniformBlockName
.
+
length
+
+
+
+ Specifies the address of a variable to receive the number of characters that were written to uniformBlockName
.
+
uniformBlockName
+
+
+
+ Specifies the address an array of characters to receive the name of the uniform block at uniformBlockIndex
.
+
+ glGetActiveUniformBlockName
retrieves the name of the active uniform block at uniformBlockIndex
+ within program
.
+
+ program
must be the name of a program object for which the command
+ glLinkProgram must have been called in the past, although it is not required that
+ glLinkProgram must have succeeded. The link could have failed because the number
+ of active uniforms exceeded the limit.
+
+ uniformBlockIndex
is an active uniform block index of program
, and must be less than the value
+ of GL_ACTIVE_UNIFORM_BLOCKS
.
+
+ Upon success, the name of the uniform block identified by unifomBlockIndex
is returned into
+ uniformBlockName
. The name is nul-terminated. The actual number of characters written into uniformBlockName
,
+ excluding the nul terminator, is returned in length
. If length
is NULL
, no length is returned.
+
+ bufSize
contains the maximum number of characters (including the nul terminator) that will be written into
+ uniformBlockName
.
+
+ If an error occurs, nothing will be written to uniformBlockName
or length
.
+
+ GL_INVALID_OPERATION
is generated if program
is not the name of a program object for which
+ glLinkProgram has been called in the past.
+
+ GL_INVALID_VALUE
is generated if uniformBlockIndex
is greater than or equal to the value
+ of GL_ACTIVE_UNIFORM_BLOCKS
or is not the index of an active uniform block in program
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetActiveUniformBlockName | +- | +✔ | +
+ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetActiveUniformBlockiv — query information about an active uniform block
+
+ void glGetActiveUniformBlockiv(
+ |
+ GLuint program, | +
+ | GLuint uniformBlockIndex, | +
+ | GLenum pname, | +
+ | GLint *params) ; |
+
program
+
+
+ + Specifies the name of a program containing the uniform block. +
+uniformBlockIndex
+
+
+
+ Specifies the index of the uniform block within program
.
+
pname
+
+
+ + Specifies the name of the parameter to query. +
+params
+
+
+ + Specifies the address of a variable to receive the result of the query. +
+
+ glGetActiveUniformBlockiv
retrieves information about an active uniform block within program
.
+
+ program
must be the name of a program object for which the command
+ glLinkProgram must have been called in the past, although it is not required that
+ glLinkProgram must have succeeded. The link could have failed because the number
+ of active uniforms exceeded the limit.
+
+ uniformBlockIndex
is an active uniform block index of program
, and must be less than the value
+ of GL_ACTIVE_UNIFORM_BLOCKS
.
+
+ Upon success, the uniform block parameter(s) specified by pname
are returned in params
. If an error
+ occurs, nothing will be written to params
.
+
+ If pname
is GL_UNIFORM_BLOCK_BINDING
, then the index of the uniform buffer binding point
+ last selected by the uniform block specified by uniformBlockIndex
for program
is returned. If
+ no uniform block has been previously specified, zero is returned.
+
+ If pname
is GL_UNIFORM_BLOCK_DATA_SIZE
, then the implementation-dependent minimum total buffer
+ object size, in basic machine units, required to hold all active uniforms in the uniform block identified by uniformBlockIndex
+ is returned. It is neither guaranteed nor expected that a given implementation will arrange uniform values as tightly packed in a buffer
+ object. The exception to this is the std140 uniform block layout, which guarantees specific packing behavior and does not
+ require the application to query for offsets and strides. In this case the minimum size may still be queried, even though it is determined in
+ advance based only on the uniform block declaration.
+
+ If pname
is GL_UNIFORM_BLOCK_NAME_LENGTH
, then the total length (including the nul terminator) of
+ the name of the uniform block identified by uniformBlockIndex
is returned.
+
+ If pname
is GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
, then the number of active uniforms in the uniform
+ block identified by uniformBlockIndex
is returned.
+
+ If pname
is GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
, then a list of the active uniform indices
+ for the uniform block identified by uniformBlockIndex
is returned. The number of elements that will be written to
+ params
is the value of GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS
for uniformBlockIndex
.
+
+ If pname
is GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
,
+ or GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
, then a boolean value indicating whether the uniform block identified by
+ uniformBlockIndex
is referenced by the vertex or fragment programming stages of program, respectively, is returned.
+
+ GL_INVALID_VALUE
is generated if uniformBlockIndex
is greater than or equal to the value
+ of GL_ACTIVE_UNIFORM_BLOCKS
or is not the index of an active uniform block in program
.
+
+ GL_INVALID_ENUM
is generated if pname
is not one of the accepted tokens.
+
+ GL_INVALID_OPERATION
is generated if program
is not the name of a program object for which
+ glLinkProgram has been called in the past.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetActiveUniformBlockiv | +- | +✔ | +
+ glGetActiveUniformBlockName, + glGetUniformBlockIndex, + glLinkProgram +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetActiveUniformsiv — Returns information about several active uniform variables for the specified program object
+
+ void glGetActiveUniformsiv(
+ |
+ GLuint program, | +
+ | GLsizei uniformCount, | +
+ | const GLuint *uniformIndices, | +
+ | GLenum pname, | +
+ | GLint *params) ; |
+
program
+
+
+ Specifies the program object to be queried.
+uniformCount
+
+
+ Specifies both the number of elements in the array of indices uniformIndices
and the
+ number of parameters written to params
upon successful return.
uniformIndices
+
+
+ Specifies the address of an array of uniformCount
integers containing the indices of
+ uniforms within program
whose parameter pname
should be queried.
pname
+
+
+ Specifies the property of each uniform in uniformIndices
that should be
+ written into the corresponding element of params
.
params
+
+
+ Specifies the address of an array of uniformCount
integers which are to
+ receive the value of pname
for each uniform in uniformIndices
.
+ glGetActiveUniformsiv
queries the value of the parameter named pname
+ for each of the uniforms within program
whose indices are specified in the array of
+ uniformCount
unsigned integers uniformIndices
. Upon success,
+ the value of the parameter for each uniform is written into the corresponding entry in the array whose
+ address is given in params
. If an error is generated, nothing is written into
+ params
.
+
+ If pname
is GL_UNIFORM_TYPE
, then an array identifying the types
+ of uniforms specified by the corresponding array of uniformIndices
is returned. The
+ returned types can be any of the values from the following table:
+
+ Returned Symbolic Contant + | +Shader Uniform Type + | +
---|---|
+ GL_FLOAT
+ |
+
+ float
+ |
+
+ GL_FLOAT_VEC2
+ |
+
+ vec2
+ |
+
+ GL_FLOAT_VEC3
+ |
+
+ vec3
+ |
+
+ GL_FLOAT_VEC4
+ |
+
+ vec4
+ |
+
+ GL_INT
+ |
+
+ int
+ |
+
+ GL_INT_VEC2
+ |
+
+ ivec2
+ |
+
+ GL_INT_VEC3
+ |
+
+ ivec3
+ |
+
+ GL_INT_VEC4
+ |
+
+ ivec4
+ |
+
+ GL_UNSIGNED_INT
+ |
+
+ unsigned int
+ |
+
+ GL_UNSIGNED_INT_VEC2
+ |
+
+ uvec2
+ |
+
+ GL_UNSIGNED_INT_VEC3
+ |
+
+ uvec3
+ |
+
+ GL_UNSIGNED_INT_VEC4
+ |
+
+ uvec4
+ |
+
+ GL_BOOL
+ |
+
+ bool
+ |
+
+ GL_BOOL_VEC2
+ |
+
+ bvec2
+ |
+
+ GL_BOOL_VEC3
+ |
+
+ bvec3
+ |
+
+ GL_BOOL_VEC4
+ |
+
+ bvec4
+ |
+
+ GL_FLOAT_MAT2
+ |
+
+ mat2
+ |
+
+ GL_FLOAT_MAT3
+ |
+
+ mat3
+ |
+
+ GL_FLOAT_MAT4
+ |
+
+ mat4
+ |
+
+ GL_FLOAT_MAT2x3
+ |
+
+ mat2x3
+ |
+
+ GL_FLOAT_MAT2x4
+ |
+
+ mat2x4
+ |
+
+ GL_FLOAT_MAT3x2
+ |
+
+ mat3x2
+ |
+
+ GL_FLOAT_MAT3x4
+ |
+
+ mat3x4
+ |
+
+ GL_FLOAT_MAT4x2
+ |
+
+ mat4x2
+ |
+
+ GL_FLOAT_MAT4x3
+ |
+
+ mat4x3
+ |
+
+ GL_SAMPLER_2D
+ |
+
+ sampler2D
+ |
+
+ GL_SAMPLER_3D
+ |
+
+ sampler3D
+ |
+
+ GL_SAMPLER_CUBE
+ |
+
+ samplerCube
+ |
+
+ GL_SAMPLER_2D_SHADOW
+ |
+
+ sampler2DShadow
+ |
+
+ GL_SAMPLER_2D_ARRAY
+ |
+
+ sampler2DArray
+ |
+
+ GL_SAMPLER_2D_ARRAY_SHADOW
+ |
+
+ sampler2DArrayShadow
+ |
+
+ GL_SAMPLER_CUBE_SHADOW
+ |
+
+ samplerCubeShadow
+ |
+
+ GL_INT_SAMPLER_2D
+ |
+
+ isampler2D
+ |
+
+ GL_INT_SAMPLER_3D
+ |
+
+ isampler3D
+ |
+
+ GL_INT_SAMPLER_CUBE
+ |
+
+ isamplerCube
+ |
+
+ GL_INT_SAMPLER_2D_ARRAY
+ |
+
+ isampler2DArray
+ |
+
+ GL_UNSIGNED_INT_SAMPLER_2D
+ |
+
+ usampler2D
+ |
+
+ GL_UNSIGNED_INT_SAMPLER_3D
+ |
+
+ usampler3D
+ |
+
+ GL_UNSIGNED_INT_SAMPLER_CUBE
+ |
+
+ usamplerCube
+ |
+
+ GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
+ |
+
+ usampler2DArray
+ |
+
+
+
+ If pname
is GL_UNIFORM_SIZE
, then an array identifying the
+ size of the uniforms specified by the corresponding array of uniformIndices
is
+ returned. The sizes returned are in units of the type returned by a query of GL_UNIFORM_TYPE
.
+ For active uniforms that are arrays, the size is the number of active elements in the array;
+ for all other uniforms, the size is one.
+
+ If pname
is GL_UNIFORM_NAME_LENGTH
, then an array identifying the
+ length, including the terminating null character, of the uniform name strings specified by the corresponding
+ array of uniformIndices
is returned.
+
+ If pname
is GL_UNIFORM_BLOCK_INDEX
, then an array identifying the
+ the uniform block index of each of the uniforms specified by the corresponding array of uniformIndices
+ is returned. The uniform block index of a uniform associated with the default uniform block is -1.
+
+ If pname
is GL_UNIFORM_OFFSET
, then an array of uniform buffer
+ offsets is returned. For uniforms in a named uniform block, the returned value will be its offset, in basic
+ machine units, relative to the beginning of the uniform block in the buffer object data store. For uniforms
+ in the default uniform block, -1 will be returned.
+
+ If pname
is GL_UNIFORM_ARRAY_STRIDE
, then an array identifying the
+ stride between elements, in basic machine units, of each of the uniforms specified by the corresponding array of
+ uniformIndices
is returned. The stride of a uniform associated with the default uniform
+ block is -1. Note that this information only makes sense for uniforms that are arrays. For uniforms that are
+ not arrays, but are declared in a named uniform block, an array stride of zero is returned.
+
+ If pname
is GL_UNIFORM_MATRIX_STRIDE
, then an array identifying the stride
+ between columns of a column-major matrix or rows of a row-major matrix, in basic machine units, of each of the uniforms
+ specified by the corresponding array of uniformIndices
is returned. The matrix stride of a
+ uniform associated with the default uniform block is -1. Note that this information only makes sense for uniforms
+ that are matrices. For uniforms that are not matrices, but are declared in a named uniform block, a matrix stride of
+ zero is returned.
+
+ If pname
is GL_UNIFORM_IS_ROW_MAJOR
, then an array identifying whether each
+ of the uniforms specified by the corresponding array of uniformIndices
is a row-major matrix or not is returned. A
+ value of one indicates a row-major matrix, and a value of zero indicates a column-major matrix, a matrix in the default
+ uniform block, or a non-matrix.
+
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_VALUE
is generated if
+ uniformCount
is greater than or equal to the
+ value of GL_ACTIVE_UNIFORMS
for
+ program
.
GL_INVALID_ENUM
is generated if pname
+ is not an accepted token.
glGet
+ with argument GL_MAX_VERTEX_UNIFORM_COMPONENTS
,
+ GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
,
+ GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS
, or
+ GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS
.
glGetProgramiv
+ with argument GL_ACTIVE_UNIFORMS
or
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
.
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetActiveUniformsiv | +✔ | +✔ | +
glGetUniform, + glGetActiveUniform, + glGetUniformLocation, + glLinkProgram, + glUniform, + glUseProgram
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetAttachedShaders — Returns the handles of the shader objects attached to a program object
+
+ void glGetAttachedShaders(
+ |
+ GLuint program, | +
+ | GLsizei maxCount, | +
+ | GLsizei *count, | +
+ | GLuint *shaders) ; |
+
program
+
+
+ Specifies the program object to be + queried.
+maxCount
+
+
+ Specifies the size of the array for storing + the returned object names.
+count
+
+
+ Returns the number of names actually returned
+ in shaders
.
shaders
+
+
+ Specifies an array that is used to return the + names of attached shader objects.
+glGetAttachedShaders
returns the
+ names of the shader objects attached to
+ program
. The names of shader objects that
+ are attached to program
will be returned
+ in shaders.
The actual number of shader
+ names written into shaders
is returned in
+ count.
If no shader objects are attached
+ to program
, count
+ is set to 0. The maximum number of shader names that may be
+ returned in shaders
is specified by
+ maxCount
.
If the number of names actually returned is not required
+ (for instance, if it has just been obtained by calling
+ glGetProgramiv),
+ a value of NULL
may be passed for count. If
+ no shader objects are attached to
+ program
, a value of 0 will be returned in
+ count
. The actual number of attached
+ shaders can be obtained by calling
+ glGetProgramiv
+ with the value GL_ATTACHED_SHADERS
.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_VALUE
is generated if
+ maxCount
is less than 0.
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetAttachedShaders | +✔ | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetAttribLocation — Returns the location of an attribute variable
+
+ GLint glGetAttribLocation(
+ |
+ GLuint program, | +
+ | const GLchar *name) ; |
+
program
+
+
+ Specifies the program object to be + queried.
+name
+
+
+ Points to a null terminated string containing + the name of the attribute variable whose location is + to be queried.
+glGetAttribLocation
queries the
+ previously linked program object specified by
+ program
for the attribute variable
+ specified by name
and returns the index
+ of the generic vertex attribute that is bound to that attribute
+ variable. If name
is a matrix attribute
+ variable, the index of the first column of the matrix is
+ returned. If the named attribute variable is not an active
+ attribute in the specified program object or if
+ name
starts with the reserved prefix
+ "gl_", a value of -1 is returned.
The association between an attribute variable name and a
+ generic attribute index can be specified at any time by calling
+ glBindAttribLocation.
+ Attribute bindings do not go into effect until
+ glLinkProgram
+ is called. After a program object has been linked successfully,
+ the index values for attribute variables remain fixed until the
+ next link command occurs. The attribute values can only be
+ queried after a link if the link was successful.
+ glGetAttribLocation
returns the binding
+ that actually went into effect the last time
+ glLinkProgram
+ was called for the specified program object. Attribute bindings
+ that have been specified since the last link operation are not
+ returned by glGetAttribLocation
.
GL_INVALID_OPERATION
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ program
has not been successfully
+ linked.
glGetActiveAttrib
+ with argument program
and the index of an
+ active attribute
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glGetAttribLocation
+ |
+ ✔ | +✔ | +
glBindAttribLocation, + glIsProgram, + glLinkProgram, + glVertexAttrib, + glVertexAttribPointer
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetBufferParameter — return parameters of a buffer object
+
+ void glGetBufferParameteriv(
+ |
+ GLenum target, | +
+ | GLenum value, | +
+ | GLint * data) ; |
+
+ void glGetBufferParameteri64v(
+ |
+ GLenum target, | +
+ | GLenum value, | +
+ | GLint64 * data) ; |
+
target
+
+
+
+ Specifies the target buffer object.
+ The symbolic constant must be GL_ARRAY_BUFFER
,
+ GL_COPY_READ_BUFFER
,
+ GL_COPY_WRITE_BUFFER
,
+ GL_ELEMENT_ARRAY_BUFFER
,
+ GL_PIXEL_PACK_BUFFER
,
+ GL_PIXEL_UNPACK_BUFFER
,
+ GL_TRANSFORM_FEEDBACK_BUFFER
, or
+ GL_UNIFORM_BUFFER
.
+
value
+
+
+
+ Specifies the symbolic name of a buffer object parameter.
+ Accepted values are GL_BUFFER_ACCESS_FLAGS
, GL_BUFFER_MAPPED
,
+ GL_BUFFER_MAP_LENGTH
, GL_BUFFER_MAP_OFFSET
,
+ GL_BUFFER_SIZE
, or GL_BUFFER_USAGE
.
+
data
+
+
+ + Returns the requested parameter. +
+
+ glGetBufferParameteriv
and glGetBufferParameteri64v
+ return in data
a selected parameter of the buffer object
+ specified by target
.
+
+ value
names a specific buffer object parameter, as follows:
+
GL_BUFFER_ACCESS_FLAGS
+
+
+ params
returns the access policy set while mapping the buffer object.
+
GL_BUFFER_MAPPED
+
+
+ params
returns a flag indicating whether the buffer object is currently
+ mapped. The initial value is GL_FALSE
.
+
GL_BUFFER_MAP_LENGTH
+
+
+ params
returns the length of the buffer object mapping,
+ measured in bytes.
+ The initial value is 0.
+
GL_BUFFER_MAP_OFFSET
+
+
+ params
returns the offset (start) of the buffer object mapping,
+ measured in bytes.
+ The initial value is 0.
+
GL_BUFFER_SIZE
+
+
+ params
returns the size of the buffer object, measured in bytes.
+ The initial value is 0.
+
GL_BUFFER_USAGE
+
+
+ params
returns the buffer object's usage pattern.
+
+ If an error is generated,
+ no change is made to the contents of data
.
+
+ If glGetBufferParameteriv
is used to query a value
of
+ GL_BUFFER_SIZE
, values greater than or equal to
+
+ GL_INVALID_ENUM
is generated if target
or value
is not an
+ accepted value.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ GL_INVALID_ENUM
is generated if glGetBufferParameteri64v
is used to query a value
of
+ GL_BUFFER_ACCESS_FLAGS
, GL_BUFFER_MAPPED
or GL_BUFFER_USAGE
.
+
+ GL_INVALID_ENUM
is generated if glGetBufferParameteriv
is used to query a value
of
+ GL_BUFFER_MAP_LENGTH
or GL_BUFFER_MAP_OFFSET
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glGetBufferParameteriv
+ |
+ ✔ | +✔ | +
+ glGetBufferParameteri64v
+ |
+ - | +✔ | +
+ glBindBuffer, + glBufferData, + glMapBufferRange, + glUnmapBuffer +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetBufferPointerv — return the pointer to a mapped buffer object's data store
+
+ void glGetBufferPointerv(
+ |
+ GLenum target, | +
+ | GLenum pname, | +
+ | GLvoid ** params) ; |
+
target
+
+
+
+ Specifies the target buffer object.
+ The symbolic constant must be GL_ARRAY_BUFFER
,
+ GL_COPY_READ_BUFFER
,
+ GL_COPY_WRITE_BUFFER
,
+ GL_ELEMENT_ARRAY_BUFFER
,
+ GL_PIXEL_PACK_BUFFER
,
+ GL_PIXEL_UNPACK_BUFFER
,
+ GL_TRANSFORM_FEEDBACK_BUFFER
, or
+ GL_UNIFORM_BUFFER
.
+
pname
+
+
+
+ Specifies the pointer to be returned. The symbolic constant must be GL_BUFFER_MAP_POINTER
.
+
params
+
+
+
+ Returns the pointer value specified by pname
.
+
+ glGetBufferPointerv
returns pointer information. pname
is a symbolic constant
+ indicating the pointer to be returned, which must be GL_BUFFER_MAP_POINTER
, the pointer
+ to which the buffer object's data store is mapped. If the data store is not currently mapped, NULL
is returned.
+ params
is a pointer to a location in which to place the returned pointer value.
+
+ If an error is generated,
+ no change is made to the contents of params
.
+
+ The initial value for the pointer is NULL
.
+
+ GL_INVALID_ENUM
is generated if target
or pname
is not an
+ accepted value.
+
+ GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is bound to target
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetBufferPointerv | +- | +✔ | +
+ glBindBuffer, + glMapBufferRange +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetError — return error information
+
+ GLenum glGetError(
+ |
+ void) ; |
+
+ glGetError
returns the value of the error flag.
+ Each detectable error is assigned a numeric code and symbolic name.
+ When an error occurs,
+ the error flag is set to the appropriate error code value.
+ No other errors are recorded until glGetError
is called,
+ the error code is returned,
+ and the flag is reset to GL_NO_ERROR
.
+ If a call to glGetError
returns GL_NO_ERROR
,
+ there has been no detectable error since the last call to glGetError
,
+ or since the GL was initialized.
+
+ To allow for distributed implementations,
+ there may be several error flags.
+ If any single error flag has recorded an error,
+ the value of that flag is returned
+ and that flag is reset to GL_NO_ERROR
+ when glGetError
is called.
+ If more than one flag has recorded an error,
+ glGetError
returns and clears an arbitrary error flag value.
+ Thus, glGetError
should always be called in a loop,
+ until it returns GL_NO_ERROR
,
+ if all error flags are to be reset.
+
+ Initially, all error flags are set to GL_NO_ERROR
.
+
+ The following errors are currently defined: +
+GL_NO_ERROR
+
+ + No error has been recorded. + The value of this symbolic constant is guaranteed to be 0. +
+GL_INVALID_ENUM
+
+ + An unacceptable value is specified for an enumerated argument. + The offending command is ignored + and has no other side effect than to set the error flag. +
+GL_INVALID_VALUE
+
+ + A numeric argument is out of range. + The offending command is ignored + and has no other side effect than to set the error flag. +
+GL_INVALID_OPERATION
+
+ + The specified operation is not allowed in the current state. + The offending command is ignored + and has no other side effect than to set the error flag. +
+GL_INVALID_FRAMEBUFFER_OPERATION
+
+ + The framebuffer object is not complete. The offending command + is ignored and has no other side effect than to set the error flag. +
+GL_OUT_OF_MEMORY
+
+ + There is not enough memory left to execute the command. + The state of the GL is undefined, + except for the state of the error flags, + after this error is recorded. +
+
+ When an error flag is set,
+ results of a GL operation are undefined only if GL_OUT_OF_MEMORY
+ has occurred.
+ In all other cases,
+ the command generating the error is ignored and has no effect on the GL state
+ or frame buffer contents.
+ If the generating command returns a value, it returns 0.
+ If glGetError
itself generates an error, it returns 0.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetError | +✔ | +✔ | +
+ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glGetFragDataLocation — query the bindings of color numbers to user-defined varying out variables
+
+ GLint glGetFragDataLocation(
+ |
+ GLuint program, | +
+ | const char * name) ; |
+
program
+
+
+ + The name of the program containing varying out variable whose binding to query +
+name
+
+
+ + The name of the user-defined varying out variable whose binding to query +
+
+ glGetFragDataLocation
retrieves the assigned color number binding for the user-defined
+ varying out variable name
for program program
. program
+ must have previously been linked. name
must be a null-terminated string. If name
+ is not the name of an active user-defined varying out fragment shader variable within program
, -1 will
+ be returned.
+
+ In OpenGL ES Shading Language version 3.00, output variables must be explicitly bound to fragment colors within + the shader text. This query simply returns that binding information. +
+
+ GL_INVALID_OPERATION
is generated if program
is not the name of a program object.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetFragDataLocation | +- | +✔ | +
+ glCreateProgram, +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetFramebufferAttachmentParameteriv — retrieve information about attachments of a bound framebuffer object
+
+ void glGetFramebufferAttachmentParameteriv(
+ |
+ GLenum target, | +
+ | GLenum attachment, | +
+ | GLenum pname, | +
+ | GLint *params) ; |
+
target
+
+
+ + Specifies the target of the query operation. +
+attachment
+
+
+
+ Specifies the attachment within target
+
pname
+
+
+
+ Specifies the parameter of attachment
to query.
+
params
+
+
+
+ Specifies the address of a variable receive the value of pname
for attachment
.
+
+ glGetFramebufferAttachmentParameteriv
returns information about attachments of a bound framebuffer
+ object. target
specifies the framebuffer binding point and must be GL_DRAW_FRAMEBUFFER
,
+ GL_READ_FRAMEBUFFER
or GL_FRAMEBUFFER
. GL_FRAMEBUFFER
is equivalent
+ to GL_DRAW_FRAMEBUFFER
.
+
+ If the default framebuffer is bound to target
then attachment
must be one of
+ GL_BACK
, identifying a color buffer, GL_DEPTH
, identifying the depth buffer,
+ or GL_STENCIL
, identifying the stencil buffer.
+
+ If a framebuffer object is bound, then
+ attachment
must be one of
+ GL_COLOR_ATTACHMENT
i,
+ GL_DEPTH_ATTACHMENT
,
+ GL_STENCIL_ATTACHMENT
, or
+ GL_DEPTH_STENCIL_ATTACHMENT
.
+ i in
+ GL_COLOR_ATTACHMENT
i
+ must be in the range zero to the value of
+ GL_MAX_COLOR_ATTACHMENTS
minus one.
+
+ If attachment
is GL_DEPTH_STENCIL_ATTACHMENT
and different objects are bound
+ to the depth and stencil attachment points of target
the query will fail. If the same object
+ is bound to both attachment points, information about that object will be returned.
+
+ Upon successful return from glGetFramebufferAttachmentParameteriv
, if pname
is
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
, then params
will contain one of GL_NONE
,
+ GL_FRAMEBUFFER_DEFAULT
, GL_TEXTURE
, or GL_RENDERBUFFER
, identifying the type of
+ object which contains the attached image. Other values accepted for pname
depend on the type of object, as described below.
+
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is GL_NONE
, no framebuffer is bound to
+ target
. In this case querying pname
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
+ will return zero, and all other queries will generate an error.
+
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is not GL_NONE
, these queries apply to all other
+ framebuffer types:
+
+ If pname
is GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE
,
+ GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE
, GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE
,
+ GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE
, GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE
,
+ or GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE
, then params
will contain the number
+ of bits in the corresponding red, green, blue, alpha, depth, or stencil component of the specified attachment. Zero is returned
+ if the requested component is not present in attachment
.
+
+ If pname
is GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE
, params
will
+ contain the format of components of the specified attachment, one of GL_FLOAT
, GL_INT
,
+ GL_UNSIGNED_INT
, GL_SIGNED_NORMALIZED
, or GL_UNSIGNED_NORMALIZED
+ for floating-point, signed integer, unsigned integer, signed normalized fixed-point, or unsigned normalized fixed-point components
+ respectively. Only color buffers may have integer components.
+
+ If pname
is GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
, param
will
+ contain the encoding of components of the specified attachment, one of GL_LINEAR
or GL_SRGB
+ for linear or sRGB-encoded components, respectively. Only color buffer components may be sRGB-encoded.
+ For the default framebuffer, color encoding is determined by the implementation.
+ For framebuffer objects, components are sRGB-encoded if the internal format of a color attachment is one of the color-renderable SRGB
+ formats.
+
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is GL_RENDERBUFFER
, then:
+
+ If pname
is GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
, params
will contain
+ the name of the renderbuffer object which contains the attached image.
+
+ If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is GL_TEXTURE
, then:
+
+ If pname
is GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
, then params
will
+ contain the name of the texture object which contains the attached image.
+
+ If pname
is GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
, then params
+ will contain the mipmap level of the texture object which contains the attached image.
+
+ If pname
is GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
and the texture object named
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
is a cube map texture, then params
will contain the cube map
+ face of the cubemap texture object which contains the attached image. Otherwise params
will contain the value
+ zero.
+
+ If pname
is GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER
and the texture object named
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
is a three-dimensional texture or a two-dimensional
+ array texture, then params
will contain the number of the texture layer which contains the attached image.
+ Otherwise params
will contain the value zero.
+
+ Any combinations of framebuffer type and pname
not described above will generate an error.
+
+ GL_INVALID_ENUM
is generated if target
is not one of the accepted tokens.
+
+ GL_INVALID_ENUM
is generated if pname
is not valid for the value of
+ GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
.
+
+ GL_INVALID_OPERATION
is generated if attachment
is not the accepted values
+ for target
.
+
+ GL_INVALID_OPERATION
is generated if attachment
is GL_DEPTH_STENCIL_ATTACHMENT
+ and different objects are bound to the depth and stencil attachment points of target
.
+
+ GL_INVALID_OPERATION
is generated if the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is
+ GL_NONE
and pname
is not GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetFramebufferAttachmentParameteriv | +✔ | +✔ | +
+ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetInternalformativ — retrieve information about implementation-dependent support for internal formats
+
+ void glGetInternalformativ(
+ |
+ GLenum target, | +
+ | GLenum internalformat, | +
+ | GLenum pname, | +
+ | GLsizei bufSize, | +
+ | GLint *params) ; |
+
target
+
+
+
+ Indicates the usage of the internal format. target
must be GL_RENDERBUFFER
.
+
internalformat
+
+
+ + Specifies the internal format about which to retrieve information. +
+pname
+
+
+ + Specifies the type of information to query. +
+bufSize
+
+
+
+ Specifies the maximum number of integers that may be written to params
by the function.
+
params
+
+
+ + Specifies the address of a variable into which to write the retrieved information. +
+
+ glGetInternalformativ
retrieves information about implementation-dependent support for
+ internal formats. target
indicates the target with which the internal format will
+ be used and must be GL_RENDERBUFFER
, corresponding to usage as a renderbuffer.
+
+ internalformat
specifies the internal format about which to retrieve information and
+ must be a color-renderable, depth-renderable or stencil-renderable format.
+
+ The information retrieved will be written to memory addressed by the pointer specified in params
. No
+ more than bufSize
integers will be written to this memory.
+
+ If pname
is GL_NUM_SAMPLE_COUNTS
, the number of sample counts that would be
+ returned by querying GL_SAMPLES
will be returned in params
.
+
+ If pname
is GL_SAMPLES
, the sample counts supported for internalformat
+ and target
are written into params
in descending numeric order. Only positive values are returned.
+ Querying GL_SAMPLES
with bufSize
of one will return just the maximum supported number of
+ samples for this format.
+
+ Since multisampling is not supported for signed and unsigned integer internal
+ formats, the value of GL_NUM_SAMPLE_COUNTS
will be zero for such formats.
+ If internalformat
is GL_RGBA16F
, GL_R32F
,
+ GL_RG32F
, or GL_RGBA32F
, the value of GL_NUM_SAMPLE_COUNTS
+ may be zero, or else the maximum value in GL_SAMPLES
may be less than the value of
+ GL_MAX_SAMPLES
.
+ For every other accepted internalformat
, the maximum value in GL_SAMPLES
is guaranteed to be at least
+ GL_MAX_SAMPLES
.
+
+ GL_INVALID_VALUE
is generated if bufSize
is negative.
+
+ GL_INVALID_ENUM
is generated if pname
is not GL_SAMPLES
or GL_NUM_SAMPLE_COUNTS
.
+
+ GL_INVALID_ENUM
is generated if internalformat
is not color-, depth-, or stencil-renderable.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_RENDERBUFFER
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetInternalformativ | +- | +✔ | +
+ glGet +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetProgramBinary — return a binary representation of a program object's compiled and linked executable source
+
+ void glGetProgramBinary(
+ |
+ GLuint program, | +
+ | GLsizei bufsize, | +
+ | GLsizei *length, | +
+ | GLenum *binaryFormat, | +
+ | void *binary) ; |
+
program
+
+
+ + Specifies the name of a program object whose binary representation to retrieve. +
+bufSize
+
+
+
+ Specifies the size of the buffer whose address is given by binary
.
+
length
+
+
+
+ Specifies the address of a variable to receive the number of bytes written into binary
.
+
binaryFormat
+
+
+ + Specifies the address of a variable to receive a token indicating the format of the binary data returned by the GL. +
+binary
+
+
+
+ Specifies the address an array into which the GL will return program
's binary representation.
+
+ glGetProgramBinary
returns a binary representation of the compiled
+ and linked executable for program
into the array of bytes whose
+ address is specified in binary
. The maximum number of bytes that
+ may be written into binary
is specified by bufSize
.
+ If the program binary is greater in size than bufSize
bytes,
+ then an error is generated, otherwise the actual number of bytes written into binary
+ is returned in the variable whose address is given by length
. If
+ length
is NULL
, then no length is returned.
+
+ The format of the program binary written into binary
is returned in
+ the variable whose address is given by binaryFormat
, and may be implementation dependent. The binary produced
+ by the GL may subsequently be returned to the GL by calling glProgramBinary,
+ with binaryFormat
and length
set to the values
+ returned by glGetProgramBinary
, and passing the returned binary data
+ in the binary
parameter.
+
+ GL_INVALID_OPERATION
is generated if bufSize
is less than
+ the size of GL_PROGRAM_BINARY_LENGTH
for program
.
+
+ GL_INVALID_OPERATION
is generated if GL_LINK_STATUS
for the
+ program object is false.
+
+ glGetProgramiv with argument GL_PROGRAM_BINARY_LENGTH
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetProgramBinary | +- | +✔ | +
+ glGetProgramiv, + glProgramBinary +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetProgramInfoLog — Returns the information log for a program object
+
+ void glGetProgramInfoLog(
+ |
+ GLuint program, | +
+ | GLsizei maxLength, | +
+ | GLsizei *length, | +
+ | GLchar *infoLog) ; |
+
program
+
+
+ Specifies the program object whose information + log is to be queried.
+maxLength
+
+
+ Specifies the size of the character buffer for + storing the returned information log.
+length
+
+
+ Returns the length of the string returned in
+ infoLog
(excluding the null
+ terminator).
infoLog
+
+
+ Specifies an array of characters that is used + to return the information log.
+glGetProgramInfoLog
returns the
+ information log for the specified program object. The
+ information log for a program object is modified when the
+ program object is linked or validated. The string that is
+ returned will be null terminated.
glGetProgramInfoLog
returns in
+ infoLog
as much of the information log as
+ it can, up to a maximum of maxLength
+ characters. The number of characters actually returned,
+ excluding the null termination character, is specified by
+ length
. If the length of the returned
+ string is not required, a value of NULL
can
+ be passed in the length
argument. The
+ size of the buffer required to store the returned information
+ log can be obtained by calling
+ glGetProgramiv
+ with the value GL_INFO_LOG_LENGTH
.
The information log for a program object is either an + empty string, or a string containing information about the last + link operation, or a string containing information about the + last validation operation. It may contain diagnostic messages, + warning messages, and other information. When a program object + is created, its information log will be a string of length + 0.
+The information log for a program object is the OpenGL + implementer's primary mechanism for conveying information about + linking and validating. Therefore, the information log can be + helpful to application developers during the development + process, even when these operations are successful. Application + developers should not expect different OpenGL implementations to + produce identical information logs.
+GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_VALUE
is generated if
+ maxLength
is less than 0.
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetProgramInfoLog | +✔ | +✔ | +
glCompileShader, + glGetShaderInfoLog, + glLinkProgram, + glValidateProgram
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetProgramiv — Returns a parameter from a program object
+
+ void glGetProgramiv(
+ |
+ GLuint program, | +
+ | GLenum pname, | +
+ | GLint *params) ; |
+
program
+
+
+ Specifies the program object to be + queried.
+pname
+
+
+ Specifies the object parameter. Accepted
+ symbolic names are
+ GL_ACTIVE_ATTRIBUTES
,
+ GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
,
+ GL_ACTIVE_UNIFORMS
,
+ GL_ACTIVE_UNIFORM_BLOCKS
,
+ GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH
,
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
,
+ GL_ATTACHED_SHADERS
,
+ GL_DELETE_STATUS
,
+ GL_INFO_LOG_LENGTH
,
+ GL_LINK_STATUS
,
+ GL_PROGRAM_BINARY_RETRIEVABLE_HINT
,
+ GL_TRANSFORM_FEEDBACK_BUFFER_MODE
,
+ GL_TRANSFORM_FEEDBACK_VARYINGS
,
+ GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH
and
+ GL_VALIDATE_STATUS
.
params
+
+
+ Returns the requested object parameter.
+glGetProgramiv
+ returns in params
+ the value of a parameter for a specific program object. The following parameters are defined:
GL_ACTIVE_ATTRIBUTES
+
+ +
+ params
returns the
+ number of active attribute variables for
+ program
.
GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
+
+ +
+ params
returns the
+ length of the longest active attribute name for
+ program
, including the null
+ termination character (i.e., the size of the
+ character buffer required to store the longest
+ attribute name). If no active attributes exist, 0 is
+ returned.
GL_ACTIVE_UNIFORM_BLOCKS
+
+ +
+ params
returns the
+ number of uniform blocks for program
+ containing active uniforms.
GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH
+
+ +
+ params
returns the
+ length of the longest active uniform block name
+ for program
, including the
+ null termination character (i.e., the size of the
+ character buffer required to store the longest
+ uniform block name). If no active uniform
+ blocks exist, 0 is returned.
GL_ACTIVE_UNIFORMS
+
+ +
+ params
returns the
+ number of active uniform variables for
+ program
.
GL_ACTIVE_UNIFORM_MAX_LENGTH
+
+ +
+ params
returns the
+ length of the longest active uniform variable name
+ for program
, including the
+ null termination character (i.e., the size of the
+ character buffer required to store the longest
+ uniform variable name). If no active uniform
+ variables exist, 0 is returned.
GL_ATTACHED_SHADERS
+
+ +
+ params
returns the
+ number of shader objects attached to
+ program
.
GL_DELETE_STATUS
+
+ +
+ params
returns
+ GL_TRUE
if
+ program
is currently flagged
+ for deletion, and GL_FALSE
+ otherwise.
GL_INFO_LOG_LENGTH
+
+ +
+ params
returns the
+ number of characters in the information log for
+ program
including the null
+ termination character (i.e., the size of the
+ character buffer required to store the information
+ log). If program
has no
+ information log, a value of 0 is
+ returned.
GL_LINK_STATUS
+
+ +
+ params
returns
+ GL_TRUE
if the last link
+ operation on program
was
+ successful, and GL_FALSE
+ otherwise.
GL_PROGRAM_BINARY_RETRIEVABLE_HINT
+
+ +
+ params
returns the
+ current value of whether the binary retrieval
+ hint is enabled for program
.
+
GL_TRANSFORM_FEEDBACK_BUFFER_MODE
+
+ +
+ params
returns a symbolic constant
+ indicating the buffer mode used when transform feedback is active.
+ This may be GL_SEPARATE_ATTRIBS
or
+ GL_INTERLEAVED_ATTRIBS
.
GL_TRANSFORM_FEEDBACK_VARYINGS
+
+ +
+ params
returns the number of varying
+ variables to capture in transform feedback mode for the program.
GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH
+
+ +
+ params
returns the length of the longest
+ variable name to be used for transform feedback, including the null-terminator.
GL_VALIDATE_STATUS
+
+ +
+ params
returns
+ GL_TRUE
or if the last
+ validation operation on
+ program
was successful, and
+ GL_FALSE
+ otherwise.
If an error is generated, no change is made to the
+ contents of params
.
GL_INVALID_VALUE
+ is generated if program
+ is not a value generated by OpenGL.
GL_INVALID_OPERATION
+ is generated if program
+ does not refer to a program object.
GL_INVALID_ENUM
+ is generated if pname
+ is not an accepted value.
glGetActiveAttrib
+ with argument program
glGetActiveUniform
+ with argument program
glGetAttachedShaders
+ with argument program
glGetProgramInfoLog
+ with argument program
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetProgramiv | +✔ | +✔ | +
glAttachShader, + glCreateProgram, + glDeleteProgram, + glGetShaderiv, + glLinkProgram, + glValidateProgram
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetQueryObjectuiv — return parameters of a query object
+
+ void glGetQueryObjectuiv(
+ |
+ GLuint id, | +
+ | GLenum pname, | +
+ | GLuint * params) ; |
+
id
+
+
+ + Specifies the name of a query object. +
+pname
+
+
+
+ Specifies the symbolic name of a query object parameter.
+ Accepted values are GL_QUERY_RESULT
or GL_QUERY_RESULT_AVAILABLE
.
+
params
+
+
+ + Returns the requested data. +
+
+ glGetQueryObjectuiv
returns in params
a selected parameter of the query object
+ specified by id
.
+
+ pname
names a specific query object parameter. pname
can be as follows:
+
GL_QUERY_RESULT
+
+
+ params
returns the value of the query object's passed samples counter.
+ The initial value is 0.
+
GL_QUERY_RESULT_AVAILABLE
+
+
+ params
returns whether the passed samples counter is immediately available.
+ If a delay would occur waiting for the query result, GL_FALSE
is returned.
+ Otherwise, GL_TRUE
is returned, which also indicates that the results of all
+ previous queries of the same type are available as well.
+
+ If an error is generated,
+ no change is made to the contents of params
.
+
+ glGetQueryObjectuiv
implicitly flushes the GL pipeline so that any incomplete rendering
+ delimited by the occlusion query completes in finite time.
+
+ Repeatedly querying the GL_QUERY_RESULT_AVAILABLE
state for any given query object is
+ guaranteed to return true eventually. Note that multiple queries to the same occlusion object may result in a
+ significant performance loss. For better performance it is recommended to wait N frames before querying this
+ state. N is implementation-dependent but is generally between one and three.
+
+ If multiple queries are issued using the same query object id
before calling
+ glGetQueryObjectuiv
, the results of the most recent query will be returned. In this case,
+ when issuing a new query, the results of the previous query are discarded.
+
+ GL_INVALID_ENUM
is generated if pname
is not an accepted value.
+
+ GL_INVALID_OPERATION
is generated if id
is not the name of a query object.
+
+ GL_INVALID_OPERATION
is generated if id
is the name of a currently active
+ query object.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetQueryObjectuiv | +- | +✔ | +
+ glBeginQuery, + glEndQuery, + glGetQueryiv, + glIsQuery, +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetQueryiv — return parameters of a query object target
+
+ void glGetQueryiv(
+ |
+ GLenum target, | +
+ | GLenum pname, | +
+ | GLint * params) ; |
+
target
+
+
+
+ Specifies a query object target.
+ Must be GL_ANY_SAMPLES_PASSED
, GL_ANY_SAMPLES_PASSED_CONSERVATIVE
, or
+ GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
.
+
pname
+
+
+
+ Specifies the symbolic name of a query object target parameter.
+ Must be GL_CURRENT_QUERY
.
+
params
+
+
+ + Returns the requested data. +
+
+ glGetQueryiv
returns in params
a selected parameter of the query object target
+ specified by target
.
+
+ pname
names a specific query object target parameter. When pname
is
+ GL_CURRENT_QUERY
, the name of the currently active query for target
,
+ or zero if no query is active, will be placed in params
.
+
+ If an error is generated,
+ no change is made to the contents of params
.
+
+ GL_INVALID_ENUM
is generated if target
or pname
is not an
+ accepted value.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetQueryiv | +- | +✔ | +
+ glGetQueryObjectuiv, + glIsQuery +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetRenderbufferParameteriv — retrieve information about a bound renderbuffer object
+
+ void glGetRenderbufferParameteriv(
+ |
+ GLenum target, | +
+ | GLenum pname, | +
+ | GLint *params) ; |
+
target
+
+
+
+ Specifies the target of the query operation. target
must be GL_RENDERBUFFER
.
+
pname
+
+
+
+ Specifies the parameter whose value to retrieve from the renderbuffer bound to target
.
+
params
+
+
+ + Specifies the address of an array to receive the value of the queried parameter. +
+
+ glGetRenderbufferParameteriv
retrieves information about a bound renderbuffer object. target
+ specifies the target of the query operation and must be GL_RENDERBUFFER
. pname
specifies
+ the parameter whose value to query and must be one of GL_RENDERBUFFER_WIDTH
, GL_RENDERBUFFER_HEIGHT
,
+ GL_RENDERBUFFER_INTERNAL_FORMAT
, GL_RENDERBUFFER_RED_SIZE
, GL_RENDERBUFFER_GREEN_SIZE
,
+ GL_RENDERBUFFER_BLUE_SIZE
, GL_RENDERBUFFER_ALPHA_SIZE
, GL_RENDERBUFFER_DEPTH_SIZE
,
+ GL_RENDERBUFFER_STENCIL_SIZE
, or GL_RENDERBUFFER_SAMPLES
.
+
+ Upon a successful return from glGetRenderbufferParameteriv
, if pname
is GL_RENDERBUFFER_WIDTH
,
+ GL_RENDERBUFFER_HEIGHT
, GL_RENDERBUFFER_INTERNAL_FORMAT
, or GL_RENDERBUFFER_SAMPLES
,
+ then params
will contain the width in pixels, the height in pixels, the internal format, or the number of samples, respectively,
+ of the image of the renderbuffer currently bound to target
.
+
+ If pname
is GL_RENDERBUFFER_RED_SIZE
, GL_RENDERBUFFER_GREEN_SIZE
,
+ GL_RENDERBUFFER_BLUE_SIZE
, GL_RENDERBUFFER_ALPHA_SIZE
, GL_RENDERBUFFER_DEPTH_SIZE
,
+ or GL_RENDERBUFFER_STENCIL_SIZE
, then params
will contain the actual resolutions (not the resolutions
+ specified when the image array was defined) for the red, green, blue, alpha depth, or stencil components, respectively, of the image of the
+ renderbuffer currently bound to target
.
+
+ GL_INVALID_ENUM
is generated if pname
is not one of the accepted tokens.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetRenderbufferParameteriv | +✔ | +✔ | +
+ glGenRenderbuffers, + glFramebufferRenderbuffer, + glBindRenderbuffer, + glRenderbufferStorage, + glRenderbufferStorageMultisample +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetSamplerParameter — return sampler parameter values
+
+ void glGetSamplerParameterfv(
+ |
+ GLuint sampler, | +
+ | GLenum pname, | +
+ | GLfloat * params) ; |
+
+ void glGetSamplerParameteriv(
+ |
+ GLuint sampler, | +
+ | GLenum pname, | +
+ | GLint * params) ; |
+
sampler
+
+
+ + Specifies name of the sampler object from which to retrieve parameters. +
+pname
+
+
+
+ Specifies the symbolic name of a sampler parameter.
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_MIN_LOD
,
+ GL_TEXTURE_MAX_LOD
,
+ GL_TEXTURE_WRAP_S
,
+ GL_TEXTURE_WRAP_T
,
+ GL_TEXTURE_WRAP_R
,
+ GL_TEXTURE_COMPARE_MODE
, and
+ GL_TEXTURE_COMPARE_FUNC
+ are accepted.
+
params
+
+
+ + Returns the sampler parameters. +
+
+ glGetSamplerParameter
* returns in params
the value or values of the sampler parameter
+ specified as pname
.
+ sampler
defines the target sampler, and must be the name of an existing sampler object, returned from a previous call
+ to glGenSamplers.
+ pname
accepts the same symbols as glSamplerParameter*,
+ with the same interpretations:
+
GL_TEXTURE_MAG_FILTER
+
+
+ Returns the single-valued texture magnification filter,
+ a symbolic constant. The initial value is GL_LINEAR
.
+
GL_TEXTURE_MIN_FILTER
+
+
+ Returns the single-valued texture minification filter,
+ a symbolic constant. The initial value is GL_NEAREST_MIPMAP_LINEAR
.
+
GL_TEXTURE_MIN_LOD
+
+ + Returns the single-valued texture minimum level-of-detail value. The + initial value is + . +
+GL_TEXTURE_MAX_LOD
+
+ + Returns the single-valued texture maximum level-of-detail value. The + initial value is 1000. +
+GL_TEXTURE_WRAP_S
+
+
+ Returns the single-valued wrapping function for texture coordinate
+ ,
+ a symbolic constant. The initial value is GL_REPEAT
.
+
GL_TEXTURE_WRAP_T
+
+
+ Returns the single-valued wrapping function for texture coordinate
+ ,
+ a symbolic constant. The initial value is GL_REPEAT
.
+
GL_TEXTURE_WRAP_R
+
+
+ Returns the single-valued wrapping function for texture coordinate
+ ,
+ a symbolic constant. The initial value is GL_REPEAT
.
+
GL_TEXTURE_COMPARE_MODE
+
+
+ Returns a single-valued texture comparison mode, a symbolic constant. The
+ initial value is GL_NONE
. See glSamplerParameter.
+
GL_TEXTURE_COMPARE_FUNC
+
+
+ Returns a single-valued texture comparison function, a symbolic constant. The
+ initial value is GL_LEQUAL
. See glSamplerParameter.
+
+ If an error is generated,
+ no change is made to the contents of params
.
+
+ GL_INVALID_OPERATION
is generated if sampler
is not the name of a sampler object returned from
+ a previous call to glGenSamplers.
+
+ GL_INVALID_ENUM
is generated if pname
is not an accepted value.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glGetSamplerParameterfv
+ |
+ - | +✔ | +
+ glGetSamplerParameteriv
+ |
+ - | +✔ | +
+ glSamplerParameter, + glGenSamplers, + glDeleteSamplers, + glSamplerParameter +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetShaderInfoLog — Returns the information log for a shader object
+
+ void glGetShaderInfoLog(
+ |
+ GLuint shader, | +
+ | GLsizei maxLength, | +
+ | GLsizei *length, | +
+ | GLchar *infoLog) ; |
+
shader
+
+
+ Specifies the shader object whose information + log is to be queried.
+maxLength
+
+
+ Specifies the size of the character buffer for + storing the returned information log.
+length
+
+
+ Returns the length of the string returned in
+ infoLog
(excluding the null
+ terminator).
infoLog
+
+
+ Specifies an array of characters that is used + to return the information log.
+glGetShaderInfoLog
returns the
+ information log for the specified shader object. The information
+ log for a shader object is modified when the shader is compiled.
+ The string that is returned will be null terminated.
glGetShaderInfoLog
returns in
+ infoLog
as much of the information log as
+ it can, up to a maximum of maxLength
+ characters. The number of characters actually returned,
+ excluding the null termination character, is specified by
+ length
. If the length of the returned
+ string is not required, a value of NULL
can
+ be passed in the length
argument. The
+ size of the buffer required to store the returned information
+ log can be obtained by calling
+ glGetShaderiv
+ with the value GL_INFO_LOG_LENGTH
.
The information log for a shader object is a string that + may contain diagnostic messages, warning messages, and other + information about the last compile operation. When a shader + object is created, its information log will be a string of + length 0.
+The information log for a shader object is the OpenGL + implementer's primary mechanism for conveying information about + the compilation process. Therefore, the information log can be + helpful to application developers during the development + process, even when compilation is successful. Application + developers should not expect different OpenGL implementations to + produce identical information logs.
+GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_VALUE
is generated if
+ maxLength
is less than 0.
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetShaderInfoLog | +✔ | +✔ | +
glCompileShader, + glGetProgramInfoLog, + glLinkProgram, + glValidateProgram
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetShaderPrecisionFormat — retrieve the range and precision for numeric formats supported by the shader compiler
+
+ void glGetShaderPrecisionFormat(
+ |
+ GLenum shaderType, | +
+ | GLenum precisionType, | +
+ | GLint *range, | +
+ | GLint *precision) ; |
+
shaderType
+
+
+
+ Specifies the type of shader whose precision to query. shaderType
+ must be GL_VERTEX_SHADER
or GL_FRAGMENT_SHADER
.
+
precisionType
+
+
+ + Specifies the numeric format whose precision and range to query. +
+range
+
+
+ + Specifies the address of array of two integers into which encodings of the implementation's + numeric range are returned. +
+precision
+
+
+ + Specifies the address of an integer into which the numeric precision of the implementation + is written. +
+
+ glGetShaderPrecisionFormat
retrieves the numeric range and precision for
+ the implementation's representation of quantities in different numeric formats in specified
+ shader type. shaderType
specifies the type of shader for which the numeric
+ precision and range is to be retrieved and must be one of GL_VERTEX_SHADER
+ or GL_FRAGMENT_SHADER
. precisionType
specifies the
+ numeric format to query and must be one of GL_LOW_FLOAT
, GL_MEDIUM_FLOAT
+ GL_HIGH_FLOAT
, GL_LOW_INT
, GL_MEDIUM_INT
,
+ or GL_HIGH_INT
.
+
+ range
points to an array of two integers into which the format's numeric range
+ will be returned. If min and max are the smallest values representable in the format, then the values
+ returned are defined to be: range
[0] = floor(log2(|min|)) and
+ range
[1] = floor(log2(|max|)).
+
+ precision
specifies the address of an integer into which will be written
+ the log2 value of the number of bits of precision of the format. If the smallest representable
+ value greater than 1 is 1 + eps, then the integer addressed by precision
+ will contain floor(-log2(eps)).
+
+ GL_INVALID_ENUM
is generated if shaderType
or
+ precisionType
is not an accepted value.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetShaderPrecisionFormat | +✔ | +✔ | +
+ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetShaderSource — Returns the source code string from a shader object
+
+ void glGetShaderSource(
+ |
+ GLuint shader, | +
+ | GLsizei bufSize, | +
+ | GLsizei *length, | +
+ | GLchar *source) ; |
+
shader
+
+
+ Specifies the shader object to be + queried.
+bufSize
+
+
+ Specifies the size of the character buffer for + storing the returned source code string.
+length
+
+
+ Returns the length of the string returned in
+ source
(excluding the null
+ terminator).
source
+
+
+ Specifies an array of characters that is used + to return the source code string.
+glGetShaderSource
returns the
+ concatenation of the source code strings from the shader object
+ specified by shader
. The source code
+ strings for a shader object are the result of a previous call to
+ glShaderSource.
+ The string returned by the function will be null
+ terminated.
glGetShaderSource
returns in
+ source
as much of the source code string
+ as it can, up to a maximum of bufSize
+ characters. The number of characters actually returned,
+ excluding the null termination character, is specified by
+ length
. If the length of the returned
+ string is not required, a value of NULL
can
+ be passed in the length
argument. The
+ size of the buffer required to store the returned source code
+ string can be obtained by calling
+ glGetShaderiv
+ with the value
+ GL_SHADER_SOURCE_LENGTH
.
GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_VALUE
is generated if
+ bufSize
is less than 0.
glGetShaderiv
+ with argument
+ GL_SHADER_SOURCE_LENGTH
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetShaderSource | +✔ | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetShaderiv — Returns a parameter from a shader object
+
+ void glGetShaderiv(
+ |
+ GLuint shader, | +
+ | GLenum pname, | +
+ | GLint *params) ; |
+
shader
+
+
+ Specifies the shader object to be + queried.
+pname
+
+
+ Specifies the object parameter. Accepted
+ symbolic names are
+ GL_SHADER_TYPE
,
+ GL_DELETE_STATUS
,
+ GL_COMPILE_STATUS
,
+ GL_INFO_LOG_LENGTH
,
+ GL_SHADER_SOURCE_LENGTH
.
params
+
+
+ Returns the requested object parameter.
+glGetShaderiv
+ returns in params
+ the value of a parameter for a specific shader object. The
+ following parameters are defined:
GL_SHADER_TYPE
+
+ params
returns
+ GL_VERTEX_SHADER
if
+ shader
is a vertex shader
+ object, and GL_FRAGMENT_SHADER
+ if shader
is a fragment
+ shader object.
GL_DELETE_STATUS
+
+ params
returns
+ GL_TRUE
if
+ shader
is currently flagged
+ for deletion, and GL_FALSE
+ otherwise.
GL_COMPILE_STATUS
+
+ params
returns
+ GL_TRUE
if the last compile
+ operation on shader
was
+ successful, and GL_FALSE
+ otherwise.
GL_INFO_LOG_LENGTH
+
+ params
returns the
+ number of characters in the information log for
+ shader
including the null
+ termination character (i.e., the size of the
+ character buffer required to store the information
+ log). If shader
has no
+ information log, a value of 0 is returned.
GL_SHADER_SOURCE_LENGTH
+
+ params
returns the
+ length of the concatenation of the source strings
+ that make up the shader source for the
+ shader
, including the null
+ termination character. (i.e., the size of the
+ character buffer required to store the shader
+ source). If no source code exists, 0 is
+ returned.
If an error is generated, no change is made to the
+ contents of params
.
GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ shader
does not refer to a shader
+ object.
GL_INVALID_ENUM
is generated if
+ pname
is not an accepted value.
glGetShaderInfoLog
+ with argument shader
glGetShaderSource
+ with argument shader
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetShaderiv | +✔ | +✔ | +
glCompileShader, + glCreateShader, + glDeleteShader, + glGetProgramiv, + glShaderSource
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetString — return a string describing the current GL connection
+
+ const GLubyte* glGetString(
+ |
+ GLenum name) ; |
+
+ const GLubyte* glGetStringi(
+ |
+ GLenum name, | +
+ | GLuint index) ; |
+
name
+
+
+
+ Specifies a symbolic constant, one of
+ GL_EXTENSIONS
, GL_RENDERER
,
+ GL_SHADING_LANGUAGE_VERSION
, GL_VENDOR
, or
+ GL_VERSION
.
+ glGetStringi
accepts only the GL_EXTENSIONS
token.
+
index
+
+
+
+ For glGetStringi
, specifies the index of the string to return.
+
+ glGetString
returns a pointer to a static string
+ describing some aspect of the current GL connection.
+ name
can be one of the following:
+
GL_EXTENSIONS
+
+ + Returns the extension string supported by the implementation. +
+GL_VENDOR
+
+ + Returns the company responsible for this GL implementation. + This name does not change from release to release. +
+GL_RENDERER
+
+ + Returns the name of the renderer. + This name is typically specific to a particular configuration of a hardware + platform. + It does not change from release to release. +
+GL_VERSION
+
+ + Returns a version or release number. +
+GL_SHADING_LANGUAGE_VERSION
+
+ + Returns a version or release number for the shading language. +
+
+ glGetStringi
returns a pointer to a static string
+ indexed by index
.
+ name
can be one of the following:
+
GL_EXTENSIONS
+
+
+ Returns the extension string supported by the implementation at index
.
+
+ Strings GL_VENDOR
and GL_RENDERER
together uniquely specify
+ a platform. They do not change from release to release and should be used
+ by platform-recognition algorithms.
+
+ The GL_VERSION
and GL_SHADING_LANGUAGE_VERSION
strings begin with a version number.
+ The version number uses one
+ of these forms:
+
+ major_number.minor_number + major_number.minor_number.release_number +
++ Vendor-specific information may follow the version + number. Its format depends on the implementation, but + a space always separates the version number and + the vendor-specific information. +
++ All strings are null-terminated. +
+
+ If an error is generated, glGetString
returns 0.
+
+ The client and server may support different versions.
+ glGetString
always returns a compatible version number.
+ The release number always describes the server.
+
+ There is no defined relationship between the order in which extension names appear in + the non-indexed string and the order in which they appear in the indexed query. +
++ There is no defined relationship between any particular extension name and the index values; + an extension name may correspond to a different index in different GL contexts and/or implementations. +
+
+ GL_INVALID_ENUM
is generated if name
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated by glGetStringi
if
+ index
is outside the valid range for indexed state name
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ GetString
+ |
+ ✔ | +✔ | +
+ GetStringi
+ |
+ - | +✔ | +
+ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glGetSynciv — query the properties of a sync object
+
+ void glGetSynciv(
+ |
+ GLsync sync, | +
+ | GLenum pname, | +
+ | GLsizei bufSize, | +
+ | GLsizei *length, | +
+ | GLint *values) ; |
+
sync
+
+
+ + Specifies the sync object whose properties to query. +
+pname
+
+
+
+ Specifies the parameter whose value to retrieve from the sync object specified in sync
.
+
bufSize
+
+
+
+ Specifies the size of the buffer whose address is given in values
.
+
length
+
+
+
+ Specifies the address of an variable to receive the number of integers placed in values
.
+
values
+
+
+ + Specifies the address of an array to receive the values of the queried parameter. +
+
+ glGetSynciv
retrieves properties of a sync object. sync
specifies the name of the sync
+ object whose properties to retrieve.
+
+ On success, glGetSynciv
replaces up to bufSize
integers in values
with the
+ corresponding property values of the object being queried. The actual number of integers replaced is returned in the variable whose address is
+ specified in length
. If length
is NULL
, no length is returned.
+
+ If pname
is GL_OBJECT_TYPE
, a single value representing the specific type of the sync object is
+ placed in values
. The only type supported is GL_SYNC_FENCE
.
+
+ If pname
is GL_SYNC_STATUS
, a single value representing the status of the sync object
+ (GL_SIGNALED
or GL_UNSIGNALED
) is placed in values
.
+
+ If pname
is GL_SYNC_CONDITION
, a single value representing the condition of the sync object
+ is placed in values
. The only condition supported is GL_SYNC_GPU_COMMANDS_COMPLETE
.
+
+ If pname
is GL_SYNC_FLAGS
, a single value representing the flags with which the sync object
+ was created is placed in values
. No flags are currently supported[1].
+
+ If an error occurs, nothing will be written to values
or length
.
+
+ GL_INVALID_VALUE
is generated if sync
is not the name of a sync object.
+
+ GL_INVALID_ENUM
is generated if pname
is not one of the accepted tokens.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetSynciv | +- | +✔ | +
+ glFenceSync, + glWaitSync, + glClientWaitSync +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetTexParameter — return texture parameter values
+
+ void glGetTexParameterfv(
+ |
+ GLenum target, | +
+ | GLenum pname, | +
+ | GLfloat * params) ; |
+
+ void glGetTexParameteriv(
+ |
+ GLenum target, | +
+ | GLenum pname, | +
+ | GLint * params) ; |
+
target
+
+
+
+ Specifies the symbolic name of the target texture.
+ GL_TEXTURE_2D
,
+ GL_TEXTURE_2D_ARRAY
,
+ GL_TEXTURE_3D
, and
+ GL_TEXTURE_CUBE_MAP
+ are accepted.
+
pname
+
+
+
+ Specifies the symbolic name of a texture parameter.
+ GL_TEXTURE_BASE_LEVEL
,
+ GL_TEXTURE_COMPARE_FUNC
,
+ GL_TEXTURE_COMPARE_MODE
,
+ GL_TEXTURE_IMMUTABLE_FORMAT
,
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_MAX_LEVEL
,
+ GL_TEXTURE_MAX_LOD
,
+ GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_MIN_LOD
,
+ GL_TEXTURE_SWIZZLE_R
,
+ GL_TEXTURE_SWIZZLE_G
,
+ GL_TEXTURE_SWIZZLE_B
,
+ GL_TEXTURE_SWIZZLE_A
,
+ GL_TEXTURE_WRAP_S
,
+ GL_TEXTURE_WRAP_T
, and
+ GL_TEXTURE_WRAP_R
+ are accepted.
+
params
+
+
+ + Returns the texture parameters. +
+
+ glGetTexParameter
returns in params
the value or values of the texture parameter
+ specified as pname
.
+ target
defines the target texture.
+ GL_TEXTURE_2D
,
+ GL_TEXTURE_3D
,
+ GL_TEXTURE_2D_ARRAY
, and
+ GL_TEXTURE_CUBE_MAP
+ specify two- or three-dimensional, two-dimensional array, or cube-mapped texturing, respectively.
+ pname
accepts the same symbols as glTexParameter,
+ with the same interpretations:
+
GL_TEXTURE_BASE_LEVEL
+
+ + Returns the single-valued base texture mipmap level. The initial value is 0. +
+GL_TEXTURE_COMPARE_FUNC
+
+
+ Returns a single-valued texture comparison function, a symbolic constant. The
+ initial value is GL_LEQUAL
. See glTexParameter.
+
GL_TEXTURE_COMPARE_MODE
+
+
+ Returns a single-valued texture comparison mode, a symbolic constant. The
+ initial value is GL_NONE
. See glTexParameter.
+
GL_TEXTURE_IMMUTABLE_FORMAT
+
+
+ Returns a single-value boolean representing the immutability of the texture format and size.
+ initial value is GL_FALSE
. See glTexStorage2D.
+
GL_TEXTURE_MAG_FILTER
+
+
+ Returns the single-valued texture magnification filter,
+ a symbolic constant. The initial value is GL_LINEAR
.
+
GL_TEXTURE_MAX_LEVEL
+
+ + Returns the single-valued maximum texture mipmap array level. The initial + value is 1000. +
+GL_TEXTURE_MAX_LOD
+
+ + Returns the single-valued texture maximum level-of-detail value. The + initial value is 1000. +
+GL_TEXTURE_MIN_FILTER
+
+
+ Returns the single-valued texture minification filter,
+ a symbolic constant. The initial value is GL_NEAREST_MIPMAP_LINEAR
.
+
GL_TEXTURE_MIN_LOD
+
+ + Returns the single-valued texture minimum level-of-detail value. The + initial value is + . +
+GL_TEXTURE_SWIZZLE_R
+
+
+ Returns the red component swizzle. The initial value is GL_RED
.
+
GL_TEXTURE_SWIZZLE_G
+
+
+ Returns the green component swizzle. The initial value is GL_GREEN
.
+
GL_TEXTURE_SWIZZLE_B
+
+
+ Returns the blue component swizzle. The initial value is GL_BLUE
.
+
GL_TEXTURE_SWIZZLE_A
+
+
+ Returns the alpha component swizzle. The initial value is GL_ALPHA
.
+
GL_TEXTURE_WRAP_S
+
+
+ Returns the single-valued wrapping function for texture coordinate
+ ,
+ a symbolic constant. The initial value is GL_REPEAT
.
+
GL_TEXTURE_WRAP_T
+
+
+ Returns the single-valued wrapping function for texture coordinate
+ ,
+ a symbolic constant. The initial value is GL_REPEAT
.
+
GL_TEXTURE_WRAP_R
+
+
+ Returns the single-valued wrapping function for texture coordinate
+ ,
+ a symbolic constant. The initial value is GL_REPEAT
.
+
+ If an error is generated,
+ no change is made to the contents of params
.
+
+ GL_INVALID_ENUM
is generated if target
or pname
is not an
+ accepted value.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glGetTexParameterfv
+ |
+ ✔ | +✔ | +
+ glGetTexParameteriv
+ |
+ ✔ | +✔ | +
+ glTexParameter, + glTexStorage2D +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glGetTransformFeedbackVarying — retrieve information about varying variables selected for transform feedback
+
+ void glGetTransformFeedbackVarying(
+ |
+ GLuint program, | +
+ | GLuint index, | +
+ | GLsizei bufSize, | +
+ | GLsizei * length, | +
+ | GLsizei size, | +
+ | GLenum * type, | +
+ | char * name) ; |
+
program
+
+
+ + The name of the target program object. +
+index
+
+
+ + The index of the varying variable whose information to retrieve. +
+bufSize
+
+
+
+ The maximum number of characters, including the null terminator, that may be written into name
.
+
length
+
+
+
+ The address of a variable which will receive the number of characters written into name
,
+ excluding the null-terminator. If length
is NULL
no length is returned.
+
size
+
+
+ + The address of a variable that will receive the size of the varying. +
+type
+
+
+ + The address of a variable that will recieve the type of the varying. +
+name
+
+
+ + The address of a buffer into which will be written the name of the varying. +
+
+ Information about the set of varying variables in a linked program that will be captured
+ during transform feedback may be retrieved by calling glGetTransformFeedbackVarying
.
+ glGetTransformFeedbackVarying
provides information about the varying
+ variable selected by index
. An index
of 0 selects
+ the first varying variable specified in the varyings
array passed
+ to glTransformFeedbackVaryings, and
+ an index
of GL_TRANSFORM_FEEDBACK_VARYINGS-1
selects
+ the last such variable.
+
+ The name of the selected varying is returned as a null-terminated string in
+ name
. The actual number of characters written into name
,
+ excluding the null terminator, is returned in length
. If length
+ is NULL, no length is returned. The maximum number of characters that may be written into name
,
+ including the null terminator, is specified by bufSize
.
+
+ The length of the longest varying name in program is given by GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH
,
+ which can be queried with glGetProgramiv.
+
+ For the selected varying variable, its type is returned into type
. The size of
+ the varying is returned into size
. The value in size
is
+ in units of the type returned in type
. The type returned can be any of the
+ scalar, vector, or matrix attribute types returned by glGetActiveAttrib.
+ If an error occurred, the return parameters length
, size
,
+ type
and name
will be unmodified. This command will return as much
+ information about the varying variables as possible. If no information is available, length
+ will be set to zero and name
will be an empty string. This situation could
+ arise if glGetTransformFeedbackVarying
is called after a failed link.
+
+ GL_INVALID_VALUE
is generated if program
is not
+ the name of a program object.
+
+ GL_INVALID_VALUE
is generated if index
is greater or equal to
+ the value of GL_TRANSFORM_FEEDBACK_VARYINGS
.
+
+ GL_INVALID_OPERATION
is generated program
has not been linked.
+
+ glGetProgramiv with argument GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH
+ or GL_TRANSFORM_FEEDBACK_VARYINGS
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetTransformFeedbackVarying | +- | +✔ | +
+ glBeginTransformFeedback, + glEndTransformFeedback, + glTransformFeedbackVaryings, + glGetProgramiv +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetUniform — Returns the value of a uniform variable
+
+ void glGetUniformfv(
+ |
+ GLuint program, | +
+ | GLint location, | +
+ | GLfloat *params) ; |
+
+ void glGetUniformiv(
+ |
+ GLuint program, | +
+ | GLint location, | +
+ | GLint *params) ; |
+
+ void glGetUniformuiv(
+ |
+ GLuint program, | +
+ | GLint location, | +
+ | GLuint *params) ; |
+
program
+
+
+ Specifies the program object to be + queried.
+location
+
+
+ Specifies the location of the uniform variable + to be queried.
+params
+
+
+ Returns the value of the specified uniform + variable.
+glGetUniform
returns in
+ params
the value(s) of the specified
+ uniform variable. The type of the uniform variable specified by
+ location
determines the number of values
+ returned. If the uniform variable is defined in the shader as a
+ boolean, int, unsigned int, or float, a single value will be returned. If it
+ is defined as a vec2, ivec2, uvec2, or bvec2, two values will be
+ returned. If it is defined as a vec3, ivec3, uvec3, or bvec3, three
+ values will be returned, and so on. To query values stored in
+ uniform variables declared as arrays, call
+ glGetUniform
for each element of the array.
+ To query values stored in uniform variables declared as
+ structures, call glGetUniform
for each
+ field in the structure. The values for uniform variables
+ declared as a matrix will be returned in column major
+ order.
The locations assigned to uniform variables are not known
+ until the program object is linked. After linking has occurred,
+ the command
+ glGetUniformLocation
+ can be used to obtain the location of a uniform variable. This
+ location value can then be passed to
+ glGetUniform
in order to query the current
+ value of the uniform variable. After a program object has been
+ linked successfully, the index values for uniform variables
+ remain fixed until the next link command occurs. The uniform
+ variable values can only be queried after a link if the link was
+ successful.
If an error is generated, no change is made to the
+ contents of params
.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ program
has not been successfully
+ linked.
GL_INVALID_OPERATION
is generated if
+ location
does not correspond to a valid
+ uniform variable location for the specified program object.
glGetActiveUniform
+ with arguments program
and the index of an active
+ uniform variable
glGetProgramiv
+ with arguments program
and
+ GL_ACTIVE_UNIFORMS
or
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
glGetUniformLocation
+ with arguments program
and the name of a
+ uniform variable
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glGetUniformfv
+ |
+ ✔ | +✔ | +
+ glGetUniformiv
+ |
+ ✔ | +✔ | +
+ glGetUniformuiv
+ |
+ - | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetUniformBlockIndex — retrieve the index of a named uniform block
+
+ GLuint glGetUniformBlockIndex(
+ |
+ GLuint program, | +
+ | const GLchar *uniformBlockName) ; |
+
program
+
+
+ + Specifies the name of a program containing the uniform block. +
+uniformBlockName
+
+
+ + Specifies the address an array of characters containing the name of the uniform block whose index to retrieve. +
+
+ glGetUniformBlockIndex
retrieves the index of a uniform block within program
.
+
+ program
must be the name of a program object for which the command
+ glLinkProgram must have been called in the past, although it is not required that
+ glLinkProgram must have succeeded. The link could have failed because the number
+ of active uniforms exceeded the limit.
+
+ uniformBlockName
must contain a nul-terminated string specifying the name of the uniform block.
+
+ glGetUniformBlockIndex
returns the uniform block index for the uniform block named uniformBlockName
+ of program
. If uniformBlockName
does not identify an active uniform block of program
,
+ glGetUniformBlockIndex
returns the special identifier, GL_INVALID_INDEX
. Indices of the active uniform
+ blocks of a program are assigned in consecutive order, beginning with zero.
+
+ GL_INVALID_OPERATION
is generated if program
is not the name of a program object for which
+ glLinkProgram has been called in the past.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetUniformBlockIndex | +- | +✔ | +
+ glGetActiveUniformBlockName, + glGetActiveUniformBlockiv, + glLinkProgram +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetUniformIndices — retrieve the index of a named uniform block
+
+ void glGetUniformIndices(
+ |
+ GLuint program, | +
+ | GLsizei uniformCount, | +
+ | const GLchar **uniformNames, | +
+ | GLuint *uniformIndices) ; |
+
program
+
+
+ + Specifies the name of a program containing uniforms whose indices to query. +
+uniformCount
+
+
+ + Specifies the number of uniforms whose indices to query. +
+uniformNames
+
+
+ + Specifies the address of an array of pointers to buffers containing the names of the queried uniforms. +
+uniformIndices
+
+
+ + Specifies the address of an array that will receive the indices of the uniforms. +
+
+ glGetUniformIndices
retrieves the indices of a number of uniforms within program
.
+
+ program
must be the name of a program object for which the command
+ glLinkProgram must have been called in the past, although it is not required that
+ glLinkProgram must have succeeded. The link could have failed because the number
+ of active uniforms exceeded the limit.
+
+ uniformCount
indicates both the number of elements in the array of names uniformNames
and the
+ number of indices that may be written to uniformIndices
.
+
+ uniformNames
contains a list of uniformCount
nul-terminated name strings identifying the
+ uniform names to be queried for indices. For each name string in uniformNames
, the index assigned to the active
+ uniform of that name will be written to the corresponding element of uniformIndices
. If a string in
+ uniformNames
is not the name of an active uniform, the special value GL_INVALID_INDEX
will
+ be written to the corresponding element of uniformIndices
.
+
+ If an error occurs, nothing is written to uniformIndices
.
+
+ GL_INVALID_OPERATION
is generated if program
is not the name of a program object for which
+ glLinkProgram has been called in the past.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetUniformIndices | +- | +✔ | +
+ glGetActiveUniform, + glGetActiveUniformsiv, + glLinkProgram +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetUniformLocation — Returns the location of a uniform variable
+
+ GLint glGetUniformLocation(
+ |
+ GLuint program, | +
+ | const GLchar *name) ; |
+
program
+
+
+ Specifies the program object to be + queried.
+name
+
+
+ Points to a null terminated string containing + the name of the uniform variable whose location is + to be queried.
+glGetUniformLocation
returns an
+ integer that represents the location of a specific uniform
+ variable within a the default uniform block of a program object.
+ name
must be a null terminated string
+ that contains no white space. name
must
+ be an active uniform variable name in program
+ that is not a structure, an array of structures, or a subcomponent
+ of a vector or a matrix. This function returns -1 if
+ name
does not correspond to an active uniform variable in
+ program
or if name
+ is associated with a named uniform block.
+
Uniform variables that are structures or arrays of
+ structures may be queried by calling
+ glGetUniformLocation
for each field within
+ the structure. The array element operator "[]" and the
+ structure field operator "." may be used in
+ name
in order to select elements within
+ an array or fields within a structure. The result of using these
+ operators is not allowed to be another structure, an array of
+ structures, or a subcomponent of a vector or a matrix.
+ The first element of a uniform array is identified using the name
+ of the uniform array appended with "[0]". If the last part
+ of the string name indicates a uniform array, then the location of the
+ first element of that array can be retrieved by either using the name of
+ the array, or by using the name appended by "[0]".
+ Locations for sequential array indices are not required to be sequential. The + location for "a[1]" may or may not be equal to the location for + "a[0]" + 1. Furthermore, since unused elements at the end of uniform + arrays may be trimmed the location of the i + 1 array element may not be valid + even if the location of the i element is valid. As a direct consequence, the + value of the location of "a[0]" + 1 may refer to a different uniform + entirely. Applications that wish to set individual array elements should query + the locations of each element separately. +
+The actual locations assigned to uniform variables are not
+ known until the program object is linked successfully. After
+ linking has occurred, the command
+ glGetUniformLocation
can be used to obtain
+ the location of a uniform variable. This location value can then
+ be passed to
+ glUniform
+ to set the value of the uniform variable or to
+ glGetUniform
+ in order to query the current value of the uniform variable.
+ After a program object has been linked successfully, the index
+ values for uniform variables remain fixed until the next link
+ command occurs. Uniform variable locations and values can only
+ be queried after a link if the link was successful.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ program
has not been successfully
+ linked.
glGetActiveUniform
+ with arguments program
and the index of
+ an active uniform variable
glGetProgramiv
+ with arguments program
and
+ GL_ACTIVE_UNIFORMS
or
+ GL_ACTIVE_UNIFORM_MAX_LENGTH
glGetUniform
+ with arguments program
and the name of a
+ uniform variable
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetUniformLocation | +✔ | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetVertexAttrib — Return a generic vertex attribute parameter
+
+ void glGetVertexAttribfv(
+ |
+ GLuint index, | +
+ | GLenum pname, | +
+ | GLfloat *params) ; |
+
+ void glGetVertexAttribiv(
+ |
+ GLuint index, | +
+ | GLenum pname, | +
+ | GLint *params) ; |
+
+ void glGetVertexAttribIiv(
+ |
+ GLuint index, | +
+ | GLenum pname, | +
+ | GLint *params) ; |
+
+ void glGetVertexAttribIuiv(
+ |
+ GLuint index, | +
+ | GLenum pname, | +
+ | GLuint *params) ; |
+
index
+
+
+ Specifies the generic vertex attribute + parameter to be queried.
+pname
+
+
+ Specifies the symbolic name of the vertex
+ attribute parameter to be queried. Accepted values are
+ GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
,
+ GL_VERTEX_ATTRIB_ARRAY_ENABLED
,
+ GL_VERTEX_ATTRIB_ARRAY_SIZE
,
+ GL_VERTEX_ATTRIB_ARRAY_STRIDE
,
+ GL_VERTEX_ATTRIB_ARRAY_TYPE
,
+ GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
,
+ GL_VERTEX_ATTRIB_ARRAY_INTEGER
,
+ GL_VERTEX_ATTRIB_ARRAY_DIVISOR
, or
+ GL_CURRENT_VERTEX_ATTRIB
.
params
+
+
+ Returns the requested data.
+glGetVertexAttrib
returns in
+ params
the value of a generic vertex
+ attribute parameter. The generic vertex attribute to be queried
+ is specified by index
, and the parameter
+ to be queried is specified by pname
.
The accepted parameter names are as follows:
+GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
+
+ +
+ params
returns a
+ single value, the name of the buffer object currently bound to
+ the binding point corresponding to generic vertex attribute array
+ index
. If no buffer object is bound,
+ 0 is returned. The initial value is 0.
GL_VERTEX_ATTRIB_ARRAY_ENABLED
+
+ +
+ params
returns a
+ single value that is non-zero (true) if the vertex
+ attribute array for index
is
+ enabled and 0 (false) if it is disabled. The initial
+ value is GL_FALSE
.
GL_VERTEX_ATTRIB_ARRAY_SIZE
+
+ +
+ params
returns a
+ single value, the size of the vertex attribute array
+ for index
. The size is the
+ number of values for each element of the vertex
+ attribute array, and it will be 1, 2, 3, or 4. The
+ initial value is 4.
GL_VERTEX_ATTRIB_ARRAY_STRIDE
+
+ +
+ params
returns a
+ single value, the array stride for (number of bytes
+ between successive elements in) the vertex attribute
+ array for index
. A value of 0
+ indicates that the array elements are stored
+ sequentially in memory. The initial value is 0.
GL_VERTEX_ATTRIB_ARRAY_TYPE
+
+ +
+ params
returns a
+ single value, a symbolic constant indicating the
+ array type for the vertex attribute array for
+ index
. Possible values are
+ GL_BYTE
,
+ GL_UNSIGNED_BYTE
,
+ GL_SHORT
,
+ GL_UNSIGNED_SHORT
,
+ GL_INT
,
+ GL_INT_2_10_10_10_REV
,
+ GL_UNSIGNED_INT
,
+ GL_FIXED
,
+ GL_HALF_FLOAT
, and
+ GL_FLOAT
. The initial value is
+ GL_FLOAT
.
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
+
+ +
+ params
returns a
+ single value that is non-zero (true) if fixed-point
+ data types for the vertex attribute array indicated
+ by index
are normalized when
+ they are converted to floating point, and 0 (false)
+ otherwise. The initial value is
+ GL_FALSE
.
GL_VERTEX_ATTRIB_ARRAY_INTEGER
+
+ +
+ params
returns a
+ single value that is non-zero (true) if fixed-point
+ data types for the vertex attribute array indicated
+ by index
have integer data types, and 0 (false)
+ otherwise. The initial value is
+ 0 (GL_FALSE
).
GL_VERTEX_ATTRIB_ARRAY_DIVISOR
+
+ +
+ params
returns a
+ single value that is the frequency divisor used for instanced
+ rendering. See glVertexAttribDivisor.
+ The initial value is 0.
GL_CURRENT_VERTEX_ATTRIB
+
+ +
+ params
returns four
+ values that represent the current value for the
+ generic vertex attribute specified by index. The initial value
+ for all generic vertex attributes is (0,0,0,1).
All of the parameters except GL_CURRENT_VERTEX_ATTRIB
+ represent state stored in the currently bound vertex array object. If the zero object
+ is bound, these values are client state.
If an error is generated, no change is made to the
+ contents of params
.
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to
+ GL_MAX_VERTEX_ATTRIBS
.
GL_INVALID_ENUM
is generated if
+ pname
is not an accepted value.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttribPointerv
+ with arguments index
and
+ GL_VERTEX_ATTRIB_ARRAY_POINTER
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glGetVertexAttribfv
+ |
+ ✔ | +✔ | +
+ glGetVertexAttribiv
+ |
+ ✔ | +✔ | +
+ glGetVertexAttribIiv
+ |
+ - | +✔ | +
+ glGetVertexAttribIuiv
+ |
+ - | +✔ | +
glBindAttribLocation, + glBindBuffer, + glDisableVertexAttribArray, + glEnableVertexAttribArray, + glVertexAttrib, + glVertexAttribDivisor, + glVertexAttribPointer
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glGetVertexAttribPointerv — return the address of the specified generic vertex attribute pointer
+
+ void glGetVertexAttribPointerv(
+ |
+ GLuint index, | +
+ | GLenum pname, | +
+ | GLvoid **pointer) ; |
+
index
+
+
+ Specifies the generic vertex attribute + parameter to be returned.
+pname
+
+
+ Specifies the symbolic name of the generic
+ vertex attribute parameter to be returned. Must be
+ GL_VERTEX_ATTRIB_ARRAY_POINTER
.
pointer
+
+
+ Returns the pointer value.
+glGetVertexAttribPointerv
returns
+ pointer information. index
is the generic
+ vertex attribute to be queried, pname
is
+ a symbolic constant indicating the pointer to be returned, and
+ params
is a pointer to a location in
+ which to place the returned data.
The pointer
returned is a byte offset into the data store of the buffer object
+ that was bound to the GL_ARRAY_BUFFER
target
+ (see glBindBuffer) when the desired pointer was previously specified.
+
The state returned is retrieved from the currently bound vertex array object. If the zero object is bound, + the value is queried from client state.
+The initial value for each pointer is 0.
+GL_INVALID_VALUE
+ is generated if index
+ is greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
GL_INVALID_ENUM
+ is generated if pname
+ is not an accepted value.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glGetVertexAttribPointerv | +✔ | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glHint — specify implementation-specific hints
+
+ void glHint(
+ |
+ GLenum target, | +
+ | GLenum mode) ; |
+
target
+
+
+
+ Specifies a symbolic constant indicating the behavior to be controlled.
+ GL_FRAGMENT_SHADER_DERIVATIVE_HINT
, and
+ GL_GENERATE_MIPMAP_HINT
+ are accepted.
+
mode
+
+
+
+ Specifies a symbolic constant indicating the desired behavior.
+ GL_FASTEST
,
+ GL_NICEST
, and
+ GL_DONT_CARE
are accepted.
+
+ Certain aspects of GL behavior,
+ when there is room for interpretation,
+ can be controlled with hints.
+ A hint is specified with two arguments.
+ target
is a symbolic
+ constant indicating the behavior to be controlled,
+ and mode
is another symbolic constant indicating the desired
+ behavior. The initial value for each target
is GL_DONT_CARE
.
+ mode
can be one of the following:
+
GL_FASTEST
+
+ +
++ The most efficient option should be chosen. +
+GL_NICEST
+
+ +
++ The most correct, + or highest quality, + option should be chosen. +
+GL_DONT_CARE
+
+ +
++ No preference. +
+
+ Though the implementation aspects that can be hinted are well defined,
+ the interpretation of the hints depends on the implementation.
+ The hint aspects that can be specified with target
,
+ along with suggested semantics,
+ are as follows:
+
GL_FRAGMENT_SHADER_DERIVATIVE_HINT
+
+ +
+
+ Indicates the accuracy of the derivative calculation for the GL shading language fragment processing built-in functions:
+ dFdx
, dFdy
, and fwidth
.
+
GL_GENERATE_MIPMAP_HINT
+
+ + Indicates the quality of filtering when generating mipmap images with + glGenerateMipmap. +
+
+ The interpretation of hints depends on the implementation.
+ Some implementations ignore glHint
settings.
+
+ GL_INVALID_ENUM
is generated if either target
or mode
is not
+ an accepted value.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glHint | +✔ | +✔ | +
+ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glInvalidateFramebuffer — Invalidate the contents of attachments within a framebuffer
+
+ void glInvalidateFramebuffer(
+ |
+ GLenum target, | +
+ | GLsizei numAttachments, | +
+ | const GLenum *attachments) ; |
+
target
+
+
+
+ Specifies the target of the invalidate operation. Must be GL_FRAMEBUFFER
.
+
numAttachments
+
+
+
+ Specifies how many attachments are supplied in the attachments
list.
+
attachments
+
+
+
+ A list of numAttachments
attachments to invalidate.
+
+ glInvalidateFramebuffer
signals to the GL
+ that it need not preserve all pixels of a bound framebuffer
+ object. attachments
contains a list of
+ numAttachments
to be invalidated. If an
+ attachment is specified that does not exist in the bound
+ framebuffer, it is ignored.
+
+ If a framebuffer object is bound, then
+ attachments
may contain
+ GL_COLOR_ATTACHMENTi
,
+ GL_DEPTH_ATTACHMENT
,
+ GL_STENCIL_ATTACHMENT
, and/or
+ GL_DEPTH_STENCIL_ATTACHMENT
. If the
+ framebuffer object is not complete,
+ glInvalidateFramebuffer
may be ignored.
+
+ If the default framebuffer is bound, then
+ attachments
may contain
+ GL_COLOR
, identifying the color buffer;
+ GL_DEPTH
, identifying the depth buffer;
+ and/or GL_STENCIL
, identifying the stencil
+ buffer.
+
+ The intention of this function is to provide a hint to the GL + implementation that there is no longer a need to preserve the + contents of particular attachments of a framebuffer object, or + the default framebuffer. It is possible, for example, to signal + the intention that depth and or stencil data is no longer needed + at the end of a scene, or that multisample color buffer data is + no longer needed after a resolve through + glBlitFramebuffer. +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_FRAMEBUFFER
.
+
+ GL_INVALID_OPERATION
is generated if
+ attachments
contains
+ GL_COLOR_ATTACHMENTm
and m is greater than
+ or equal to the value of
+ GL_MAX_COLOR_ATTACHMENTS
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glInvalidateFramebuffer | +- | +✔ | +
+ glBindFramebuffer, + glBlitFramebuffer + glFramebufferRenderbuffer, + glFramebufferTexture2D, + glFramebufferTextureLayer, + glInvalidateSubFramebuffer +
++ Copyright © 2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glInvalidateSubFramebuffer — Invalidate portions of the contents of attachments within a framebuffer
+
+ void glInvalidateSubFramebuffer(
+ |
+ GLenum target, | +
+ | GLsizei numAttachments, | +
+ | const GLenum *attachments, | +
+ | GLintx, | +
+ | GLinty, | +
+ | GLsizei width, | +
+ | GLsizei height) ; |
+
target
+
+
+
+ Specifies the target of the invalidate operation. Must be GL_FRAMEBUFFER
.
+
numAttachments
+
+
+
+ Specifies how many attachments are supplied in the attachments
list.
+
attachments
+
+
+
+ A list of numAttachments
attachments to invalidate.
+
x
+
+
+ + Specifies the left origin of the pixel rectangle to invalidate, with lower left hand corner at (0,0). +
+y
+
+
+ + Specifies the bottom origin of the pixel rectangle to invalidate, with lower left hand corner at (0,0). +
+width
+
+
+ + Specifies the width of the pixel rectangle to invalidate. +
+height
+
+
+ + Specifies the height of the pixel rectangle to invalidate. +
+
+ glInvalidateSubFramebuffer
signals to the
+ GL that it need not preserve all pixels of a specified region of
+ a bound framebuffer object. attachments
+ contains a list of numAttachments
to be
+ invalidated. If an attachment is specified that does not exist
+ in the bound framebuffer, it is ignored.
+ x
, y
,
+ width
and height
+ specify the bounds of the pixel rectangle to invalidate. Any of
+ these pixels lying outside of the window allocated to the
+ current GL context, or outside of the image attached to the
+ currently bound framebuffer object, are ignored.
+
+ If a framebuffer object is bound, then
+ attachments
may contain
+ GL_COLOR_ATTACHMENTi
,
+ GL_DEPTH_ATTACHMENT
,
+ GL_STENCIL_ATTACHMENT
, and/or
+ GL_DEPTH_STENCIL_ATTACHMENT
. If the
+ framebuffer object is not complete,
+ glInvalidateSubFramebuffer
may be ignored.
+
+ If the default framebuffer is bound, then
+ attachments
may contain
+ GL_COLOR
, identifying the color buffer;
+ GL_DEPTH
, identifying the depth buffer;
+ and/or GL_STENCIL
, identifying the stencil
+ buffer.
+
+ The intention of this function is to provide a hint to the GL + implementation that there is no longer a need to preserve the + contents of particular attachments of a framebuffer object, or + the default framebuffer. It is possible, for example, to signal + the intention that depth and or stencil data is no longer needed + at the end of a scene, or that multisample color buffer data is + no longer needed after a resolve through + glBlitFramebuffer. +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_FRAMEBUFFER
.
+
+ GL_INVALID_OPERATION
is generated if
+ attachments
contains
+ GL_COLOR_ATTACHMENTm
and m is greater than
+ or equal to the value of
+ GL_MAX_COLOR_ATTACHMENTS
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glInvalidateSubFramebuffer | +- | +✔ | +
+ glBindFramebuffer, + glBlitFramebuffer + glFramebufferRenderbuffer, + glFramebufferTexture2D, + glFramebufferTextureLayer, + glInvalidateFramebuffer +
++ Copyright © 2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsBuffer — determine if a name corresponds to a buffer object
+
+ GLboolean glIsBuffer(
+ |
+ GLuint buffer) ; |
+
buffer
+
+
+ + Specifies a value that may be the name of a buffer object. +
+
+ glIsBuffer
returns GL_TRUE
if buffer
is currently the name of a buffer object.
+ If buffer
is zero, or is a non-zero value that is not currently the
+ name of a buffer object, or if an error occurs, glIsBuffer
returns GL_FALSE
.
+
+ A name returned by glGenBuffers, but not yet associated with a buffer object + by calling glBindBuffer, is not the name of a buffer object. +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsBuffer | +✔ | +✔ | +
+ glBindBuffer, + glDeleteBuffers, + glGenBuffers, + glGet +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsEnabled — test whether a capability is enabled
+
+ GLboolean glIsEnabled(
+ |
+ GLenum cap) ; |
+
cap
+
+
+ + Specifies a symbolic constant indicating a GL capability. +
+index
+
+
+ + Specifies the index of the capability. +
+
+ glIsEnabled
returns GL_TRUE
if cap
is an enabled capability
+ and returns GL_FALSE
otherwise. Initially all capabilities except GL_DITHER
are disabled;
+ GL_DITHER
is initially enabled.
+
+ The following capabilities are accepted for cap
:
+
+
++ Constant + | ++ See + | +
---|---|
+ GL_BLEND
+ |
+ + glBlendFunc + | +
+ GL_CULL_FACE
+ |
+ + glCullFace + | +
+ GL_DEPTH_TEST
+ |
+ + glDepthFunc, glDepthRangef + | +
+ GL_DITHER
+ |
+ + glEnable + | +
+ GL_POLYGON_OFFSET_FILL
+ |
+ + glPolygonOffset + | +
+ GL_PRIMITIVE_RESTART_FIXED_INDEX
+ |
+ + glEnable + | +
+ GL_RASTERIZER_DISCARD
+ |
+ + glEnable + | +
+ GL_SAMPLE_ALPHA_TO_COVERAGE
+ |
+ + glSampleCoverage + | +
+ GL_SAMPLE_COVERAGE
+ |
+ + glSampleCoverage + | +
+ GL_SCISSOR_TEST
+ |
+ + glScissor + | +
+ GL_STENCIL_TEST
+ |
+ + glStencilFunc, glStencilOp + | +
+
+
+ If an error is generated,
+ glIsEnabled
returns GL_FALSE
.
+
+ GL_INVALID_ENUM
is generated if cap
is not an accepted value.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsEnabled | +✔ | +✔ | +
+ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glIsFramebuffer — determine if a name corresponds to a framebuffer object
+
+ GLboolean glIsFramebuffer(
+ |
+ GLuint framebuffer) ; |
+
framebuffer
+
+
+ + Specifies a value that may be the name of a framebuffer object. +
+
+ glIsFramebuffer
returns GL_TRUE
if framebuffer
is currently the name of a framebuffer
+ object. If framebuffer
is zero, or if framebuffer
is not the name of a framebuffer object, or if an error
+ occurs, glIsFramebuffer
returns GL_FALSE
. If framebuffer
is a name returned by
+ glGenFramebuffers, by that has not yet been bound through a call to
+ glBindFramebuffer, then the name is not a framebuffer object and glIsFramebuffer
+ returns GL_FALSE
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsFramebuffer | +✔ | +✔ | +
+ glGenFramebuffers, + glBindFramebuffer, + glDeleteFramebuffers +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsProgram — Determines if a name corresponds to a program object
+
+ GLboolean glIsProgram(
+ |
+ GLuint program) ; |
+
program
+
+
+ Specifies a potential program object.
+glIsProgram
returns
+ GL_TRUE
if program
+ is the name of a program object previously created with
+ glCreateProgram
+ and not yet deleted with glDeleteProgram.
+ If program
is zero or a non-zero value that
+ is not the name of a program object, or if an error occurs,
+ glIsProgram
returns GL_FALSE
.
No error is generated if program
is
+ not a valid program object name.
A program object marked for deletion with glDeleteProgram
+ but still in use as part of current rendering state is still considered
+ a program object and glIsProgram
will return GL_TRUE
.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib
+ with arguments program
and the index of
+ an active attribute variable
glGetActiveUniform
+ with arguments program
and the index of
+ an active uniform variable
glGetAttachedShaders
+ with argument program
glGetAttribLocation
+ with arguments program
and the name of an
+ attribute variable
glGetProgramiv
+ with arguments program
and the parameter
+ to be queried
glGetProgramInfoLog
+ with argument program
glGetUniform
+ with arguments program
and the location
+ of a uniform variable
glGetUniformLocation
+ with arguments program
and the name of a
+ uniform variable
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsProgram | +✔ | +✔ | +
glAttachShader, + glBindAttribLocation, + glCreateProgram, + glDeleteProgram, + glDetachShader, + glLinkProgram, + glUniform, + glUseProgram, + glValidateProgram
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsQuery — determine if a name corresponds to a query object
+
+ GLboolean glIsQuery(
+ |
+ GLuint id) ; |
+
id
+
+
+ + Specifies a value that may be the name of a query object. +
+
+ glIsQuery
returns GL_TRUE
if id
is currently the name of a query object.
+ If id
is zero, or is a non-zero value that is not currently the
+ name of a query object, or if an error occurs, glIsQuery
returns GL_FALSE
.
+
+ A name returned by glGenQueries, but not yet associated with a query object + by calling glBeginQuery, is not the name of a query object. +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsQuery | +- | +✔ | +
+ glBeginQuery, + glDeleteQueries, + glEndQuery, + glGenQueries +
++ Copyright © 2005 Addison-Wesley. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsRenderbuffer — determine if a name corresponds to a renderbuffer object
+
+ GLboolean glIsRenderbuffer(
+ |
+ GLuint renderbuffer) ; |
+
renderbuffer
+
+
+ + Specifies a value that may be the name of a renderbuffer object. +
+
+ glIsRenderbuffer
returns GL_TRUE
if renderbuffer
is currently the name of a renderbuffer
+ object. If renderbuffer
is zero, or if renderbuffer
is not the name of a renderbuffer object, or if an error
+ occurs, glIsRenderbuffer
returns GL_FALSE
. If renderbuffer
is a name returned by
+ glGenRenderbuffers, by that has not yet been bound through a call to
+ glBindRenderbuffer or glFramebufferRenderbuffer,
+ then the name is not a renderbuffer object and glIsRenderbuffer
returns GL_FALSE
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsRenderbuffer | +✔ | +✔ | +
+ glGenRenderbuffers, + glBindRenderbuffer, + glFramebufferRenderbuffer, + glDeleteRenderbuffers +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsSampler — determine if a name corresponds to a sampler object
+
+ GLboolean glIsSampler(
+ |
+ GLuint id) ; |
+
id
+
+
+ + Specifies a value that may be the name of a sampler object. +
+
+ glIsSampler
returns GL_TRUE
if id
is currently the name of a sampler object.
+ If id
is zero, or is a non-zero value that is not currently the
+ name of a sampler object, or if an error occurs, glIsSampler
returns GL_FALSE
.
+
+ A name returned by glGenSamplers, is the name of a sampler object. +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsSampler | +- | +✔ | +
+ glGenSamplers, + glBindSampler, + glDeleteSamplers +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsShader — Determines if a name corresponds to a shader object
+
+ GLboolean glIsShader(
+ |
+ GLuint shader) ; |
+
shader
+
+
+ Specifies a potential shader object.
+glIsShader
returns
+ GL_TRUE
if shader
is
+ the name of a shader object previously created with
+ glCreateShader
+ and not yet deleted with glDeleteShader.
+ If shader
is
+ zero or a non-zero value that is not the name of a shader
+ object, or if an error occurs, glIsShader
returns
+ GL_FALSE
.
No error is generated if shader
is
+ not a valid shader object name.
A shader object marked for deletion with glDeleteShader
+ but still attached to a program object is still considered
+ a shader object and glIsShader
will return GL_TRUE
.
glGetAttachedShaders + with a valid program object
+glGetShaderiv
+ with arguments shader
and a parameter to
+ be queried
glGetShaderInfoLog
+ with argument object
glGetShaderSource
+ with argument object
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsShader | +✔ | +✔ | +
glAttachShader, + glCompileShader, + glCreateShader, + glDeleteShader, + glDetachShader, + glLinkProgram, + glShaderSource
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsSync — determine if a name corresponds to a sync object
+
+ GLboolean glIsSync(
+ |
+ GLsync sync) ; |
+
sync
+
+
+ + Specifies a value that may be the name of a sync object. +
+
+ glIsSync
returns GL_TRUE
if sync
is currently the name of a sync object.
+ If sync
is not the name of a sync object, or if an error occurs, glIsSync
returns
+ GL_FALSE
. Note that zero is not the name of a sync object.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsSync | +- | +✔ | +
+ glFenceSync, + glWaitSync, + glClientWaitSync, + glDeleteSync +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsTexture — determine if a name corresponds to a texture
+
+ GLboolean glIsTexture(
+ |
+ GLuint texture) ; |
+
texture
+
+
+ + Specifies a value that may be the name of a texture. +
+
+ glIsTexture
returns GL_TRUE
if texture
is currently the name of a texture.
+ If texture
is zero, or is a non-zero value that is not currently the
+ name of a texture, or if an error occurs, glIsTexture
returns GL_FALSE
.
+
+ A name returned by glGenTextures, but not yet associated with a texture + by calling glBindTexture, is not the name of a texture. +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsTexture | +✔ | +✔ | +
+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glGenTextures, + glGet, + glGetTexParameter, + glTexImage2D, + glTexImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glIsTransformFeedback — determine if a name corresponds to a transform feedback object
+
+ GLboolean glIsTransformFeedback(
+ |
+ GLuint id) ; |
+
id
+
+
+ + Specifies a value that may be the name of a transform feedback object. +
+
+ glIsTransformFeedback
returns GL_TRUE
if id
is currently the name of a transform feedback
+ object. If id
is zero, or if id
is not the name of a transform feedback object, or if an error
+ occurs, glIsTransformFeedback
returns GL_FALSE
. If id
is a name returned by
+ glGenTransformFeedbacks, but that has not yet been bound through a call to
+ glBindTransformFeedback, then the name is not a transform feedback object and glIsTransformFeedback
+ returns GL_FALSE
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsTransformFeedback | +- | +✔ | +
+ glGenTransformFeedbacks, + glBindTransformFeedback, + glDeleteTransformFeedbacks +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glIsVertexArray — determine if a name corresponds to a vertex array object
+
+ GLboolean glIsVertexArray(
+ |
+ GLuint array) ; |
+
array
+
+
+ + Specifies a value that may be the name of a vertex array object. +
+
+ glIsVertexArray
returns GL_TRUE
if array
is currently the name of a vertex array
+ object. If array
is zero, or if array
is not the name of a vertex array object, or if an error
+ occurs, glIsVertexArray
returns GL_FALSE
. If array
is a name returned by
+ glGenVertexArrays, by that has not yet been bound through a call to
+ glBindVertexArray, then the name is not a vertex array object and
+ glIsVertexArray
returns GL_FALSE
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glIsVertexArray | +- | +✔ | +
+ glGenVertexArrays, + glBindVertexArray, + glDeleteVertexArrays +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glLineWidth — specify the width of rasterized lines
+
+ void glLineWidth(
+ |
+ GLfloat width) ; |
+
width
+
+
+ + Specifies the width of rasterized lines. + The initial value is 1. +
+
+ glLineWidth
specifies the rasterized width of
+ lines.
+
+ The actual width is determined by rounding the supplied width
+ to the nearest integer.
+ (If the rounding results in the value 0,
+ it is as if the line width were 1.)
+ If
+ width
.
+ Otherwise,
+ i pixels are filled in each row that is rasterized.
+
+ There is a range of supported line widths. Only width 1 is guaranteed to be supported; others depend on the
+ implementation.
+ To query the range of supported widths, call glGet
+ with argument GL_ALIASED_LINE_WIDTH_RANGE
.
+
+ The line width specified by glLineWidth
is always returned when GL_LINE_WIDTH
+ is queried.
+ Clamping and rounding have no effect on the specified value.
+
+ Line width may be clamped to an implementation-dependent maximum. Call glGet with GL_ALIASED_LINE_WIDTH_RANGE
to determine the maximum width.
+
+ GL_INVALID_VALUE
is generated if width
is less than or equal to 0.
+
+ glGet with argument GL_LINE_WIDTH
+
+ glGet with argument GL_ALIASED_LINE_WIDTH_RANGE
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glLineWidth | +✔ | +✔ | +
+ glEnable +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glLinkProgram — Links a program object
+
+ void glLinkProgram(
+ |
+ GLuint program) ; |
+
program
+
+
+ Specifies the handle of the program object to be linked.
+glLinkProgram
links the program
+ object specified by program
. Shader objects
+ of type GL_VERTEX_SHADER
attached to
+ program
are used to
+ create an executable that will run on the programmable vertex
+ processor. Shader objects of type GL_FRAGMENT_SHADER
+ attached to program
are used to create an
+ executable that will run on the programmable fragment
+ processor.
The status of the link operation will be stored as part of
+ the program object's state. This value will be set to
+ GL_TRUE
if the program object was linked
+ without errors and is ready for use, and
+ GL_FALSE
otherwise. It can be queried by
+ calling
+ glGetProgramiv
+ with arguments program
and
+ GL_LINK_STATUS
.
As a result of a successful link operation, all active
+ user-defined uniform variables belonging to
+ program
will be initialized to 0, and
+ each of the program object's active uniform variables will be
+ assigned a location that can be queried by calling
+ glGetUniformLocation.
+ All active uniforms belonging to the program’s named uniform blocks are
+ assigned offsets (and strides for array and matrix type uniforms) within
+ the uniform block. Also, any active user-defined attribute variables that have not
+ been bound to a generic vertex attribute index will be bound to
+ one at this time.
Linking of a program object can fail for a number of + reasons as specified in the OpenGL ES Shading Language + Specification. The following lists some of the + conditions that will cause a link error.
+A vertex shader and a fragment shader are not both + present in the program object.
+The vertex and fragment shader do not use the same + shader language version.
+The number of active attribute variables supported + by the implementation has been exceeded.
+The storage limit for uniform variables has been + exceeded.
+The number of active uniform variables supported + by the implementation has been exceeded.
+The main
function is missing
+ for the vertex or fragment shader.
A varying variable actually used in the fragment + shader is not declared in the same way (or is not + declared at all) in the vertex shader.
+A reference to a function or variable name is + unresolved.
+A shared global is declared with two different + types or two different initial values.
+One or more of the attached shader objects has not + been successfully compiled (via glCompileShader) + or loaded with a pre-compiled shader binary + (via glShaderBinary).
+Binding a generic attribute matrix caused some
+ rows of the matrix to fall outside the allowed maximum
+ of GL_MAX_VERTEX_ATTRIBS
.
Not enough contiguous vertex attribute slots could + be found to bind attribute matrices.
+Any variable name specified to glTransformFeedbackVaryings
+ in the varyings
array is not declared as an output in the vertex shader.
Any two entries in the varyings
array given
+ glTransformFeedbackVaryings
+ specify the same varying variable.
The total number of components to capture in any transform feedback varying variable
+ is greater than the constant GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
+ and the buffer mode is GL_SEPARATE_ATTRIBS
.
The total number of components to capture in any transform feedback varying variable
+ is greater than the constant GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS
+ and the buffer mode is GL_INTERLEAVED_ATTRIBS
.
When a program object has been successfully linked, the + program object can be made part of current state by calling + glUseProgram. + Whether or not the link operation was successful, the program + object's information log will be overwritten. The information + log can be retrieved by calling + glGetProgramInfoLog.
+glLinkProgram
will also install the
+ generated executables as part of the current rendering state if
+ the link operation was successful and the specified program
+ object is already currently in use as a result of a previous
+ call to
+ glUseProgram.
+ If the program object currently in use is relinked
+ unsuccessfully, its link status will be set to
+ GL_FALSE
, but the executables and
+ associated state will remain part of the current state until a
+ subsequent call to glUseProgram
removes it
+ from use. After it is removed from use, it cannot be made part
+ of current state until it has been successfully relinked.
The program object's information log is updated and the + program is generated at the time of the link operation. After + the link operation, applications are free to modify attached + shader objects, compile attached shader objects, detach shader + objects, delete shader objects, and attach additional shader + objects. None of these operations affects the information log or + the program that is part of the program object.
+If the link operation is unsuccessful, any information about a previous link operation on program
+ is lost (i.e., a failed link does not restore the old state of program
+ ). Certain information can still be retrieved from program
+ even after an unsuccessful link operation. See for instance glGetActiveAttrib
+ and glGetActiveUniform.
GL_INVALID_VALUE
+ is generated if program
+ is not a value generated by OpenGL.
GL_INVALID_OPERATION
+ is generated if program
+ is not a program object.
GL_INVALID_OPERATION
+ is generated if program
is the currently active program
+ object and transform feedback mode is active.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib
+ with argument program
+ and the index of an active attribute variable
glGetActiveUniform
+ with argument program
+ and the index of an active uniform variable
glGetActiveUniformBlockiv
+ with argument program
+ and the index of an active uniform block
glGetAttachedShaders
+ with argument program
glGetAttribLocation
+ with argument program
+ and an attribute variable name
glGetProgramiv
+ with arguments program
+ and GL_LINK_STATUS
glGetProgramInfoLog
+ with argument program
glGetUniform
+ with argument program
+ and a uniform variable location
glGetUniformLocation
+ with argument program
+ and a uniform variable name
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glLinkProgram | +✔ | +✔ | +
glAttachShader, + glBindAttribLocation, + glCompileShader, + glCreateProgram, + glDeleteProgram, + glDetachShader, + glUniform, + glUseProgram, + glValidateProgram
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glMapBufferRange — map a section of a buffer object's data store
+
+ void *glMapBufferRange(
+ |
+ GLenum target, | +
+ | GLintptr offset, | +
+ | GLsizeiptr length, | +
+ | GLbitfield access) ; |
+
+ GLboolean glUnmapBuffer(
+ |
+ GLenum target) ; |
+
glMapBufferRange
target
+
+
+ + Specifies a binding to which the target buffer is bound. +
+offset
+
+
+ + Specifies the starting offset within the buffer of the range to be mapped. +
+length
+
+
+ + Specifies the length of the range to be mapped. +
+access
+
+
+ + Specifies a combination of access flags indicating the desired access to the range. +
+glUnmapBuffer
target
+
+
+ + Specifies a binding to which the target buffer is bound. +
+
+ glMapBufferRange
maps all or part of the data store of a buffer object into the client's address
+ space. target
specifies the target to which the buffer is bound and must be one of GL_ARRAY_BUFFER
,
+ GL_COPY_READ_BUFFER
, GL_COPY_WRITE_BUFFER
, GL_ELEMENT_ARRAY_BUFFER
,
+ GL_PIXEL_PACK_BUFFER
, GL_PIXEL_UNPACK_BUFFER
,
+ GL_TRANSFORM_FEEDBACK_BUFFER
, or GL_UNIFORM_BUFFER
. offset
and
+ length
indicate the range of data in the buffer object that is to be mapped, in terms of basic machine units.
+ access
is a bitfield containing flags which describe the requested mapping. These flags are described below.
+
+ If no error occurs, a pointer to the beginning of the mapped range is returned once all pending operations on that buffer have
+ completed, and may be used to modify and/or query the corresponding range of the buffer, according to the following flag bits set
+ in access
:
+
+ GL_MAP_READ_BIT
indicates that the returned pointer may be used to read
+ buffer object data. No GL error is generated if the pointer is used to query
+ a mapping which excludes this flag, but the result is undefined and system
+ errors (possibly including program termination) may occur.
+
+ GL_MAP_WRITE_BIT
indicates that the returned pointer may be used to modify
+ buffer object data. No GL error is generated if the pointer is used to modify
+ a mapping which excludes this flag, but the result is undefined and system
+ errors (possibly including program termination) may occur.
+
+
+
+ Furthermore, the following optional flag bits in access
may be used to modify the mapping:
+
+ GL_MAP_INVALIDATE_RANGE_BIT
indicates that the previous contents of the
+ specified range may be discarded. Data within this range are undefined with
+ the exception of subsequently written data. No GL error is generated if subsequent
+ GL operations access unwritten data, but the result is undefined and
+ system errors (possibly including program termination) may occur. This flag
+ may not be used in combination with GL_MAP_READ_BIT
.
+
+ GL_MAP_INVALIDATE_BUFFER_BIT
indicates that the previous contents of the
+ entire buffer may be discarded. Data within the entire buffer are undefined
+ with the exception of subsequently written data. No GL error is generated if
+ subsequent GL operations access unwritten data, but the result is undefined
+ and system errors (possibly including program termination) may occur. This
+ flag may not be used in combination with GL_MAP_READ_BIT
.
+
+ GL_MAP_FLUSH_EXPLICIT_BIT
indicates that one or more discrete subranges
+ of the mapping may be modified. When this flag is set, modifications to
+ each subrange must be explicitly flushed by calling glFlushMappedBufferRange.
+ No GL error is set if a subrange of the mapping is modified and
+ not flushed, but data within the corresponding subrange of the buffer are undefined.
+ This flag may only be used in conjunction with GL_MAP_WRITE_BIT
.
+ When this option is selected, flushing is strictly limited to regions that are
+ explicitly indicated with calls to glFlushMappedBufferRange
+ prior to unmap; if this option is not selected glUnmapBuffer
+ will automatically flush the entire mapped range when called.
+
+ GL_MAP_UNSYNCHRONIZED_BIT
indicates that the GL should not attempt to
+ synchronize pending operations on the buffer prior to returning from glMapBufferRange
.
+ No GL error is generated if pending operations which source or modify the buffer overlap the mapped region,
+ but the result of such previous and any subsequent operations is undefined.
+
+
+
+ If an error occurs, glMapBufferRange
returns a NULL
pointer.
+
+ A mapped data store must be unmapped with glUnmapBuffer
before its buffer object is used.
+ Otherwise an error will be generated by any GL command that attempts to dereference the buffer object's data store.
+ When a data store is unmapped, the pointer to its data store becomes invalid. glUnmapBuffer
+ returns GL_TRUE
unless the data store contents have become corrupt during the time
+ the data store was mapped. This can occur for system-specific reasons that affect the availability of graphics
+ memory, such as screen mode changes. In such situations, GL_FALSE
is returned and the
+ data store contents are undefined. An application must detect this rare condition and reinitialize the data store.
+
+ A buffer object's mapped data store is automatically unmapped when the buffer object is deleted or its data store
+ is recreated with glBufferData
.
+
+ Mappings to the data stores of buffer objects may have nonstandard performance characteristics.
+ For example, such mappings may be marked as uncacheable regions of memory, and in such cases reading from them may be very slow.
+ To ensure optimal performance, the client should use the mapping in a fashion consistent
+ with the values of GL_BUFFER_USAGE
and access
.
+ Using a mapping in a fashion inconsistent with these values is liable to be multiple orders of magnitude slower
+ than using normal memory.
+
+ GL_INVALID_VALUE
is generated if either of offset
or length
is negative,
+ or if offset
+ length
is greater than the value of GL_BUFFER_SIZE
.
+
+ GL_INVALID_VALUE
is generated if access
has any bits set other than those defined above.
+
+ GL_INVALID_OPERATION
is generated for any of the following conditions:
+
+ The buffer is already in a mapped state. +
+
+ Neither GL_MAP_READ_BIT
or GL_MAP_WRITE_BIT
is set.
+
+ GL_MAP_READ_BIT
is set and any of GL_MAP_INVALIDATE_RANGE_BIT
,
+ GL_MAP_INVALIDATE_BUFFER_BIT
, or GL_MAP_UNSYNCHRONIZED_BIT
is set.
+
+ GL_MAP_FLUSH_EXPLICIT_BIT
is set and GL_MAP_WRITE_BIT
is not set.
+
+
+
+ GL_OUT_OF_MEMORY
is generated if glMapBufferRange
fails because memory for the
+ mapping could not be obtained.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glMapBufferRange
+ |
+ - | +✔ | +
+ glUnmapBuffer
+ |
+ - | +✔ | +
+ glBindBuffer + glFlushMappedBufferRange, + glUnmapBuffer, +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glPauseTransformFeedback — pause transform feedback operations
+
+ void glPauseTransformFeedback(
+ |
+ void) ; |
+
+ glPauseTransformFeedback
pauses transform feedback operations on the currently active transform feedback
+ object. When transform feedback operations are paused, transform feedback is still considered active and changing most
+ transform feedback state related to the object results in an error. However, a new transform feedback object may be bound
+ while transform feedback is paused.
+
+ GL_INVALID_OPERATION
is generated if the currently bound transform feedback object is not active or is paused.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glPauseTransformFeedback | +- | +✔ | +
+ glGenTransformFeedbacks, + glBindTransformFeedback, + glBeginTransformFeedback, + glResumeTransformFeedback, + glEndTransformFeedback, + glDeleteTransformFeedbacks +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glPixelStorei — set pixel storage modes
+
+ void glPixelStorei(
+ |
+ GLenum pname, | +
+ | GLint param) ; |
+
pname
+
+
+
+ Specifies the symbolic name of the parameter to be set.
+ Six values affect the packing of pixel data into memory:
+ GL_PACK_ROW_LENGTH
,
+ GL_PACK_IMAGE_HEIGHT
,
+ GL_PACK_SKIP_PIXELS
,
+ GL_PACK_SKIP_ROWS
,
+ GL_PACK_SKIP_IMAGES
, and
+ GL_PACK_ALIGNMENT
.
+ Six more affect the unpacking of pixel data from memory:
+ GL_UNPACK_ROW_LENGTH
,
+ GL_UNPACK_IMAGE_HEIGHT
,
+ GL_UNPACK_SKIP_PIXELS
,
+ GL_UNPACK_SKIP_ROWS
,
+ GL_UNPACK_SKIP_IMAGES
, and
+ GL_UNPACK_ALIGNMENT
.
+
param
+
+
+
+ Specifies the value that pname
is set to.
+
+ glPixelStorei
sets pixel storage modes that affect the operation of subsequent
+ glReadPixels as well as the unpacking of
+ texture patterns (see glTexImage2D,
+ glTexImage3D,
+ glTexSubImage2D,
+ glTexSubImage3D).
+
+ pname
is a symbolic constant indicating the parameter to be set, and
+ param
is the new value. Six of the twelve storage parameters affect
+ how pixel data is returned to client memory.
+ They are as follows:
+
GL_PACK_ROW_LENGTH
+
+
+ If greater than 0,
+ GL_PACK_ROW_LENGTH
defines the number of pixels in a row.
+ If the first pixel of a row is placed at location
+
+ in memory,
+ then the location of the first pixel of the next row is obtained by skipping
+
+
++
+
+ components or indices,
+ where
+
+ is the number of components or indices in a pixel,
+
+ is the number of pixels in a row
+ (GL_PACK_ROW_LENGTH
if it is greater than 0,
+ the
+
+ argument to the pixel routine otherwise),
+
+ is the value of GL_PACK_ALIGNMENT
, and
+
+ is the size, in bytes, of a single component
+ (if
+ ,
+ then it is as if
+ ).
+ In the case of 1-bit values,
+ the location of the next row is obtained by skipping
+
+ +
++ components or indices. +
+
+ The word component in this description refers to the nonindex values
+ red,
+ green,
+ blue,
+ alpha,
+ and depth.
+ Storage format GL_RGB
,
+ for example,
+ has three components per pixel:
+ first red,
+ then green,
+ and finally blue.
+
GL_PACK_IMAGE_HEIGHT
+
+
+ If greater than 0,
+ GL_PACK_IMAGE_HEIGHT
defines the number of pixels in an image
+ three-dimensional texture volume, where ``image'' is defined by all pixels
+ sharing the same third dimension index.
+ If the first pixel of a row is placed at location
+
+ in memory,
+ then the location of the first pixel of the next row is obtained by skipping
+
+
++
+
+ components or indices, where
+
+ is the number of components or indices
+ in a pixel,
+
+ is the number of pixels in a row
+ (GL_PACK_ROW_LENGTH
if it is greater than 0, the
+
+ argument to glTexImage3D otherwise),
+
+ is the number of
+ rows in a pixel image (GL_PACK_IMAGE_HEIGHT
if it is greater than
+ 0, the
+
+ argument to the glTexImage3D routine otherwise),
+
+ is the value of
+ GL_PACK_ALIGNMENT
, and
+
+ is the size, in bytes, of a single
+ component (if
+ ,
+ then it is as if
+ ).
+
+ The word component in this description refers to the nonindex values
+ red,
+ green,
+ blue,
+ alpha,
+ and depth.
+ Storage format GL_RGB
,
+ for example,
+ has three components per pixel:
+ first red,
+ then green,
+ and finally blue.
+
GL_PACK_SKIP_PIXELS
, GL_PACK_SKIP_ROWS
, and GL_PACK_SKIP_IMAGES
+
+ These values are provided as a convenience to the programmer;
+ they provide no functionality that cannot be duplicated simply by
+ incrementing the pointer passed to glReadPixels.
+ Setting GL_PACK_SKIP_PIXELS
to
+
+ is equivalent to incrementing
+ the pointer by
+
+ components or indices,
+ where
+
+ is the number of components or indices in each pixel.
+ Setting GL_PACK_SKIP_ROWS
to
+
+ is equivalent to incrementing
+ the pointer by
+
+ components or indices,
+ where
+
+ is the number of components or indices per row,
+ as just computed in the GL_PACK_ROW_LENGTH
section.
+ Setting GL_PACK_SKIP_IMAGES
to
+
+ is equivalent to incrementing
+ the pointer by
+ ,
+ where
+
+ is the number of components or indices
+ per image, as computed in the GL_PACK_IMAGE_HEIGHT
section.
+
GL_PACK_ALIGNMENT
+
+ + Specifies the alignment requirements for the start of each pixel row in memory. + The allowable values are + 1 (byte-alignment), + 2 (rows aligned to even-numbered bytes), + 4 (word-alignment), and + 8 (rows start on double-word boundaries). +
++ The other six of the twelve storage parameters affect how pixel data is + read from client memory. + These values are significant for + glTexImage2D, + glTexImage3D, + glTexSubImage2D, and + glTexSubImage3D +
++ They are as follows: +
+GL_UNPACK_ROW_LENGTH
+
+
+ If greater than 0,
+ GL_UNPACK_ROW_LENGTH
defines the number of pixels in a row.
+ If the first pixel of a row is placed at location
+
+ in memory,
+ then the location of the first pixel of the next row is obtained by skipping
+
+
++
+
+ components or indices,
+ where
+
+ is the number of components or indices in a pixel,
+
+ is the number of pixels in a row
+ (GL_UNPACK_ROW_LENGTH
if it is greater than 0,
+ the
+
+ argument to the pixel routine otherwise),
+
+ is the value of GL_UNPACK_ALIGNMENT
, and
+
+ is the size, in bytes, of a single component
+ (if
+ ,
+ then it is as if
+ ).
+ In the case of 1-bit values,
+ the location of the next row is obtained by skipping
+
+ +
++ components or indices. +
+
+ The word component in this description refers to the nonindex values
+ red,
+ green,
+ blue,
+ alpha,
+ and depth.
+ Storage format GL_RGB
,
+ for example,
+ has three components per pixel:
+ first red,
+ then green,
+ and finally blue.
+
GL_UNPACK_IMAGE_HEIGHT
+
+
+ If greater than 0,
+ GL_UNPACK_IMAGE_HEIGHT
defines the number of pixels in an image of
+ a three-dimensional texture volume. Where ``image'' is defined by all
+ pixel sharing the same third dimension index.
+ If the first pixel of a row is placed at location
+
+ in memory,
+ then the location of the first pixel of the next row is obtained by skipping
+
+
++
+
+ components or indices,
+ where
+
+ is the number of components or indices in a pixel,
+
+ is the number of pixels in a row
+ (GL_UNPACK_ROW_LENGTH
if it is greater than 0,
+ the
+
+ argument to glTexImage3D otherwise),
+
+ is the number of rows in an image (GL_UNPACK_IMAGE_HEIGHT
if
+ it is greater than 0, the
+
+ argument to glTexImage3D otherwise),
+
+ is the value of GL_UNPACK_ALIGNMENT
, and
+
+ is the size, in bytes, of a single component
+ (if
+ ,
+ then it is as if
+ ).
+
+ The word component in this description refers to the nonindex values
+ red,
+ green,
+ blue,
+ alpha,
+ and depth.
+ Storage format GL_RGB
,
+ for example,
+ has three components per pixel:
+ first red,
+ then green,
+ and finally blue.
+
GL_UNPACK_SKIP_PIXELS
, GL_UNPACK_SKIP_ROWS
and GL_UNPACK_SKIP_IMAGES
+
+ These values are provided as a convenience to the programmer;
+ they provide no functionality that cannot be duplicated by
+ incrementing the pointer passed to
+ glTexImage1D,
+ glTexImage2D,
+ glTexSubImage1D or
+ glTexSubImage2D.
+ Setting GL_UNPACK_SKIP_PIXELS
to
+
+ is equivalent to incrementing
+ the pointer by
+
+ components or indices,
+ where
+
+ is the number of components or indices in each pixel.
+ Setting GL_UNPACK_SKIP_ROWS
to
+
+ is equivalent to incrementing
+ the pointer by
+
+ components or indices,
+ where
+
+ is the number of components or indices per row,
+ as just computed in the GL_UNPACK_ROW_LENGTH
section.
+ Setting GL_UNPACK_SKIP_IMAGES
to
+
+ is equivalent to incrementing
+ the pointer by
+ ,
+ where
+
+ is the number of components or indices
+ per image, as computed in the GL_UNPACK_IMAGE_HEIGHT
section.
+
GL_UNPACK_ALIGNMENT
+
+ + Specifies the alignment requirements for the start of each pixel row in memory. + The allowable values are + 1 (byte-alignment), + 2 (rows aligned to even-numbered bytes), + 4 (word-alignment), and + 8 (rows start on double-word boundaries). +
+
+ The following table gives the type,
+ initial value,
+ and range of valid values for each storage parameter
+ that can be set with glPixelStorei
.
+
+
+
+ pname
+ |
+ + Type + | ++ Initial Value + | ++ Valid Range + | +
---|---|---|---|
+ GL_PACK_ROW_LENGTH
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_PACK_IMAGE_HEIGHT
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_PACK_SKIP_ROWS
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_PACK_SKIP_PIXELS
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_PACK_SKIP_IMAGES
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_PACK_ALIGNMENT
+ |
+ + integer + | ++ 4 + | ++ 1, 2, 4, or 8 + | +
+ GL_UNPACK_ROW_LENGTH
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_UNPACK_IMAGE_HEIGHT
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_UNPACK_SKIP_ROWS
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_UNPACK_SKIP_PIXELS
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_UNPACK_SKIP_IMAGES
+ |
+ + integer + | ++ 0 + | ++ + | +
+ GL_UNPACK_ALIGNMENT
+ |
+ + integer + | ++ 4 + | ++ 1, 2, 4, or 8 + | +
+ GL_INVALID_ENUM
is generated if pname
is not an accepted value.
+
+ GL_INVALID_VALUE
is generated if a negative row length,
+ pixel skip,
+ or row skip value is specified,
+ or if alignment is specified as other than 1, 2, 4, or 8.
+
+ glGet with argument GL_PACK_ROW_LENGTH
+
+ glGet with argument GL_PACK_IMAGE_HEIGHT
+
+ glGet with argument GL_PACK_SKIP_ROWS
+
+ glGet with argument GL_PACK_SKIP_PIXELS
+
+ glGet with argument GL_PACK_SKIP_IMAGES
+
+ glGet with argument GL_PACK_ALIGNMENT
+
+ glGet with argument GL_UNPACK_ROW_LENGTH
+
+ glGet with argument GL_UNPACK_IMAGE_HEIGHT
+
+ glGet with argument GL_UNPACK_SKIP_ROWS
+
+ glGet with argument GL_UNPACK_SKIP_PIXELS
+
+ glGet with argument GL_UNPACK_SKIP_IMAGES
+
+ glGet with argument GL_UNPACK_ALIGNMENT
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glPixelStorei | +✔ | +✔ | +
+ glReadPixels, + glTexImage2D, + glTexImage3D, + glTexSubImage2D, + glTexSubImage3D +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glPolygonOffset — set the scale and units used to calculate depth values
+
+ void glPolygonOffset(
+ |
+ GLfloat factor, | +
+ | GLfloat units) ; |
+
factor
+
+
+ + Specifies a scale factor that is used to create a variable + depth offset for each polygon. The initial value is 0. +
+units
+
+
+ + Is multiplied by an implementation-specific value to + create a constant depth offset. The initial value is 0. +
+
+ When GL_POLYGON_OFFSET_FILL
is enabled, each
+ fragment's depth value will be offset after it is interpolated
+ from the depth values of the appropriate vertices.
+ The value of the offset is
+
+ glPolygonOffset
is useful for applying decals.
+
+ glIsEnabled with argument
+ GL_POLYGON_OFFSET_FILL
.
+
+ glGet with argument GL_POLYGON_OFFSET_FACTOR
or
+ GL_POLYGON_OFFSET_UNITS
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glPolygonOffset | +✔ | +✔ | +
+ glDepthFunc, + glEnable, + glGet, + glIsEnabled +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glProgramBinary — load a program object with a program binary
+
+ void glProgramBinary(
+ |
+ GLuint program, | +
+ | GLenum binaryFormat, | +
+ | const void *binary, | +
+ | GLsizei length) ; |
+
program
+
+
+ + Specifies the name of a program object into which to load a program binary. +
+binaryFormat
+
+
+ + Specifies the format of the binary data in binary. +
+binary
+
+
+
+ Specifies the address of an array containing the binary to be loaded into program
.
+
length
+
+
+
+ Specifies the number of bytes contained in binary
.
+
+ glProgramBinary
loads a program object with a program binary previously
+ returned from glGetProgramBinary.
+ binaryFormat
and binary
must be those returned
+ by a previous call to glGetProgramBinary,
+ and length
must be the length returned by
+ glGetProgramBinary, or by
+ glGetProgramiv when called with
+ pname
set to GL_PROGRAM_BINARY_LENGTH
.
+ If these conditions are not met, loading the program binary will fail and program
's
+ GL_LINK_STATUS
will be set to GL_FALSE
.
+
+ A program object's program binary is replaced by calls to
+ glLinkProgram or
+ glProgramBinary
. When linking success or failure is concerned, glProgramBinary
+ can be considered to perform an implicit linking operation.
+ glLinkProgram and glProgramBinary
+ both set the program object's GL_LINK_STATUS
to GL_TRUE
+ or GL_FALSE
.
+
+ A successful call to glProgramBinary
will reset all uniform variables to their
+ initial values, GL_FALSE
for booleans and zero for all others. Additionally, all vertex shader input
+ and fragment shader output assignments that were in effect when the program was linked before saving are
+ restored with glProgramBinary
is called.
+
+ GL_INVALID_OPERATION
is generated if program
is not the
+ name of an existing program object.
+
+ GL_INVALID_ENUM
is generated if binaryFormat
is not a
+ value recognized by the implementation.
+
+ A program binary may fail to load if the implementation determines that there has been a + change in hardware or software configuration from when the program binary was produced such + as having been compiled with an incompatible or outdated version of the compiler. +
+
+ glGetProgramiv with argument GL_PROGRAM_BINARY_LENGTH
+
+ glGet with argument GL_NUM_PROGRAM_BINARY_FORMATS
+
+ glGet with argument GL_PROGRAM_BINARY_FORMATS
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glProgramBinary | +- | +✔ | +
+ glGetProgramiv, + glGetProgramBinary +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glProgramParameteri — specify a parameter for a program object
+
+ void glProgramParameteri(
+ |
+ GLuint program, | +
+ | GLenum pname, | +
+ | GLint value) ; |
+
program
+
+
+ + Specifies the name of a program object whose parameter to modify. +
+pname
+
+
+ + Specifies the name of the parameter to modify. +
+value
+
+
+
+ Specifies the new value of the parameter specified by pname
for program
.
+
+ glProgramParameteri
specifies a new value for the parameter nameed by
+ pname
for the program object program
.
+
+ If pname
is GL_PROGRAM_BINARY_RETRIEVABLE_HINT
,
+ value
should be GL_FALSE
or GL_TRUE
+ to indicate to the implementation the intention of the application to retrieve the program's
+ binary representation with glGetProgramBinary.
+ The implementation may use this information to store information that may be useful for a future
+ query of the program's binary. It is recommended to set GL_PROGRAM_BINARY_RETRIEVABLE_HINT
+ for the program to GL_TRUE
before calling
+ glLinkProgram, and
+ using the program at run-time if the binary is to be retrieved later.
+
+ GL_INVALID_OPERATION
is generated if program
is not the
+ name of an existing program object.
+
+ GL_INVALID_ENUM
is generated if pname
is not
+ GL_PROGRAM_BINARY_RETRIEVABLE_HINT
.
+
+ GL_INVALID_VALUE
is generated if value
is not
+ GL_FALSE
or GL_TRUE
.
+
+ glGetProgramiv. +
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glProgramParameteri | +- | +✔ | +
+ glGetProgramiv, + glGetProgramBinary, + glProgramBinary +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glReadBuffer — select a color buffer source for pixels
+
+ void glReadBuffer(
+ |
+ GLenum mode) ; |
+
mode
+
+
+
+ Specifies a color buffer.
+ Accepted values are
+ GL_BACK
,
+ GL_NONE
, and
+ GL_COLOR_ATTACHMENTi
.
+
+ glReadBuffer
specifies a color buffer as the source for subsequent
+ glReadPixels, , glCopyTexImage2D,
+ glCopyTexSubImage2D, and
+ glCopyTexSubImage3D commands.
+ mode
accepts one of the following values:
+ GL_NONE
,
+ GL_BACK
names the back buffer of the default framebuffer, and
+ GL_COLOR_ATTACHMENTi
names a color attachment of the current framebuffer,
+
+ GL_INVALID_ENUM
is generated if mode
is not GL_BACK
,
+ GL_NONE
, or GL_COLOR_ATTACHMENTi
, where i is less than
+ GL_MAX_COLOR_ATTACHMENTS
.
+
+ GL_INVALID_OPERATION
is generated if the current framebuffer is the default framebufer and
+ mode
is not GL_NONE
or GL_BACK
.
+
+ GL_INVALID_OPERATION
is generated if the current framebuffer is a named framebufer and
+ mode
is not GL_NONE
or GL_COLOR_ATTACHMENTi
.
+
+ glGet with argument GL_READ_BUFFER
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glReadBuffer | +- | +✔ | +
+ glCopyTexImage2D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glDrawBuffers, + glReadPixels +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glReadPixels — read a block of pixels from the frame buffer
+
+ void glReadPixels(
+ |
+ GLint x, | +
+ | GLint y, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLenum format, | +
+ | GLenum type, | +
+ | GLvoid * data) ; |
+
x
,
+
+
+ y
+
+
+ + Specify the window coordinates of the first pixel + that is read from the frame buffer. + This location is the lower left corner of a rectangular block of pixels. +
+width
,
+
+
+ height
+
+
+
+ Specify the dimensions of the pixel rectangle.
+ width
and height
of one correspond to a single pixel.
+
format
+
+
+
+ Specifies the format of the pixel data.
+ The following symbolic values are accepted:
+ GL_RGBA
, and
+ GL_RGBA_INTEGER
.
+ An implementation-chosen format will also be accepted.
+ This can be queried with glGet and
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT
.
+
type
+
+
+
+ Specifies the data type of the pixel data.
+ Must be one of
+ GL_UNSIGNED_BYTE
,
+ GL_UNSIGNED_INT
,
+ GL_INT
, or
+ GL_FLOAT
.
+ An implementation-chosen type will also be accepted.
+ This can be queried with glGet and
+ GL_IMPLEMENTATION_COLOR_READ_TYPE
.
+
data
+
+
+ + Returns the pixel data. +
+
+ glReadPixels
returns pixel data from the frame buffer,
+ starting with the pixel whose lower left corner
+ is at location (x
, y
),
+ into client memory starting at location data
.
+ Several parameters control the processing of the pixel data before
+ it is placed into client memory.
+ These parameters are set with glPixelStorei.
+ This reference page describes the effects on glReadPixels
of most,
+ but not all of the parameters specified by these three commands.
+
+ If a non-zero named buffer object is bound to the GL_PIXEL_PACK_BUFFER
target
+ (see glBindBuffer) while a block of pixels is
+ requested, data
is treated as a byte offset into the buffer object's data store
+ rather than a pointer to client memory.
+
+ glReadPixels
returns values from each pixel with lower left corner at
+
+ format
specifies the format for the returned pixel values;
+ accepted values are
+ GL_RED
,
+ GL_RED_INTEGER
,
+ GL_RG
,
+ GL_RG_INTEGER
,
+ GL_RGB
,
+ GL_RGB_INTEGER
,
+ GL_RGBA
,
+ GL_RGBA_INTEGER
,
+ GL_LUMINANCE_ALPHA
,
+ GL_LUMINANCE
, and
+ GL_ALPHA
+
+ Finally, the indices or components
+ are converted to the proper format,
+ as specified by type
.
+ If type
is GL_FLOAT
, then each integer index is converted to
+ single-precision floating-point format.
+
+ If format
is
+ GL_RED
,
+ GL_RG
,
+ GL_RGB
, or
+ GL_RGBA
, and type
is not GL_FLOAT
,
+ each component is multiplied by the multiplier shown in the following table.
+ If type is GL_FLOAT
, then each component is passed as is
+ (or converted to the client's single-precision floating-point format if
+ it is different from the one used by the GL).
+
+
+
+ type
+ |
+ + Index Mask + | ++ Component Conversion + | +
---|---|---|
+ GL_UNSIGNED_BYTE
+ |
+ + + | ++ + | +
+ GL_BYTE
+ |
+ + + | ++ + | +
+ GL_HALF_FLOAT
+ |
+ + none + | ++ + | +
+ GL_FLOAT
+ |
+ + none + | ++ + | +
+ GL_UNSIGNED_SHORT_5_6_5
+ |
+ + + | ++ + | +
+ GL_UNSIGNED_SHORT_4_4_4_4
+ |
+ + + | ++ + | +
+ GL_UNSIGNED_SHORT_5_5_5_1
+ |
+ + + | ++ + | +
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ |
+ + + | ++ + | +
+ GL_UNSIGNED_INT_10F_11F_11F_REV
+ |
+ + -- + | ++ Special + | +
+ GL_UNSIGNED_INT_5_9_9_9_REV
+ |
+ + -- + | ++ Special + | +
+ Return values are placed in memory as follows.
+ If format
is
+ GL_RED
, or
+ GL_RED_INTEGER
,
+ a single value is returned and the data for the
+ GL_RG
and GL_RG_INTEGER
return two values,
+ GL_RGB
and GL_RGB_INTEGER
return three values,
+ GL_RGBA
and GL_RGBA_INTEGER
return four values for each pixel,
+ with all values corresponding to a single pixel occupying contiguous space
+ in data
.
+ See glPixelStorei for a description of parameters which affect
+ the packing of data into memory.
+
+ Values for pixels that lie outside the window + connected to the current GL context are undefined. +
+
+ If an error is generated,
+ no change is made to the contents of data
.
+
+ Only two format
/type
parameter pairs are
+ accepted. For normalized fixed point rendering surfaces, GL_RGBA
/GL_UNSIGNED_BYTE
is
+ accepted. For signed integer rendering surfaces, GL_RGBA_INTEGER
/GL_INT
is accepted.
+ For unsigned integer rendering surfaces, GL_RGBA_INTEGER
/GL_UNSIGNED_INT
is accepted.
+ The other acceptable pair can be discovered by querying
+ GL_IMPLEMENTATION_COLOR_READ_FORMAT
and
+ GL_IMPLEMENTATION_COLOR_READ_TYPE
. The implementation chosen format may also vary depending on the
+ format of the currently bound rendering surface.
+
+ GL_INVALID_ENUM
is generated if format
or type
is not an
+ accepted value.
+
+ GL_INVALID_VALUE
is generated if either width
or height
is negative.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_PACK_BUFFER
target and the buffer object's data store is currently mapped.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_PACK_BUFFER
target and the data would be packed to the buffer
+ object such that the memory writes required would exceed the data store size.
+
+ GL_INVALID_OPERATION
is generated if GL_READ_BUFFER
is GL_NONE
or
+ if GL_READ_FRAMEBUFFER_BINDING
is non-zero and the read buffer selects an attachment that has no image attached.
+
+ GL_INVALID_OPERATION
is generated if GL_READ_FRAMEBUFFER_BINDING
+ is non-zero, the read framebuffer is complete, and the value of GL_SAMPLE_BUFFERS
+ for the read framebuffer is greater than zero.
+
+ GL_INVALID_OPERATION
is generated if the readbuffer of the currently bound framebuffer is
+ a fixed point normalized surface and format
+ and type
are neither GL_RGBA
and
+ GL_UNSIGNED_BYTE
, respectively, nor the format/type pair
+ returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT
+ and GL_IMPLEMENTATION_COLOR_READ_TYPE
.
+
+ GL_INVALID_OPERATION
is generated if the readbuffer of the currently bound framebuffer is
+ a floating point surface and format
+ and type
are neither GL_RGBA
and
+ GL_FLOAT
, respectively, nor the format/type pair
+ returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT
+ and GL_IMPLEMENTATION_COLOR_READ_TYPE
.
+
+ GL_INVALID_OPERATION
is generated if the readbuffer of the currently bound framebuffer is
+ a signed integer surface and format
+ and type
are neither GL_RGBA_INTEGER
and
+ GL_INT
, respectively, nor the format/type pair
+ returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT
+ and GL_IMPLEMENTATION_COLOR_READ_TYPE
.
+
+ GL_INVALID_OPERATION
is generated if the readbuffer of the currently bound framebuffer is
+ an unsigned integer surface and format
+ and type
are neither GL_RGBA_INTEGER
and
+ GL_UNSIGNED_INT
, respectively, nor the format/type pair
+ returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT
+ and GL_IMPLEMENTATION_COLOR_READ_TYPE
.
+
+ GL_INVALID_FRAMEBUFFER_OPERATION
is generated if
+ the currently bound framebuffer is not framebuffer complete (i.e. the
+ return value from glCheckFramebufferStatus
+ is not GL_FRAMEBUFFER_COMPLETE
).
+
+ glGet with argument GL_PIXEL_PACK_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glReadPixels | +✔ | +✔ | +
+ glPixelStorei, + glReadBuffer +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glReleaseShaderCompiler — release resources consumed by the implementation's shader compiler
+
+ void glReleaseShaderCompiler(
+ |
+ void) ; |
+
+ glReleaseShaderCompiler
provides a hint to the implementation that it
+ may free internal resources associated with its shader compiler. glCompileShader
+ may subsequently be called and the implementation may at that time reallocate resources
+ previously freed by the call to glReleaseShaderCompiler
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glReleaseShaderCompiler | +✔ | +✔ | +
+ glCompileShader, + glLinkProgram +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glRenderbufferStorage — establish data storage, format and dimensions of a renderbuffer object's image
+
+ void glRenderbufferStorage(
+ |
+ GLenum target, | +
+ | GLenum internalformat, | +
+ | GLsizei width, | +
+ | GLsizei height) ; |
+
target
+
+
+
+ Specifies a binding to which the target of the allocation and must be GL_RENDERBUFFER
.
+
internalformat
+
+
+ + Specifies the internal format to use for the renderbuffer object's image. +
+width
+
+
+ + Specifies the width of the renderbuffer, in pixels. +
+height
+
+
+ + Specifies the height of the renderbuffer, in pixels. +
+
+ glRenderbufferStorage
is equivalent to calling
+ glRenderbufferStorageMultisample with the
+ samples
set to zero.
+
+ The target of the operation, specified by target
must be GL_RENDERBUFFER
.
+ internalformat
specifies the internal format to be used for the renderbuffer object's storage and
+ must be a color-renderable, depth-renderable, or stencil-renderable format, as shown in Table 1 below.
+ width
and height
are the dimensions, in pixels, of the renderbuffer.
+ Both width
and height
must be less than or equal to the value of
+ GL_MAX_RENDERBUFFER_SIZE
.
+
+ Upon success, glRenderbufferStorage
deletes any existing data store for the renderbuffer
+ image and the contents of the data store after calling glRenderbufferStorage
are undefined.
+
+
++ Sized Internal Format + | ++ Base Format + | ++ Red Bits + | ++ Green Bits + | ++ Blue Bits + | ++ Alpha Bits + | +
---|---|---|---|---|---|
+ GL_R8
+ |
+
+ GL_RED
+ |
+ 8 | ++ | + | + |
+ GL_R8UI
+ |
+
+ GL_RED_INTEGER
+ |
+ ui8 | ++ | + | + |
+ GL_R8I
+ |
+
+ GL_RED_INTEGER
+ |
+ i8 | ++ | + | + |
+ GL_R16UI
+ |
+
+ GL_RED_INTEGER
+ |
+ ui16 | ++ | + | + |
+ GL_R16I
+ |
+
+ GL_RED_INTEGER
+ |
+ i16 | ++ | + | + |
+ GL_R32UI
+ |
+
+ GL_RED_INTEGER
+ |
+ ui32 | ++ | + | + |
+ GL_R32I
+ |
+
+ GL_RED_INTEGER
+ |
+ i32 | ++ | + | + |
+ GL_RG8
+ |
+
+ GL_RG
+ |
+ 8 | +8 | ++ | + |
+ GL_RG8UI
+ |
+
+ GL_RG_INTEGER
+ |
+ ui8 | +ui8 | ++ | + |
+ GL_RG8I
+ |
+
+ GL_RG_INTEGER
+ |
+ i8 | +i8 | ++ | + |
+ GL_RG16UI
+ |
+
+ GL_RG_INTEGER
+ |
+ ui16 | +ui16 | ++ | + |
+ GL_RG16I
+ |
+
+ GL_RG_INTEGER
+ |
+ i16 | +i16 | ++ | + |
+ GL_RG32UI
+ |
+
+ GL_RG_INTEGER
+ |
+ ui32 | +ui32 | ++ | + |
+ GL_RG32I
+ |
+
+ GL_RG_INTEGER
+ |
+ i32 | +i32 | ++ | + |
+ GL_RGB8
+ |
+
+ GL_RGB
+ |
+ 8 | +8 | +8 | ++ |
+ GL_RGB565
+ |
+
+ GL_RGB
+ |
+ 5 | +6 | +5 | ++ |
+ GL_RGBA8
+ |
+
+ GL_RGBA
+ |
+ 8 | +8 | +8 | +8 | +
+ GL_SRGB8_ALPHA8
+ |
+
+ GL_RGBA
+ |
+ 8 | +8 | +8 | +8 | +
+ GL_RGB5_A1
+ |
+
+ GL_RGBA
+ |
+ 5 | +5 | +5 | +1 | +
+ GL_RGBA4
+ |
+
+ GL_RGBA
+ |
+ 4 | +4 | +4 | +4 | +
+ GL_RGB10_A2
+ |
+
+ GL_RGBA
+ |
+ 10 | +10 | +10 | +2 | +
+ GL_RGBA8UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+ ui8 | +ui8 | +ui8 | +ui8 | +
+ GL_RGBA8I
+ |
+
+ GL_RGBA_INTEGER
+ |
+ i8 | +i8 | +i8 | +i8 | +
+ GL_RGB10_A2UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+ ui10 | +ui10 | +ui10 | +ui2 | +
+ GL_RGBA16UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+ ui16 | +ui16 | +ui16 | +ui16 | +
+ GL_RGBA16I
+ |
+
+ GL_RGBA_INTEGER
+ |
+ i16 | +i16 | +i16 | +i16 | +
+ GL_RGBA32I
+ |
+
+ GL_RGBA_INTEGER
+ |
+ i32 | +i32 | +i32 | +i32 | +
+ GL_RGBA32UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+ ui32 | +ui32 | +ui32 | +ui32 | +
+ Sized Internal Format + | ++ Base Format + | ++ Depth Bits + | ++ Stencil Bits + | +
---|---|---|---|
+ GL_DEPTH_COMPONENT16
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ 16 | ++ |
+ GL_DEPTH_COMPONENT24
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ 24 | ++ |
+ GL_DEPTH_COMPONENT32F
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ f32 | ++ |
+ GL_DEPTH24_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+ 24 | +8 | +
+ GL_DEPTH32F_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+ f32 | +8 | +
+ GL_STENCIL_INDEX8
+ |
+
+ GL_STENCIL
+ |
+ + | 8 | +
+
+ GL_INVALID_ENUM
is generated if target
is not GL_RENDERBUFFER
.
+
+ GL_INVALID_VALUE
is generated if either of width
or height
is negative,
+ or greater than the value of GL_MAX_RENDERBUFFER_SIZE
.
+
+ GL_INVALID_ENUM
is generated if internalformat
is not a color-renderable, depth-renderable,
+ or stencil-renderable format.
+
+ GL_OUT_OF_MEMORY
is generated if the GL is unable to create a data store of the requested size.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glRenderbufferStorage | +✔ | +✔ | +
+ glGenRenderbuffers, + glBindRenderbuffer, + glRenderbufferStorageMultisample, + glFramebufferRenderbuffer, + glDeleteRenderbuffers +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glRenderbufferStorageMultisample — establish data storage, format, dimensions and sample count of a renderbuffer object's image
+
+ void glRenderbufferStorageMultisample(
+ |
+ GLenum target, | +
+ | GLsizei samples, | +
+ | GLenum internalformat, | +
+ | GLsizei width, | +
+ | GLsizei height) ; |
+
target
+
+
+
+ Specifies a binding to which the target of the allocation and must be GL_RENDERBUFFER
.
+
samples
+
+
+ + Specifies the number of samples to be used for the renderbuffer object's storage. +
+internalformat
+
+
+ + Specifies the internal format to use for the renderbuffer object's image. +
+width
+
+
+ + Specifies the width of the renderbuffer, in pixels. +
+height
+
+
+ + Specifies the height of the renderbuffer, in pixels. +
+
+ glRenderbufferStorageMultisample
establishes the data storage, format, dimensions and number of
+ samples of a renderbuffer object's image.
+
+ The target of the operation, specified by target
must be GL_RENDERBUFFER
.
+ internalformat
specifies the internal format to be used for the renderbuffer object's storage and
+ must be a color-renderable, depth-renderable, or stencil-renderable format, as shown in Table 1 below.
+ width
and height
are the dimensions, in pixels, of the renderbuffer.
+ Both width
and height
must be less than or equal to the value of
+ GL_MAX_RENDERBUFFER_SIZE
. samples
specifies the number of samples to be used
+ for the renderbuffer object's image. If internalformat
is a signed or unsigned integer format then
+ samples
must be 0. Otherwise, samples
must be must be less than or equal to
+ the maximum number of samples supported for internalformat
.
+ (see glGetInternalformativ).
+
+ Upon success, glRenderbufferStorageMultisample
deletes any existing data store for the renderbuffer
+ image and the contents of the data store after calling glRenderbufferStorageMultisample
are undefined.
+
+
++ Sized Internal Format + | ++ Base Format + | ++ Red Bits + | ++ Green Bits + | ++ Blue Bits + | ++ Alpha Bits + | +
---|---|---|---|---|---|
+ GL_R8
+ |
+
+ GL_RED
+ |
+ 8 | ++ | + | + |
+ GL_R8UI
+ |
+
+ GL_RED_INTEGER
+ |
+ ui8 | ++ | + | + |
+ GL_R8I
+ |
+
+ GL_RED_INTEGER
+ |
+ i8 | ++ | + | + |
+ GL_R16UI
+ |
+
+ GL_RED_INTEGER
+ |
+ ui16 | ++ | + | + |
+ GL_R16I
+ |
+
+ GL_RED_INTEGER
+ |
+ i16 | ++ | + | + |
+ GL_R32UI
+ |
+
+ GL_RED_INTEGER
+ |
+ ui32 | ++ | + | + |
+ GL_R32I
+ |
+
+ GL_RED_INTEGER
+ |
+ i32 | ++ | + | + |
+ GL_RG8
+ |
+
+ GL_RG
+ |
+ 8 | +8 | ++ | + |
+ GL_RG8UI
+ |
+
+ GL_RG_INTEGER
+ |
+ ui8 | +ui8 | ++ | + |
+ GL_RG8I
+ |
+
+ GL_RG_INTEGER
+ |
+ i8 | +i8 | ++ | + |
+ GL_RG16UI
+ |
+
+ GL_RG_INTEGER
+ |
+ ui16 | +ui16 | ++ | + |
+ GL_RG16I
+ |
+
+ GL_RG_INTEGER
+ |
+ i16 | +i16 | ++ | + |
+ GL_RG32UI
+ |
+
+ GL_RG_INTEGER
+ |
+ ui32 | +ui32 | ++ | + |
+ GL_RG32I
+ |
+
+ GL_RG_INTEGER
+ |
+ i32 | +i32 | ++ | + |
+ GL_RGB8
+ |
+
+ GL_RGB
+ |
+ 8 | +8 | +8 | ++ |
+ GL_RGB565
+ |
+
+ GL_RGB
+ |
+ 5 | +6 | +5 | ++ |
+ GL_RGBA8
+ |
+
+ GL_RGBA
+ |
+ 8 | +8 | +8 | +8 | +
+ GL_SRGB8_ALPHA8
+ |
+
+ GL_RGBA
+ |
+ 8 | +8 | +8 | +8 | +
+ GL_RGB5_A1
+ |
+
+ GL_RGBA
+ |
+ 5 | +5 | +5 | +1 | +
+ GL_RGBA4
+ |
+
+ GL_RGBA
+ |
+ 4 | +4 | +4 | +4 | +
+ GL_RGB10_A2
+ |
+
+ GL_RGBA
+ |
+ 10 | +10 | +10 | +2 | +
+ GL_RGBA8UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+ ui8 | +ui8 | +ui8 | +ui8 | +
+ GL_RGBA8I
+ |
+
+ GL_RGBA_INTEGER
+ |
+ i8 | +i8 | +i8 | +i8 | +
+ GL_RGB10_A2UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+ ui10 | +ui10 | +ui10 | +ui2 | +
+ GL_RGBA16UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+ ui16 | +ui16 | +ui16 | +ui16 | +
+ GL_RGBA16I
+ |
+
+ GL_RGBA_INTEGER
+ |
+ i16 | +i16 | +i16 | +i16 | +
+ GL_RGBA32I
+ |
+
+ GL_RGBA_INTEGER
+ |
+ i32 | +i32 | +i32 | +i32 | +
+ GL_RGBA32UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+ ui32 | +ui32 | +ui32 | +ui32 | +
+ Sized Internal Format + | ++ Base Format + | ++ Depth Bits + | ++ Stencil Bits + | +
---|---|---|---|
+ GL_DEPTH_COMPONENT16
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ 16 | ++ |
+ GL_DEPTH_COMPONENT24
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ 24 | ++ |
+ GL_DEPTH_COMPONENT32F
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ f32 | ++ |
+ GL_DEPTH24_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+ 24 | +8 | +
+ GL_DEPTH32F_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+ f32 | +8 | +
+ GL_STENCIL_INDEX8
+ |
+
+ GL_STENCIL
+ |
+ + | 8 | +
+
+ Since different implementations may support different sample counts for multisample
+ rendering, the actual number of samples allocated for the renderbuffer image is
+ implementation-dependent. However, the resulting value for GL_RENDERBUFFER_SAMPLES
+ is guaranteed to be greater than or equal to samples
and no more than the
+ next larger sample count supported by the implementation.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_RENDERBUFFER
.
+
+ GL_INVALID_VALUE
is generated if samples
is greater than the maximum number of samples
+ supported for internalformat
.
+
+ GL_INVALID_ENUM
is generated if internalformat
is not a color-renderable, depth-renderable,
+ or stencil-renderable format.
+
+ GL_INVALID_OPERATION
is generated if internalformat
is a signed or unsigned integer format
+ and samples
is greater than 0.
+
+ GL_INVALID_VALUE
is generated if either of width
or height
is negative,
+ or greater than the value of GL_MAX_RENDERBUFFER_SIZE
.
+
+ GL_OUT_OF_MEMORY
is generated if the GL is unable to create a data store of the requested size.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glRenderbufferStorageMultisample | +- | +✔ | +
+ glGenRenderbuffers, + glGetInternalformativ, + glBindRenderbuffer, + glRenderbufferStorage, + glFramebufferRenderbuffer, + glDeleteRenderbuffers +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glResumeTransformFeedback — resume transform feedback operations
+
+ void glResumeTransformFeedback(
+ |
+ void) ; |
+
+ glResumeTransformFeedback
resumes transform feedback operations on the currently active transform feedback
+ object. When transform feedback operations are paused, transform feedback is still considered active and changing most
+ transform feedback state related to the object results in an error. However, a new transform feedback object may be bound
+ while transform feedback is paused.
+
+ GL_INVALID_OPERATION
is generated if the currently bound transform feedback object is not active or is not paused.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glResumeTransformFeedback | +- | +✔ | +
+ glGenTransformFeedbacks, + glBindTransformFeedback, + glBeginTransformFeedback, + glPauseTransformFeedback, + glEndTransformFeedback, + glDeleteTransformFeedbacks +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glSampleCoverage — specify multisample coverage parameters
+
+ void glSampleCoverage(
+ |
+ GLfloat value, | +
+ | GLboolean invert) ; |
+
value
+
+
+ + Specify a single floating-point sample coverage value. The value is + clamped to the range + . + The initial value is 1.0. +
+invert
+
+
+
+ Specify a single boolean value representing if the coverage masks should be
+ inverted. GL_TRUE
and GL_FALSE
are accepted. The initial value
+ is GL_FALSE
.
+
+ Multisampling samples a pixel multiple times at various + implementation-dependent subpixel locations to generate antialiasing + effects. Multisampling transparently antialiases points, lines, polygons, + and images if it is enabled. +
+
+ value
is used in constructing a temporary mask used in determining which
+ samples will be used in resolving the final fragment color. This mask is
+ bitwise-anded with the coverage mask generated from the multisampling
+ computation. If the invert
flag is set, the temporary mask is inverted
+ (all bits flipped) and then the bitwise-and is computed.
+
+ If an implementation does not have any multisample buffers available, or + multisampling is disabled, rasterization occurs with only a single sample + computing a pixel's final RGB color. +
++ Provided an implementation supports multisample buffers, and multisampling + is enabled, then a pixel's final color is generated by combining several + samples per pixel. Each sample contains color, depth, and stencil + information, allowing those operations to be performed on each sample. +
+
+ glGet with argument GL_SAMPLE_COVERAGE_VALUE
+
+ glGet with argument GL_SAMPLE_COVERAGE_INVERT
+
+ glIsEnabled with argument GL_MULTISAMPLE
+
+ glIsEnabled with argument GL_SAMPLE_ALPHA_TO_COVERAGE
+
+ glIsEnabled with argument GL_SAMPLE_COVERAGE
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glSampleCoverage | +✔ | +✔ | +
+ glEnable +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glSamplerParameter — set sampler parameters
+
+ void glSamplerParameterf(
+ |
+ GLuint sampler, | +
+ | GLenum pname, | +
+ | GLfloat param) ; |
+
+ void glSamplerParameteri(
+ |
+ GLuint sampler, | +
+ | GLenum pname, | +
+ | GLint param) ; |
+
+ void glSamplerParameterfv(
+ |
+ GLuint sampler, | +
+ | GLenum pname, | +
+ | const GLfloat * params) ; |
+
+ void glSamplerParameteriv(
+ |
+ GLuint sampler, | +
+ | GLenum pname, | +
+ | const GLint * params) ; |
+
sampler
+
+
+ + Specifies the sampler object whose parameter to modify. +
+pname
+
+
+
+ Specifies the symbolic name of a single-valued sampler parameter.
+ pname
can be one of the following:
+ GL_TEXTURE_WRAP_S
,
+ GL_TEXTURE_WRAP_T
,
+ GL_TEXTURE_WRAP_R
,
+ GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_MIN_LOD
,
+ GL_TEXTURE_MAX_LOD
,
+ GL_TEXTURE_COMPARE_MODE
, or
+ GL_TEXTURE_COMPARE_FUNC
.
+
param
+
+
+
+ For the scalar commands, specifies the value of
+ pname
.
+
params
+
+
+
+ For the vector commands
+ (glSamplerParameter*v
), specifies a
+ pointer to an array where the value or values of
+ pname
are stored.
+
+ glSamplerParameter
assigns the value or values in params
to the sampler parameter
+ specified as pname
.
+ sampler
specifies the sampler object to be modified, and must be the name of a sampler object previously
+ returned from a call to glGenSamplers.
+ The following symbols are accepted in pname
:
+
GL_TEXTURE_MIN_FILTER
+
+ + The texture minifying function is used whenever the pixel being textured + maps to an area greater than one texture element. + There are six defined minifying functions. + Two of them use the nearest one or nearest four texture elements + to compute the texture value. + The other four use mipmaps. +
++ A mipmap is an ordered set of arrays representing the same image + at progressively lower resolutions. + If the texture has dimensions + , + there are + + mipmaps. + The first mipmap is the original texture, + with dimensions + . + Each subsequent mipmap has dimensions + , + where + + are the dimensions of the previous mipmap, + until either + + or + . + At that point, + subsequent mipmaps have dimension + + or + + until the final mipmap, + which has dimension + . + To define the mipmaps, call glTexStorage2D, glTexImage2D, + glTexStorage2D, glTexImage3D, + or glCopyTexImage2D + with the level argument indicating the order of the mipmaps. + Level 0 is the original texture; + level + + is the final + + mipmap. +
+
+ params
supplies a function for minifying the texture as one of the
+ following:
+
GL_NEAREST
+
+ + Returns the value of the texture element that is nearest + (in Manhattan distance) + to the center of the pixel being textured. +
+GL_LINEAR
+
+ + Returns the weighted average of the four texture elements + that are closest to the center of the pixel being textured. +
+GL_NEAREST_MIPMAP_NEAREST
+
+
+ Chooses the mipmap that most closely matches the size of the pixel
+ being textured and uses the GL_NEAREST
criterion
+ (the texture element nearest to the center of the pixel)
+ to produce a texture value.
+
GL_LINEAR_MIPMAP_NEAREST
+
+
+ Chooses the mipmap that most closely matches the size of the pixel
+ being textured and uses the GL_LINEAR
criterion
+ (a weighted average of the four texture elements that are closest
+ to the center of the pixel)
+ to produce a texture value.
+
GL_NEAREST_MIPMAP_LINEAR
+
+
+ Chooses the two mipmaps that most closely match the size of the pixel
+ being textured and uses the GL_NEAREST
criterion
+ (the texture element nearest to the center of the pixel)
+ to produce a texture value from each mipmap.
+ The final texture value is a weighted average of those two values.
+
GL_LINEAR_MIPMAP_LINEAR
+
+
+ Chooses the two mipmaps that most closely match the size of the pixel
+ being textured and uses the GL_LINEAR
criterion
+ (a weighted average of the four texture elements that are closest
+ to the center of the pixel)
+ to produce a texture value from each mipmap.
+ The final texture value is a weighted average of those two values.
+
+
+
+ As more texture elements are sampled in the minification process,
+ fewer aliasing artifacts will be apparent.
+ While the GL_NEAREST
and GL_LINEAR
minification functions can be
+ faster than the other four,
+ they sample only one or four texture elements to determine the texture value
+ of the pixel being rendered and can produce moire patterns
+ or ragged transitions.
+ The initial value of GL_TEXTURE_MIN_FILTER
is
+ GL_NEAREST_MIPMAP_LINEAR
.
+
GL_TEXTURE_MAG_FILTER
+
+
+ The texture magnification function is used when the pixel being textured
+ maps to an area less than or equal to one texture element.
+ It sets the texture magnification function to either GL_NEAREST
+ or GL_LINEAR
(see below). GL_NEAREST
is generally faster
+ than GL_LINEAR
,
+ but it can produce textured images with sharper edges
+ because the transition between texture elements is not as smooth.
+ The initial value of GL_TEXTURE_MAG_FILTER
is GL_LINEAR
.
+
GL_NEAREST
+
+ + Returns the value of the texture element that is nearest + (in Manhattan distance) + to the center of the pixel being textured. +
+GL_LINEAR
+
+ + Returns the weighted average of the four texture elements + that are closest to the center of the pixel being textured. +
++
++
+GL_TEXTURE_MIN_LOD
+
+ + Sets the minimum level-of-detail parameter. This floating-point value + limits the selection of highest resolution mipmap (lowest mipmap + level). The initial value is -1000. +
++
+GL_TEXTURE_MAX_LOD
+
+ + Sets the maximum level-of-detail parameter. This floating-point value + limits the selection of the lowest resolution mipmap (highest mipmap + level). The initial value is 1000. +
++
+GL_TEXTURE_WRAP_S
+
+
+ Sets the wrap parameter for texture coordinate
+
+ to either GL_CLAMP_TO_EDGE
, GL_MIRRORED_REPEAT
, or
+ GL_REPEAT
. GL_CLAMP_TO_EDGE
causes
+
+ coordinates to be clamped to the
+ range
+ ,
+ where
+
+ is the size
+ of the texture in the direction of clamping. GL_REPEAT
causes the
+ integer part of the
+
+ coordinate to be ignored; the GL uses only the
+ fractional part, thereby creating a repeating pattern.
+ GL_MIRRORED_REPEAT
causes the
+
+ coordinate to be set to the
+ fractional part of the texture coordinate if the integer part of
+
+ is
+ even; if the integer part of
+
+ is odd, then the
+
+ texture coordinate is
+ set to
+ ,
+ where
+
+ represents the fractional part of
+ .
+ Initially, GL_TEXTURE_WRAP_S
is set to GL_REPEAT
.
+
+
+GL_TEXTURE_WRAP_T
+
+
+ Sets the wrap parameter for texture coordinate
+
+ to either GL_CLAMP_TO_EDGE
, GL_MIRRORED_REPEAT
, or
+ GL_REPEAT
. See the discussion under GL_TEXTURE_WRAP_S
.
+ Initially, GL_TEXTURE_WRAP_T
is set to GL_REPEAT
.
+
GL_TEXTURE_WRAP_R
+
+
+ Sets the wrap parameter for texture coordinate
+
+ to either GL_CLAMP_TO_EDGE
, GL_MIRRORED_REPEAT
, or
+ GL_REPEAT
. See the discussion under GL_TEXTURE_WRAP_S
.
+ Initially, GL_TEXTURE_WRAP_R
is set to GL_REPEAT
.
+
GL_TEXTURE_COMPARE_MODE
+
+
+ Specifies the texture comparison mode for currently bound textures.
+ That is, a texture whose base internal format is GL_DEPTH_COMPONENT
or
+ GL_DEPTH_STENCIL
; see
+ glTexImage2D)
+ Permissible values are:
+
GL_COMPARE_REF_TO_TEXTURE
+
+
+ Specifies that the interpolated and clamped
+
+ texture coordinate should
+ be compared to the value in the currently bound texture. See the
+ discussion of GL_TEXTURE_COMPARE_FUNC
for details of how the comparison
+ is evaluated. The result of the comparison is assigned to the red channel.
+
GL_NONE
+
+ + Specifies that the red channel should be assigned the + appropriate value from the currently bound texture. +
++
+GL_TEXTURE_COMPARE_FUNC
+
+
+ Specifies the comparison operator used when GL_TEXTURE_COMPARE_MODE
is
+ set to GL_COMPARE_REF_TO_TEXTURE
. Permissible values are:
+
+ Texture Comparison Function + | ++ Computed result + | +
---|---|
+ GL_LEQUAL
+ |
+ + + | +
+ GL_GEQUAL
+ |
+ + + | +
+ GL_LESS
+ |
+ + + | +
+ GL_GREATER
+ |
+ + + | +
+ GL_EQUAL
+ |
+ + + | +
+ GL_NOTEQUAL
+ |
+ + + | +
+ GL_ALWAYS
+ |
+ + + | +
+ GL_NEVER
+ |
+ + + | +
+ where + is the current interpolated texture coordinate, and + + is the texture value sampled from the currently bound texture. + + is assigned to + . +
++ If a sampler object is bound to a texture unit and that unit is used to sample from a texture, the parameters in the sampler + are used to sample from the texture, rather than the equivalent parameters in the texture object bound to that unit. This + introduces the possibility of sampling from the same texture object with different sets of sampler state, which may lead to + a condition where a texture is incomplete with respect to one sampler object and not with respect to + another. Thus, completeness can be considered a function of a sampler object and a texture object bound to a single + texture unit, rather than a property of the texture object itself. +
++ The results of a texture lookup are undefined if: +
+
+ The sampler used in a texture lookup function is not one of the shadow sampler types, the texture object's base
+ internal format is GL_DEPTH_COMPONENT
or GL_DEPTH_STENCIL
, and the
+ GL_TEXTURE_COMPARE_MODE
is not GL_NONE
.
+
+ The sampler used in a texture lookup function is one of the shadow sampler types, the texture object's base internal format
+ is GL_DEPTH_COMPONENT
or GL_DEPTH_STENCIL
, and the
+ GL_TEXTURE_COMPARE_MODE
is GL_NONE
.
+
+ The sampler used in a texture lookup function is one of the shadow sampler types, and the texture object's base
+ internal format is not GL_DEPTH_COMPONENT
or GL_DEPTH_STENCIL
.
+
+
+
+ GL_INVALID_OPERATION
is generated if sampler
is not the name of a sampler object previously
+ returned from a call to glGenSamplers.
+
+ GL_INVALID_ENUM
is generated if params
should have a defined
+ constant value (based on the value of pname
) and does not.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glSamplerParameterf
+ |
+ - | +✔ | +
+ glSamplerParameteri
+ |
+ - | +✔ | +
+ glGenSamplers, + glBindSampler, + glDeleteSamplers, + glIsSampler, + glBindTexture, + glTexParameter +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glScissor — define the scissor box
+
+ void glScissor(
+ |
+ GLint x, | +
+ | GLint y, | +
+ | GLsizei width, | +
+ | GLsizei height) ; |
+
x
,
+
+
+ y
+
+
+ + Specify the lower left corner of the scissor box. + Initially (0, 0). +
+width
,
+
+
+ height
+
+
+
+ Specify the width and height of the scissor box.
+ When a GL context is first attached to a window,
+ width
and height
are set to the dimensions of that
+ window.
+
+ glScissor
defines a rectangle, called the scissor box,
+ in window coordinates.
+ The first two arguments,
+ x
and y
,
+ specify the lower left corner of the box.
+ width
and height
specify the width and height of the box.
+
+ To enable and disable the scissor test, call
+ glEnable and glDisable with argument
+ GL_SCISSOR_TEST
. The test is initially disabled.
+ While the test is enabled, only pixels that lie within the scissor box
+ can be modified by drawing commands.
+ Window coordinates have integer values at the shared corners of
+ frame buffer pixels.
+ glScissor(0,0,1,1)
allows modification of only the lower left
+ pixel in the window, and glScissor(0,0,0,0)
doesn't allow
+ modification of any pixels in the window.
+
+ When the scissor test is disabled, + it is as though the scissor box includes the entire window. +
+
+ GL_INVALID_VALUE
is generated if either width
or height
is negative.
+
+ glGet with argument GL_SCISSOR_BOX
+
+ glIsEnabled with argument GL_SCISSOR_TEST
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glScissor | +✔ | +✔ | +
+ glEnable, + glViewport +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glShaderBinary — load pre-compiled shader binaries
+
+ void glShaderBinary(
+ |
+ GLsizei count, | +
+ | const GLuint *shaders, | +
+ | GLenum binaryFormat, | +
+ | const void *binary, | +
+ | GLsizei length) ; |
+
count
+
+
+
+ Specifies the number of shader object handles contained in shaders
.
+
shaders
+
+
+ + Specifies the address of an array of shader handles into which to load pre-compiled shader binaries. +
+binaryFormat
+
+
+
+ Specifies the format of the shader binaries contained in binary
.
+
binary
+
+
+ + Specifies the address of an array of bytes containing pre-compiled binary shader code. +
+length
+
+
+
+ Specifies the length of the array whose address is given in binary
.
+
+ glShaderBinary
loads pre-compiled shader binary code into the count
+ shader objects whose handles are given in shaders
. binary
+ points to length
bytes of binary shader code stored in client memory.
+ binaryFormat
specifies the format of the pre-compiled code.
+
+ The binary image contained in binary
will be decoded according to the extension
+ specification defining the specified binaryFormat
token. OpenGL ES
+ does not define any specific binary formats, but it does provide a mechanism to obtain token
+ vaues for such formats provided by such extensions.
+
+ Depending on the types of the shader objects in shaders
, glShaderBinary
+ will individually load binary vertex or fragment shaders, or load an executable binary that contains an optimized
+ pair of vertex and fragment shaders stored in the same binary.
+
+ GL_INVALID_OPERATION
is generated if more than one of the handles in
+ shaders
refers to the same shader object.
+
+ GL_INVALID_ENUM
is generated if binaryFormat
is not an
+ accepted value.
+
+ GL_INVALID_VALUE
is generated if the data pointed to by binary
+ does not match the format specified by binaryFormat
.
+
+ glGet with parameter GL_NUM_SHADER_BINARY_FORMATS
.
+
+ glGet with parameter GL_SHADER_BINARY_FORMATS
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glShaderBinary | +✔ | +✔ | +
+ glGetProgramiv, + glGetProgramBinary, + glProgramBinary +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glShaderSource — Replaces the source code in a shader object
+
+ void glShaderSource(
+ |
+ GLuint shader, | +
+ | GLsizei count, | +
+ | const GLchar **string, | +
+ | const GLint *length) ; |
+
shader
+
+
+ Specifies the handle of the shader object + whose source code is to be replaced.
+count
+
+
+ Specifies the number of elements in the
+ string
and
+ length
+ arrays.
string
+
+
+ Specifies an array of pointers to strings + containing the source code to be loaded into the + shader.
+length
+
+
+ Specifies an array of string lengths.
+glShaderSource
sets the source code
+ in shader
to the source code in the array
+ of strings specified by string
. Any
+ source code previously stored in the shader object is completely
+ replaced. The number of strings in the array is specified by
+ count
. If length
+ is NULL
, each string is assumed to be null
+ terminated. If length
is a value other
+ than NULL
, it points to an array containing
+ a string length for each of the corresponding elements of
+ string
. Each element in the
+ length
array may contain the length of
+ the corresponding string (the null character is not counted as
+ part of the string length) or a value less than 0 to indicate
+ that the string is null terminated. The source code strings are
+ not scanned or parsed at this time; they are simply copied into
+ the specified shader object.
The GL copies the shader source code strings when
+ glShaderSource
is called, so an application
+ may free its copy of the source code strings immediately after
+ the function returns.
GL_INVALID_VALUE
is generated if
+ shader
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ shader
is not a shader object.
GL_INVALID_VALUE
is generated if
+ count
is less than 0.
glGetShaderiv
+ with arguments shader
and
+ GL_SHADER_SOURCE_LENGTH
glGetShaderSource
+ with argument shader
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glShaderSource | +✔ | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glStencilFunc — set front and back function and reference value for stencil testing
+
+ void glStencilFunc(
+ |
+ GLenum func, | +
+ | GLint ref, | +
+ | GLuint mask) ; |
+
func
+
+
+
+ Specifies the test function.
+ Eight symbolic constants are valid:
+ GL_NEVER
,
+ GL_LESS
,
+ GL_LEQUAL
,
+ GL_GREATER
,
+ GL_GEQUAL
,
+ GL_EQUAL
,
+ GL_NOTEQUAL
, and
+ GL_ALWAYS
. The initial value is GL_ALWAYS
.
+
ref
+
+
+
+ Specifies the reference value for the stencil test.
+ Stencil comparison operations and queries of
+ ref
clamp its value to the range
+ ,
+ where
+
+ is the number of bitplanes in the stencil buffer. The
+ initial value is 0.
+
mask
+
+
+ + Specifies a mask that is ANDed with both the reference value + and the stored stencil value when the test is done. The initial value + is all 1's. +
++ Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + Stencil planes are first drawn into using GL drawing primitives, then + geometry and images are rendered using the stencil planes to mask out + portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering. +
+
+ The stencil test conditionally eliminates a pixel based on the outcome
+ of a comparison between the reference value
+ and the value in the stencil buffer.
+ To enable and disable the test, call glEnable and glDisable
+ with argument GL_STENCIL_TEST
.
+ To specify actions based on the outcome of the stencil test, call
+ glStencilOp or
+ glStencilOpSeparate.
+
+ There can be two separate sets of func
, ref
, and
+ mask
parameters; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilFunc
sets both front
+ and back stencil state to the same values. Use glStencilFuncSeparate
+ to set front and back stencil state to different values.
+
+ func
is a symbolic constant that determines the stencil comparison function.
+ It accepts one of eight values,
+ shown in the following list.
+ ref
is an integer reference value that is used in the stencil comparison.
+ Stencil comparison operations and queries clamp the value to the range
+ mask
is bitwise ANDed with both the reference value
+ and the stored stencil value,
+ with the ANDed values participating in the comparison.
+
+ If stencil represents the value stored in the corresponding
+ stencil buffer location,
+ the following list shows the effect of each comparison function
+ that can be specified by func
.
+ Only if the comparison succeeds is the pixel passed through
+ to the next stage in the rasterization process
+ (see glStencilOp).
+ All tests treat stencil values as unsigned integers in the range
+
+ The following values are accepted by func
:
+
GL_NEVER
+
+ + Always fails. +
+GL_LESS
+
+
+ Passes if ( ref
& mask
) < ( stencil & mask
).
+
GL_LEQUAL
+
+
+ Passes if ( ref
& mask
) <= ( stencil & mask
).
+
GL_GREATER
+
+
+ Passes if ( ref
& mask
) > ( stencil & mask
).
+
GL_GEQUAL
+
+
+ Passes if ( ref
& mask
) >= ( stencil & mask
).
+
GL_EQUAL
+
+
+ Passes if ( ref
& mask
) = ( stencil & mask
).
+
GL_NOTEQUAL
+
+
+ Passes if ( ref
& mask
) != ( stencil & mask
).
+
GL_ALWAYS
+
+ + Always passes. +
++ Initially, the stencil test is disabled. + If there is no stencil buffer, + no stencil modification can occur and it is as if + the stencil test always passes. +
+
+ glStencilFunc
is the same as
+ calling glStencilFuncSeparate
+ with face
set to GL_FRONT_AND_BACK
.
+
+ GL_INVALID_ENUM
is generated if func
is not one of the eight
+ accepted values.
+
+ glGet with argument
+ GL_STENCIL_FUNC
, GL_STENCIL_VALUE_MASK
,
+ GL_STENCIL_REF
, GL_STENCIL_BACK_FUNC
,
+ GL_STENCIL_BACK_VALUE_MASK
, GL_STENCIL_BACK_REF
,
+ or GL_STENCIL_BITS
+
+ glIsEnabled with argument GL_STENCIL_TEST
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glStencilFunc | +✔ | +✔ | +
+ glDepthFunc, + glEnable, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glStencilFuncSeparate — set front and/or back function and reference value for stencil testing
+
+ void glStencilFuncSeparate(
+ |
+ GLenum face, | +
+ | GLenum func, | +
+ | GLint ref, | +
+ | GLuint mask) ; |
+
face
+
+
+
+ Specifies whether front and/or back stencil state is updated.
+ Three symbolic constants are valid:
+ GL_FRONT
,
+ GL_BACK
, and
+ GL_FRONT_AND_BACK
.
+
func
+
+
+
+ Specifies the test function.
+ Eight symbolic constants are valid:
+ GL_NEVER
,
+ GL_LESS
,
+ GL_LEQUAL
,
+ GL_GREATER
,
+ GL_GEQUAL
,
+ GL_EQUAL
,
+ GL_NOTEQUAL
, and
+ GL_ALWAYS
. The initial value is GL_ALWAYS
.
+
ref
+
+
+
+ Specifies the reference value for the stencil test.
+ Stencil comparison operations and queries of
+ ref
clamp its value to the range
+ ,
+ where
+
+ is the number of bitplanes in the stencil buffer. The
+ initial value is 0.
+
mask
+
+
+ + Specifies a mask that is ANDed with both the reference value + and the stored stencil value when the test is done. The initial value + is all 1's. +
++ Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + You draw into the stencil planes using GL drawing primitives, + then render geometry and images, + using the stencil planes to mask out portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering. +
+
+ The stencil test conditionally eliminates a pixel based on the outcome
+ of a comparison between the reference value
+ and the value in the stencil buffer.
+ To enable and disable the test, call glEnable and glDisable
+ with argument GL_STENCIL_TEST
.
+ To specify actions based on the outcome of the stencil test, call
+ glStencilOp or
+ glStencilOpSeparate.
+
+ There can be two separate sets of func
, ref
, and
+ mask
parameters; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilFunc sets both front
+ and back stencil state to the same values, as if
+ glStencilFuncSeparate
were called
+ with face
set to GL_FRONT_AND_BACK
.
+
+ func
is a symbolic constant that determines the stencil comparison function.
+ It accepts one of eight values,
+ shown in the following list.
+ ref
is an integer reference value that is used in the stencil comparison.
+ Stencil comparison operations and queries clamp the value to the range
+ mask
is bitwise ANDed with both the reference value
+ and the stored stencil value,
+ with the ANDed values participating in the comparison.
+
+ If stencil represents the value stored in the corresponding
+ stencil buffer location,
+ the following list shows the effect of each comparison function
+ that can be specified by func
.
+ Only if the comparison succeeds is the pixel passed through
+ to the next stage in the rasterization process
+ (see glStencilOp).
+ All tests treat stencil values as unsigned integers in the range
+
+ The following values are accepted by func
:
+
GL_NEVER
+
+ + Always fails. +
+GL_LESS
+
+
+ Passes if ( ref
& mask
) < ( stencil & mask
).
+
GL_LEQUAL
+
+
+ Passes if ( ref
& mask
) <= ( stencil & mask
).
+
GL_GREATER
+
+
+ Passes if ( ref
& mask
) > ( stencil & mask
).
+
GL_GEQUAL
+
+
+ Passes if ( ref
& mask
) >= ( stencil & mask
).
+
GL_EQUAL
+
+
+ Passes if ( ref
& mask
) = ( stencil & mask
).
+
GL_NOTEQUAL
+
+
+ Passes if ( ref
& mask
) != ( stencil & mask
).
+
GL_ALWAYS
+
+ + Always passes. +
++ Initially, the stencil test is disabled. + If there is no stencil buffer, + no stencil modification can occur and it is as if + the stencil test always passes. +
+
+ GL_INVALID_ENUM
is generated if func
is not one of the eight
+ accepted values.
+
+ glGet with argument
+ GL_STENCIL_FUNC
, GL_STENCIL_VALUE_MASK
,
+ GL_STENCIL_REF
, GL_STENCIL_BACK_FUNC
,
+ GL_STENCIL_BACK_VALUE_MASK
, GL_STENCIL_BACK_REF
,
+ or GL_STENCIL_BITS
+
+ glIsEnabled with argument GL_STENCIL_TEST
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glStencilFuncSeparate | +✔ | +✔ | +
+ glDepthFunc, + glEnable, + glStencilFunc, + glStencilMask, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glStencilMask — control the front and back writing of individual bits in the stencil planes
+
+ void glStencilMask(
+ |
+ GLuint mask) ; |
+
mask
+
+
+ + Specifies a bit mask to enable and disable writing of individual bits + in the stencil planes. + Initially, the mask is all 1's. +
+
+ glStencilMask
controls the writing of individual bits in the stencil planes.
+ The least significant
+ mask
,
+ where
+
+ There can be two separate mask
writemasks; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilMask
sets both front
+ and back stencil writemasks to the same values. Use glStencilMaskSeparate
+ to set front and back stencil writemasks to different values.
+
+ glStencilMask
is the same as
+ calling glStencilMaskSeparate
+ with face
set to GL_FRONT_AND_BACK
.
+
+ glGet with argument
+ GL_STENCIL_WRITEMASK
, GL_STENCIL_BACK_WRITEMASK
,
+ or GL_STENCIL_BITS
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glStencilMask | +✔ | +✔ | +
+ glColorMask, + glDepthMask, + glStencilFunc, + glStencilFuncSeparate, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glStencilMaskSeparate — control the front and/or back writing of individual bits in the stencil planes
+
+ void glStencilMaskSeparate(
+ |
+ GLenum face, | +
+ | GLuint mask) ; |
+
face
+
+
+
+ Specifies whether the front and/or back stencil writemask is updated.
+ Three symbolic constants are valid:
+ GL_FRONT
,
+ GL_BACK
, and
+ GL_FRONT_AND_BACK
.
+
mask
+
+
+ + Specifies a bit mask to enable and disable writing of individual bits + in the stencil planes. + Initially, the mask is all 1's. +
+
+ glStencilMaskSeparate
controls the writing of individual bits in the stencil planes.
+ The least significant
+ mask
,
+ where
+
+ There can be two separate mask
writemasks; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilMask sets both front
+ and back stencil writemasks to the same values, as if
+ glStencilMaskSeparate were called
+ with face
set to GL_FRONT_AND_BACK
.
+
+ GL_INVALID_ENUM
is generated if face
is not one of the accepted tokens.
+
+ glGet with argument
+ GL_STENCIL_WRITEMASK
, GL_STENCIL_BACK_WRITEMASK
,
+ or GL_STENCIL_BITS
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glStencilMaskSeparate | +✔ | +✔ | +
+ glColorMask, + glDepthMask, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilOp, + glStencilOpSeparate +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glStencilOp — set front and back stencil test actions
+
+ void glStencilOp(
+ |
+ GLenum sfail, | +
+ | GLenum dpfail, | +
+ | GLenum dppass) ; |
+
sfail
+
+
+
+ Specifies the action to take when the stencil test fails.
+ Eight symbolic constants are accepted:
+ GL_KEEP
,
+ GL_ZERO
,
+ GL_REPLACE
,
+ GL_INCR
,
+ GL_INCR_WRAP
,
+ GL_DECR
,
+ GL_DECR_WRAP
, and
+ GL_INVERT
. The initial value is GL_KEEP
.
+
dpfail
+
+
+
+ Specifies the stencil action when the stencil test passes,
+ but the depth test fails.
+ dpfail
accepts the same symbolic constants as sfail
. The initial value
+ is GL_KEEP
.
+
dppass
+
+
+
+ Specifies the stencil action when both the stencil test and the depth
+ test pass, or when the stencil test passes and either there is no
+ depth buffer or depth testing is not enabled.
+ dppass
accepts the same symbolic constants as sfail
. The initial value
+ is GL_KEEP
.
+
+ Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + You draw into the stencil planes using GL drawing primitives, + then render geometry and images, + using the stencil planes to mask out portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering. +
+
+ The stencil test conditionally eliminates a pixel based on the outcome
+ of a comparison between the value in the stencil buffer and a
+ reference value. To enable and disable the test, call glEnable
+ and glDisable with argument
+ GL_STENCIL_TEST
; to control it, call
+ glStencilFunc or
+ glStencilFuncSeparate.
+
+ There can be two separate sets of sfail
, dpfail
, and
+ dppass
parameters; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilOp
sets both front
+ and back stencil state to the same values. Use glStencilOpSeparate
+ to set front and back stencil state to different values.
+
+ glStencilOp
takes three arguments that indicate what happens
+ to the stored stencil value while stenciling is enabled.
+ If the stencil test fails,
+ no change is made to the pixel's color or depth buffers,
+ and sfail
specifies what happens to the stencil buffer contents.
+ The following eight actions are possible.
+
GL_KEEP
+
+ + Keeps the current value. +
+GL_ZERO
+
+ + Sets the stencil buffer value to 0. +
+GL_REPLACE
+
+ + Sets the stencil buffer value to ref, + as specified by glStencilFunc. +
+GL_INCR
+
+ + Increments the current stencil buffer value. + Clamps to the maximum representable unsigned value. +
+GL_INCR_WRAP
+
+ + Increments the current stencil buffer value. + Wraps stencil buffer value to zero when incrementing the maximum + representable unsigned value. +
+GL_DECR
+
+ + Decrements the current stencil buffer value. + Clamps to 0. +
+GL_DECR_WRAP
+
+ + Decrements the current stencil buffer value. + Wraps stencil buffer value to the maximum representable unsigned value when + decrementing a stencil buffer value of zero. +
+GL_INVERT
+
+ + Bitwise inverts the current stencil buffer value. +
+
+ Stencil buffer values are treated as unsigned integers.
+ When incremented and decremented,
+ values are clamped to 0 and
+ GL_STENCIL_BITS
.
+
+ The other two arguments to glStencilOp
specify stencil buffer actions
+ that depend on whether subsequent depth buffer tests succeed (dppass
)
+ or fail (dpfail
) (see
+ glDepthFunc).
+ The actions are specified using the same eight symbolic constants as sfail
.
+ Note that dpfail
is ignored when there is no depth buffer,
+ or when the depth buffer is not enabled.
+ In these cases, sfail
and dppass
specify stencil action when the
+ stencil test fails and passes,
+ respectively.
+
+ Initially the stencil test is disabled.
+ If there is no stencil buffer,
+ no stencil modification can occur
+ and it is as if the stencil tests always pass,
+ regardless of any call to glStencilOp
.
+
+ glStencilOp
is the same as
+ calling glStencilOpSeparate
+ with face
set to GL_FRONT_AND_BACK
.
+
+ GL_INVALID_ENUM
is generated if sfail
,
+ dpfail
, or dppass
is any value other than the defined constant values.
+
+ glGet with argument
+ GL_STENCIL_FAIL
, GL_STENCIL_PASS_DEPTH_PASS
,
+ GL_STENCIL_PASS_DEPTH_FAIL
, GL_STENCIL_BACK_FAIL
,
+ GL_STENCIL_BACK_PASS_DEPTH_PASS
, GL_STENCIL_BACK_PASS_DEPTH_FAIL
,
+ or GL_STENCIL_BITS
+
+ glIsEnabled with argument GL_STENCIL_TEST
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glStencilOp | +✔ | +✔ | +
+ glDepthFunc, + glEnable, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOpSeparate +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glStencilOpSeparate — set front and/or back stencil test actions
+
+ void glStencilOpSeparate(
+ |
+ GLenum face, | +
+ | GLenum sfail, | +
+ | GLenum dpfail, | +
+ | GLenum dppass) ; |
+
face
+
+
+
+ Specifies whether front and/or back stencil state is updated.
+ Three symbolic constants are valid:
+ GL_FRONT
,
+ GL_BACK
, and
+ GL_FRONT_AND_BACK
.
+
sfail
+
+
+
+ Specifies the action to take when the stencil test fails.
+ Eight symbolic constants are accepted:
+ GL_KEEP
,
+ GL_ZERO
,
+ GL_REPLACE
,
+ GL_INCR
,
+ GL_INCR_WRAP
,
+ GL_DECR
,
+ GL_DECR_WRAP
, and
+ GL_INVERT
. The initial value is GL_KEEP
.
+
dpfail
+
+
+
+ Specifies the stencil action when the stencil test passes,
+ but the depth test fails.
+ dpfail
accepts the same symbolic constants as sfail
. The initial value
+ is GL_KEEP
.
+
dppass
+
+
+
+ Specifies the stencil action when both the stencil test and the depth
+ test pass, or when the stencil test passes and either there is no
+ depth buffer or depth testing is not enabled.
+ dppass
accepts the same symbolic constants as sfail
. The initial value
+ is GL_KEEP
.
+
+ Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + You draw into the stencil planes using GL drawing primitives, + then render geometry and images, + using the stencil planes to mask out portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering. +
+
+ The stencil test conditionally eliminates a pixel based on the outcome
+ of a comparison between the value in the stencil buffer and a
+ reference value. To enable and disable the test, call glEnable
+ and glDisable with argument
+ GL_STENCIL_TEST
; to control it, call
+ glStencilFunc or
+ glStencilFuncSeparate.
+
+ There can be two separate sets of sfail
, dpfail
, and
+ dppass
parameters; one affects back-facing polygons, and the other
+ affects front-facing polygons as well as other non-polygon primitives.
+ glStencilOp sets both front
+ and back stencil state to the same values, as if
+ glStencilOpSeparate
were called
+ with face
set to GL_FRONT_AND_BACK
.
+
+ glStencilOpSeparate
takes three arguments that indicate what happens
+ to the stored stencil value while stenciling is enabled.
+ If the stencil test fails,
+ no change is made to the pixel's color or depth buffers,
+ and sfail
specifies what happens to the stencil buffer contents.
+ The following eight actions are possible.
+
GL_KEEP
+
+ + Keeps the current value. +
+GL_ZERO
+
+ + Sets the stencil buffer value to 0. +
+GL_REPLACE
+
+ + Sets the stencil buffer value to ref, + as specified by glStencilFunc. +
+GL_INCR
+
+ + Increments the current stencil buffer value. + Clamps to the maximum representable unsigned value. +
+GL_INCR_WRAP
+
+ + Increments the current stencil buffer value. + Wraps stencil buffer value to zero when incrementing the maximum + representable unsigned value. +
+GL_DECR
+
+ + Decrements the current stencil buffer value. + Clamps to 0. +
+GL_DECR_WRAP
+
+ + Decrements the current stencil buffer value. + Wraps stencil buffer value to the maximum representable unsigned value when + decrementing a stencil buffer value of zero. +
+GL_INVERT
+
+ + Bitwise inverts the current stencil buffer value. +
+
+ Stencil buffer values are treated as unsigned integers.
+ When incremented and decremented,
+ values are clamped to 0 and
+ GL_STENCIL_BITS
.
+
+ The other two arguments to glStencilOpSeparate
specify stencil buffer actions
+ that depend on whether subsequent depth buffer tests succeed (dppass
)
+ or fail (dpfail
) (see
+ glDepthFunc).
+ The actions are specified using the same eight symbolic constants as sfail
.
+ Note that dpfail
is ignored when there is no depth buffer,
+ or when the depth buffer is not enabled.
+ In these cases, sfail
and dppass
specify stencil action when the
+ stencil test fails and passes,
+ respectively.
+
+ Initially the stencil test is disabled. + If there is no stencil buffer, + no stencil modification can occur + and it is as if the stencil test always passes. +
+
+ GL_INVALID_ENUM
is generated if face
is any value
+ other than GL_FRONT
, GL_BACK
, or GL_FRONT_AND_BACK
.
+
+ GL_INVALID_ENUM
is generated if sfail
,
+ dpfail
, or dppass
is any value other than the eight defined constant values.
+
+ glGet with argument
+ GL_STENCIL_FAIL
, GL_STENCIL_PASS_DEPTH_PASS
,
+ GL_STENCIL_PASS_DEPTH_FAIL
, GL_STENCIL_BACK_FAIL
,
+ GL_STENCIL_BACK_PASS_DEPTH_PASS
, GL_STENCIL_BACK_PASS_DEPTH_FAIL
,
+ or GL_STENCIL_BITS
+
+ glIsEnabled with argument GL_STENCIL_TEST
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glStencilOpSeparate | +✔ | +✔ | +
+ glDepthFunc, + glEnable, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOp +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glTexImage2D — specify a two-dimensional texture image
+
+ void glTexImage2D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLint internalFormat, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLint border, | +
+ | GLenum format, | +
+ | GLenum type, | +
+ | const GLvoid * data) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+internalFormat
+
+
+ + Specifies the number of color components in the texture. + Must be one of base internal formats given in Table 1, or + one of the sized internal formats given in Table 2, below. +
+width
+
+
+ + Specifies the width of the texture image. + All implementations support texture images that are at least 2048 texels + wide. +
+height
+
+
+ + Specifies the height of the texture image. + All implementations support texture images that are at least 2048 texels + high. +
+border
+
+
+ + This value must be 0. +
+format
+
+
+
+ Specifies the format of the pixel data.
+ The following symbolic values are accepted:
+ GL_RED
,
+ GL_RED_INTEGER
,
+ GL_RG
,
+ GL_RG_INTEGER
,
+ GL_RGB
,
+ GL_RGB_INTEGER
,
+ GL_RGBA
,
+ GL_RGBA_INTEGER
,
+ GL_DEPTH_COMPONENT
,
+ GL_DEPTH_STENCIL
,
+ GL_LUMINANCE_ALPHA
,
+ GL_LUMINANCE
, and
+ GL_ALPHA
.
+
type
+
+
+
+ Specifies the data type of the pixel data.
+ The following symbolic values are accepted:
+ GL_UNSIGNED_BYTE
,
+ GL_BYTE
,
+ GL_UNSIGNED_SHORT
,
+ GL_SHORT
,
+ GL_UNSIGNED_INT
,
+ GL_INT
,
+ GL_HALF_FLOAT
,
+ GL_FLOAT
,
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
,
+ GL_UNSIGNED_SHORT_5_5_5_1
,
+ GL_UNSIGNED_INT_2_10_10_10_REV
,
+ GL_UNSIGNED_INT_10F_11F_11F_REV
,
+ GL_UNSIGNED_INT_5_9_9_9_REV
,
+ GL_UNSIGNED_INT_24_8
, and
+ GL_FLOAT_32_UNSIGNED_INT_24_8_REV
.
+
data
+
+
+ + Specifies a pointer to the image data in memory. +
++ Texturing allows elements of an image array to be read by shaders. +
+
+ To define texture images, call glTexImage2D
.
+ The arguments describe the parameters of the texture image,
+ such as height, width, width of the border, level-of-detail number
+ (see glTexParameter),
+ and number of color components provided.
+ The last three arguments describe how the image is represented in memory.
+
+ If target
is GL_TEXTURE_2D
+ or one of the GL_TEXTURE_CUBE_MAP
+ targets, data is read from data
as a sequence of signed or unsigned
+ bytes, shorts, or longs, or single-precision floating-point values,
+ depending on type
. These values are grouped into sets of one, two,
+ three, or four values, depending on format
, to form elements.
+
+ If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER
target
+ (see glBindBuffer) while a texture image is
+ specified, data
is treated as a byte offset into the buffer object's data store.
+
+ The first element corresponds to the lower left corner of the texture image. + Subsequent elements progress left-to-right through the remaining texels + in the lowest row of the texture image, and then in successively higher + rows of the texture image. + The final element corresponds to the upper right corner of the texture + image. +
+
+ format
determines the composition of each element in data
.
+ It can assume one of these symbolic values:
+
GL_RED
+
+ + Each element is a single red component. + For fixed point normalized components, the GL converts it to floating point, clamps to the range [0,1], + and assembles it into an RGBA element by attaching 0.0 for green and blue, and 1.0 for alpha. +
+GL_RED_INTEGER
+
+ + Each element is a single red component. + The GL performs assembles it into an RGBA element by attaching 0 for green and blue, and 1 for alpha. +
+GL_RG
+
+ + Each element is a red/green double. + For fixed point normalized components, the GL converts each component to floating point, clamps to the range [0,1], + and assembles them into an RGBA element by attaching 0.0 for blue, and 1.0 for alpha. +
+GL_RG
+
+ + Each element is a red/green double. + The GL assembles them into an RGBA element by attaching 0 for blue, and 1 for alpha. +
+GL_RGB
+
+ + Each element is an RGB triple. + For fixed point normalized components, the GL converts each component to floating point, clamps to the range [0,1], + and assembles them into an RGBA element by attaching 1.0 for alpha. +
+GL_RGB_INTEGER
+
+ + Each element is an RGB triple. + The GL assembles them into an RGBA element by attaching 1 for alpha. +
+GL_RGBA
+
+ + Each element contains all four components. + For fixed point normalized components, the GL converts each component to floating point and + clamps them to the range [0,1]. +
+GL_RGBA_INTEGER
+
+ + Each element contains all four components. +
+GL_DEPTH_COMPONENT
+
+ + Each element is a single depth value. + The GL converts it to floating point, and clamps to the range [0,1]. +
+GL_DEPTH_STENCIL
+
+
+ Each element is a pair of depth and stencil values. The depth component of
+ the pair is interpreted as in GL_DEPTH_COMPONENT
. The stencil
+ component is interpreted based on specified the depth + stencil internal format.
+
GL_LUMINANCE_ALPHA
+
+ + Each element is an luminance/alpha double. + The GL converts each component to floating point, clamps to the range [0,1], + and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels. +
+GL_LUMINANCE
+
+ + Each element is a single luminance component. + The GL converts it to floating point, clamps to the range [0,1], + and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, + and attaching 1.0 to the alpha channel. +
+GL_ALPHA
+
+ + Each element is a single alpha component. + The GL converts it to floating point, clamps to the range [0,1], + and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels. +
+
+ If an application wants to store the texture at a certain
+ resolution or in a certain format, it can request the resolution
+ and format with internalFormat
. The GL will choose an internal
+ representation with least the internal component sizes, and exactly the component types shown for that
+ format, although it may not match exactly.
+
+ internalFormat
may be one of the unsized (base) internal formats shown, together with valid
+ format
and type
combinations, in Table 1, below
+
+
++ Unsized Internal Format + | ++ Format + | ++ Type + | ++ RGBA and Luminance Values + | ++ Internal Components + | +
---|---|---|---|---|
+ GL_RGB
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_6_5 |
+ Red, Green, Blue | +R, G, B | +
+ GL_RGBA
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_4_4_4_4 ,
+ GL_UNSIGNED_SHORT_5_5_5_1 |
+ Red, Green, Blue, Alpha | +R, G, B, A | +
+ GL_LUMINANCE_ALPHA
+ |
+
+ GL_LUMINANCE_ALPHA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ Luminance, Alpha | +L, A | +
+ GL_LUMINANCE
+ |
+
+ GL_LUMINANCE
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ Luminance | +L | +
+ GL_ALPHA
+ |
+
+ GL_ALPHA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ Alpha | +A | +
+
+ internalFormat
may also be one of the sized internal formats shown, together with valid
+ format
and type
combinations, in Table 2, below
+
+
++ Sized Internal Format + | ++ Format + | ++ Type + | ++ Red Bits + | ++ Green Bits + | ++ Blue Bits + | ++ Alpha Bits + | ++ Shared Bits + | ++ Color renderable + | ++ Texture filterable + | +
---|---|---|---|---|---|---|---|---|---|
+ GL_R8
+ |
+
+ GL_RED
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | ++ | + | + | + | Y | +Y | +
+ GL_R8_SNORM
+ |
+
+ GL_RED
+ |
+
+ GL_BYTE
+ |
+ s8 | ++ | + | + | + | + | Y | +
+ GL_R16F
+ |
+
+ GL_RED
+ |
+ GL_HALF_FLOAT ,GL_FLOAT |
+ f16 | ++ | + | + | + | + | Y | +
+ GL_R32F
+ |
+
+ GL_RED
+ |
+
+ GL_FLOAT
+ |
+ f32 | ++ | + | + | + | + | + |
+ GL_R8UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | ++ | + | + | + | Y | ++ |
+ GL_R8I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | ++ | + | + | + | Y | ++ |
+ GL_R16UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | ++ | + | + | + | Y | ++ |
+ GL_R16I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | ++ | + | + | + | Y | ++ |
+ GL_R32UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | ++ | + | + | + | Y | ++ |
+ GL_R32I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | ++ | + | + | + | Y | ++ |
+ GL_RG8
+ |
+
+ GL_RG
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | ++ | + | + | Y | +Y | +
+ GL_RG8_SNORM
+ |
+
+ GL_RG
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | ++ | + | + | + | Y | +
+ GL_RG16F
+ |
+
+ GL_RG
+ |
+ GL_HALF_FLOAT ,GL_FLOAT |
+ f16 | +f16 | ++ | + | + | + | Y | +
+ GL_RG32F
+ |
+
+ GL_RG
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | ++ | + | + | + | + |
+ GL_RG8UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | ++ | + | + | Y | ++ |
+ GL_RG8I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | ++ | + | + | Y | ++ |
+ GL_RG16UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | ++ | + | + | Y | ++ |
+ GL_RG16I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | ++ | + | + | Y | ++ |
+ GL_RG32UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | ++ | + | + | Y | ++ |
+ GL_RG32I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | ++ | + | + | Y | ++ |
+ GL_RGB8
+ |
+
+ GL_RGB
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | ++ | + | Y | +Y | +
+ GL_SRGB8
+ |
+
+ GL_RGB
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | ++ | + | + | Y | +
+ GL_RGB565
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_6_5 |
+ 5 | +6 | +5 | ++ | + | Y | +Y | +
+ GL_RGB8_SNORM
+ |
+
+ GL_RGB
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | +s8 | ++ | + | + | Y | +
+ GL_R11F_G11F_B10F
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_INT_10F_11F_11F_REV ,
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f11 | +f11 | +f10 | ++ | + | + | Y | +
+ GL_RGB9_E5
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_INT_5_9_9_9_REV ,
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ 9 | +9 | +9 | ++ | 5 | ++ | Y | +
+ GL_RGB16F
+ |
+
+ GL_RGB
+ |
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f16 | +f16 | +f16 | ++ | + | + | Y | +
+ GL_RGB32F
+ |
+
+ GL_RGB
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | +f32 | ++ | + | + | + |
+ GL_RGB8UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | +ui8 | ++ | + | + | + |
+ GL_RGB8I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | +i8 | ++ | + | + | + |
+ GL_RGB16UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | +ui16 | ++ | + | + | + |
+ GL_RGB16I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | +i16 | ++ | + | + | + |
+ GL_RGB32UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | +ui32 | ++ | + | + | + |
+ GL_RGB32I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | +i32 | ++ | + | + | + |
+ GL_RGBA8
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | +8 | ++ | Y | +Y | +
+ GL_SRGB8_ALPHA8
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | +8 | ++ | Y | +Y | +
+ GL_RGBA8_SNORM
+ |
+
+ GL_RGBA
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | +s8 | +s8 | ++ | + | Y | +
+ GL_RGB5_A1
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_5_5_1 ,
+ GL_UNSIGNED_INT_2_10_10_10_REV |
+ 5 | +5 | +5 | +1 | ++ | Y | +Y | +
+ GL_RGBA4
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_4_4_4_4 |
+ 4 | +4 | +4 | +4 | ++ | Y | +Y | +
+ GL_RGB10_A2
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ |
+ 10 | +10 | +10 | +2 | ++ | Y | +Y | +
+ GL_RGBA16F
+ |
+
+ GL_RGBA
+ |
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f16 | +f16 | +f16 | +f16 | ++ | + | Y | +
+ GL_RGBA32F
+ |
+
+ GL_RGBA
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | +f32 | +f32 | ++ | + | + |
+ GL_RGBA8UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | +ui8 | +ui8 | ++ | Y | ++ |
+ GL_RGBA8I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | +i8 | +i8 | ++ | Y | ++ |
+ GL_RGB10_A2UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ |
+ ui10 | +ui10 | +ui10 | +ui2 | ++ | Y | ++ |
+ GL_RGBA16UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | +ui16 | +ui16 | ++ | Y | ++ |
+ GL_RGBA16I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | +i16 | +i16 | ++ | Y | ++ |
+ GL_RGBA32I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | +i32 | +i32 | ++ | Y | ++ |
+ GL_RGBA32UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | +ui32 | +ui32 | ++ | Y | ++ |
+ Sized Internal Format + | ++ Format + | ++ Type + | ++ Depth Bits + | ++ Stencil Bits + | +
---|---|---|---|---|
+ GL_DEPTH_COMPONENT16
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ GL_UNSIGNED_SHORT ,
+ GL_UNSIGNED_INT |
+ 16 | ++ |
+ GL_DEPTH_COMPONENT24
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+
+ GL_UNSIGNED_INT
+ |
+ 24 | ++ |
+ GL_DEPTH_COMPONENT32F
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+
+ GL_FLOAT
+ |
+ f32 | ++ |
+ GL_DEPTH24_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+
+ GL_UNSIGNED_INT_24_8
+ |
+ 24 | +8 | +
+ GL_DEPTH32F_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+
+ GL_FLOAT_32_UNSIGNED_INT_24_8_REV
+ |
+ f32 | +8 | +
+
+ If the internalFormat
parameter is
+ GL_SRGB8
, or
+ GL_SRGB8_ALPHA8
, the texture is treated as if the red, green, or blue components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component
+
+
+ Assume
+
+ A one-component texture image uses only the red component of the RGBA
+ color extracted from data
.
+ A two-component image uses the R and G values.
+ A three-component image uses the R, G, and B values.
+ A four-component image uses all of the RGBA components.
+
+ Image-based shadowing can be enabled by comparing texture r coordinates to + depth texture values to generate a boolean result. + See glTexParameter for details on texture comparison. +
++ The glPixelStorei mode affects texture images. +
+
+ data
may be a null pointer.
+ In this case, texture memory is
+ allocated to accommodate a texture of width width
and height height
.
+ You can then download subtextures to initialize this
+ texture memory.
+ The image is undefined if the user tries to apply
+ an uninitialized portion of the texture image to a primitive.
+
+ glTexImage2D
specifies the two-dimensional texture for the texture object bound to the current texture unit,
+ specified with glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is not
+ GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_ENUM
is generated if target
is one of the six cube map 2D image targets
+ and the width and height parameters are not equal.
+
+ GL_INVALID_ENUM
is generated if type
is not a type constant.
+
+ GL_INVALID_VALUE
is generated if width
is less than 0
+ or greater than GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater than
+ GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if internalFormat
is not one of the
+ accepted resolution and format symbolic constants.
+
+ GL_INVALID_VALUE
is generated if width
or height
is less than 0
+ or greater than GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if border
is not 0.
+
+ GL_INVALID_OPERATION
is generated if the combination of internalFormat
,
+ format
and type
is not one of those in the tables above.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the buffer object's data store is currently mapped.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the data would be unpacked from the buffer
+ object such that the memory reads required would exceed the data store size.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and data
is not evenly divisible
+ into the number of bytes needed to store in memory a datum indicated by type
.
+
+ glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glTexImage2D | +✔ | +✔ | +
+ glActiveTexture, + glCopyTexImage2D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glTexImage3D, + glTexStorage2D, + glTexStorage3D, + glTexSubImage2D, + glTexSubImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glTexImage3D — specify a three-dimensional texture image
+
+ void glTexImage3D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLint internalFormat, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLsizei depth, | +
+ | GLint border, | +
+ | GLenum format, | +
+ | GLenum type, | +
+ | const GLvoid * data) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be one of GL_TEXTURE_3D
or GL_TEXTURE_2D_ARRAY
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level + + is the + + mipmap reduction image. +
+internalFormat
+
+
+ + Specifies the number of color components in the texture. + Must be one of base internal formats given in Table 1, or + one of the sized internal formats given in Table 2, below. +
+width
+
+
+ + Specifies the width of the texture image. + All implementations support 3D texture images that are at least 256 texels + wide. +
+height
+
+
+ + Specifies the height of the texture image. + All implementations support 3D texture images that are at least 256 texels + high. +
+depth
+
+
+ + Specifies the depth of the texture image, or the number of layers in a texture array. + All implementations support 3D texture images that are at least 256 texels + deep, and texture arrays that are at least 256 layers deep. +
+border
+
+
+ + This value must be 0. +
+format
+
+
+
+ Specifies the format of the pixel data.
+ The following symbolic values are accepted:
+ GL_RED
,
+ GL_RED_INTEGER
,
+ GL_RG
,
+ GL_RG_INTEGER
,
+ GL_RGB
,
+ GL_RGB_INTEGER
,
+ GL_RGBA
,
+ GL_RGBA_INTEGER
,
+ GL_DEPTH_COMPONENT
,
+ GL_DEPTH_STENCIL
,
+ GL_LUMINANCE_ALPHA
,
+ GL_LUMINANCE
, and
+ GL_ALPHA
,
+
type
+
+
+
+ Specifies the data type of the pixel data.
+ The following symbolic values are accepted:
+ GL_UNSIGNED_BYTE
,
+ GL_BYTE
,
+ GL_UNSIGNED_SHORT
,
+ GL_SHORT
,
+ GL_UNSIGNED_INT
,
+ GL_INT
,
+ GL_HALF_FLOAT
,
+ GL_FLOAT
,
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
,
+ GL_UNSIGNED_SHORT_5_5_5_1
,
+ GL_UNSIGNED_INT_2_10_10_10_REV
,
+ GL_UNSIGNED_INT_10F_11F_11F_REV
,
+ GL_UNSIGNED_INT_5_9_9_9_REV
,
+ GL_UNSIGNED_INT_24_8
, and
+ GL_FLOAT_32_UNSIGNED_INT_24_8_REV
.
+
data
+
+
+ + Specifies a pointer to the image data in memory. +
++ Texturing allows elements of an image array to be read by shaders. +
+
+ To define texture images, call glTexImage3D
.
+ The arguments describe the parameters of the texture image,
+ such as height,
+ width, depth,
+ width of the border,
+ level-of-detail number
+ (see glTexParameter),
+ and number of color components provided.
+ The last three arguments describe how the image is represented in memory.
+
+ If target
is GL_TEXTURE_3D
,
+ data is read from data
as a sequence of signed or unsigned bytes,
+ shorts,
+ or longs,
+ or single-precision floating-point values,
+ depending on type
.
+ These values are grouped into sets of one,
+ two,
+ three,
+ or four values,
+ depending on format
,
+ to form elements.
+
+ If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER
target
+ (see glBindBuffer) while a texture image is
+ specified, data
is treated as a byte offset into the buffer object's data store.
+
+ The first element corresponds to the lower left corner of the texture + image. + Subsequent elements progress left-to-right through the remaining texels + in the lowest row of the texture image, and then in successively higher + rows of the texture image. + The final element corresponds to the upper right corner of the texture + image. +
+
+ format
determines the composition of each element in data
.
+ It can assume one of these symbolic values:
+
GL_RED
+
+ + Each element is a single red component. + For fixed point normalized components, the GL converts it to floating point, clamps to the range [0,1], + and assembles it into an RGBA element by attaching 0.0 for green and blue, and 1.0 for alpha. +
+GL_RED_INTEGER
+
+ + Each element is a single red component. + The GL performs assembles it into an RGBA element by attaching 0 for green and blue, and 1 for alpha. +
+GL_RG
+
+ + Each element is a red/green double. + For fixed point normalized components, the GL converts each component to floating point, clamps to the range [0,1], + and assembles them into an RGBA element by attaching 0.0 for blue, and 1.0 for alpha. +
+GL_RG
+
+ + Each element is a red/green double. + The GL assembles them into an RGBA element by attaching 0 for blue, and 1 for alpha. +
+GL_RGB
+
+ + Each element is an RGB triple. + For fixed point normalized components, the GL converts each component to floating point, clamps to the range [0,1], + and assembles them into an RGBA element by attaching 1.0 for alpha. +
+GL_RGB_INTEGER
+
+ + Each element is an RGB triple. + The GL assembles them into an RGBA element by attaching 1 for alpha. +
+GL_RGBA
+
+ + Each element contains all four components. + For fixed point normalized components, the GL converts each component to floating point and + clamps them to the range [0,1]. +
+GL_RGBA_INTEGER
+
+ + Each element contains all four components. +
+GL_DEPTH_COMPONENT
+
+ + Each element is a single depth value. + The GL converts it to floating point, and clamps to the range [0,1]. +
+GL_DEPTH_STENCIL
+
+
+ Each element is a pair of depth and stencil values. The depth component of
+ the pair is interpreted as in GL_DEPTH_COMPONENT
. The stencil
+ component is interpreted based on specified the depth + stencil internal format.
+
GL_LUMINANCE_ALPHA
+
+ + Each element is an luminance/alpha double. + The GL converts each component to floating point, clamps to the range [0,1], + and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels. +
+GL_LUMINANCE
+
+ + Each element is a single luminance component. + The GL converts it to floating point, clamps to the range [0,1], + and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, + and attaching 1.0 to the alpha channel. +
+GL_ALPHA
+
+ + Each element is a single alpha component. + The GL converts it to floating point, clamps to the range [0,1], + and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels. +
+
+ If an application wants to store the texture at a certain
+ resolution or in a certain format, it can request the resolution
+ and format with internalFormat
. The GL will choose an internal
+ representation with least the internal component sizes, and exactly the component types shown for that
+ format, although it may not match exactly.
+
+ internalFormat
may be one of the unsized (base) internal formats shown, together with valid
+ format
and type
combinations, in Table 1, below
+
+
++ Unsized Internal Format + | ++ Format + | ++ Type + | ++ RGBA and Luminance Values + | ++ Internal Components + | +
---|---|---|---|---|
+ GL_RGB
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_6_5 |
+ Red, Green, Blue | +R, G, B | +
+ GL_RGBA
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_4_4_4_4 ,
+ GL_UNSIGNED_SHORT_5_5_5_1 |
+ Red, Green, Blue, Alpha | +R, G, B, A | +
+ GL_LUMINANCE_ALPHA
+ |
+
+ GL_LUMINANCE_ALPHA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ Luminance, Alpha | +L, A | +
+ GL_LUMINANCE
+ |
+
+ GL_LUMINANCE
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ Luminance | +L | +
+ GL_ALPHA
+ |
+
+ GL_ALPHA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ Alpha | +A | +
+
+ internalFormat
may also be one of the sized internal formats shown, together with valid
+ format
and type
combinations, in Table 2, below
+
+
++ Sized Internal Format + | ++ Format + | ++ Type + | ++ Red Bits + | ++ Green Bits + | ++ Blue Bits + | ++ Alpha Bits + | ++ Shared Bits + | ++ Color renderable + | ++ Texture filterable + | +
---|---|---|---|---|---|---|---|---|---|
+ GL_R8
+ |
+
+ GL_RED
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | ++ | + | + | + | Y | +Y | +
+ GL_R8_SNORM
+ |
+
+ GL_RED
+ |
+
+ GL_BYTE
+ |
+ s8 | ++ | + | + | + | + | Y | +
+ GL_R16F
+ |
+
+ GL_RED
+ |
+ GL_HALF_FLOAT ,GL_FLOAT |
+ f16 | ++ | + | + | + | + | Y | +
+ GL_R32F
+ |
+
+ GL_RED
+ |
+
+ GL_FLOAT
+ |
+ f32 | ++ | + | + | + | + | + |
+ GL_R8UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | ++ | + | + | + | Y | ++ |
+ GL_R8I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | ++ | + | + | + | Y | ++ |
+ GL_R16UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | ++ | + | + | + | Y | ++ |
+ GL_R16I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | ++ | + | + | + | Y | ++ |
+ GL_R32UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | ++ | + | + | + | Y | ++ |
+ GL_R32I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | ++ | + | + | + | Y | ++ |
+ GL_RG8
+ |
+
+ GL_RG
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | ++ | + | + | Y | +Y | +
+ GL_RG8_SNORM
+ |
+
+ GL_RG
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | ++ | + | + | + | Y | +
+ GL_RG16F
+ |
+
+ GL_RG
+ |
+ GL_HALF_FLOAT ,GL_FLOAT |
+ f16 | +f16 | ++ | + | + | + | Y | +
+ GL_RG32F
+ |
+
+ GL_RG
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | ++ | + | + | + | + |
+ GL_RG8UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | ++ | + | + | Y | ++ |
+ GL_RG8I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | ++ | + | + | Y | ++ |
+ GL_RG16UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | ++ | + | + | Y | ++ |
+ GL_RG16I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | ++ | + | + | Y | ++ |
+ GL_RG32UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | ++ | + | + | Y | ++ |
+ GL_RG32I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | ++ | + | + | Y | ++ |
+ GL_RGB8
+ |
+
+ GL_RGB
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | ++ | + | Y | +Y | +
+ GL_SRGB8
+ |
+
+ GL_RGB
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | ++ | + | + | Y | +
+ GL_RGB565
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_6_5 |
+ 5 | +6 | +5 | ++ | + | Y | +Y | +
+ GL_RGB8_SNORM
+ |
+
+ GL_RGB
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | +s8 | ++ | + | + | Y | +
+ GL_R11F_G11F_B10F
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_INT_10F_11F_11F_REV ,
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f11 | +f11 | +f10 | ++ | + | + | Y | +
+ GL_RGB9_E5
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_INT_5_9_9_9_REV ,
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ 9 | +9 | +9 | ++ | 5 | ++ | Y | +
+ GL_RGB16F
+ |
+
+ GL_RGB
+ |
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f16 | +f16 | +f16 | ++ | + | + | Y | +
+ GL_RGB32F
+ |
+
+ GL_RGB
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | +f32 | ++ | + | + | + |
+ GL_RGB8UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | +ui8 | ++ | + | + | + |
+ GL_RGB8I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | +i8 | ++ | + | + | + |
+ GL_RGB16UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | +ui16 | ++ | + | + | + |
+ GL_RGB16I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | +i16 | ++ | + | + | + |
+ GL_RGB32UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | +ui32 | ++ | + | + | + |
+ GL_RGB32I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | +i32 | ++ | + | + | + |
+ GL_RGBA8
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | +8 | ++ | Y | +Y | +
+ GL_SRGB8_ALPHA8
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | +8 | ++ | Y | +Y | +
+ GL_RGBA8_SNORM
+ |
+
+ GL_RGBA
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | +s8 | +s8 | ++ | + | Y | +
+ GL_RGB5_A1
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_5_5_1 ,
+ GL_UNSIGNED_INT_2_10_10_10_REV |
+ 5 | +5 | +5 | +1 | ++ | Y | +Y | +
+ GL_RGBA4
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_4_4_4_4 |
+ 4 | +4 | +4 | +4 | ++ | Y | +Y | +
+ GL_RGB10_A2
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ |
+ 10 | +10 | +10 | +2 | ++ | Y | +Y | +
+ GL_RGBA16F
+ |
+
+ GL_RGBA
+ |
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f16 | +f16 | +f16 | +f16 | ++ | + | Y | +
+ GL_RGBA32F
+ |
+
+ GL_RGBA
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | +f32 | +f32 | ++ | + | + |
+ GL_RGBA8UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | +ui8 | +ui8 | ++ | Y | ++ |
+ GL_RGBA8I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | +i8 | +i8 | ++ | Y | ++ |
+ GL_RGB10_A2UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ |
+ ui10 | +ui10 | +ui10 | +ui2 | ++ | Y | ++ |
+ GL_RGBA16UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | +ui16 | +ui16 | ++ | Y | ++ |
+ GL_RGBA16I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | +i16 | +i16 | ++ | Y | ++ |
+ GL_RGBA32I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | +i32 | +i32 | ++ | Y | ++ |
+ GL_RGBA32UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | +ui32 | +ui32 | ++ | Y | ++ |
+ Sized Internal Format + | ++ Format + | ++ Type + | ++ Depth Bits + | ++ Stencil Bits + | +
---|---|---|---|---|
+ GL_DEPTH_COMPONENT16
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ GL_UNSIGNED_SHORT ,
+ GL_UNSIGNED_INT |
+ 16 | ++ |
+ GL_DEPTH_COMPONENT24
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+
+ GL_UNSIGNED_INT
+ |
+ 24 | ++ |
+ GL_DEPTH_COMPONENT32F
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+
+ GL_FLOAT
+ |
+ f32 | ++ |
+ GL_DEPTH24_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+
+ GL_UNSIGNED_INT_24_8
+ |
+ 24 | +8 | +
+ GL_DEPTH32F_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+
+ GL_FLOAT_32_UNSIGNED_INT_24_8_REV
+ |
+ f32 | +8 | +
+
+ If the internalFormat
parameter is
+ GL_SRGB
,
+ GL_SRGB8
, or
+ GL_SRGB8_ALPHA8
, the texture is treated as if the red, green, blue, or luminance components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component
+
+
+ Assume
+
+ A one-component texture image uses only the red component of the RGBA
+ color extracted from data
.
+ A two-component image uses the R and A values.
+ A three-component image uses the R, G, and B values.
+ A four-component image uses all of the RGBA components.
+
+ The glPixelStorei mode affects texture images. +
+
+ data
may be a null pointer.
+ In this case texture memory is
+ allocated to accommodate a texture of width width
, height height
,
+ and depth depth
.
+ You can then download subtextures to initialize this
+ texture memory.
+ The image is undefined if the user tries to apply
+ an uninitialized portion of the texture image to a primitive.
+
+ glTexImage3D
specifies the two-dimensional array or three-dimensional texture for the
+ texture object bound to the current texture unit, specified with
+ glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_3D
+ or GL_TEXTURE_2D_ARRAY
.
+
+ GL_INVALID_ENUM
is generated if format
is not an accepted
+ format constant. Format constants other than GL_STENCIL_INDEX
and GL_DEPTH_COMPONENT
+ are accepted.
+
+ GL_INVALID_ENUM
is generated if type
is not a type constant.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater than
+ GL_MAX_3D_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if internalFormat
is not one of the
+ accepted resolution and format symbolic constants.
+
+ GL_INVALID_VALUE
is generated if width
, height
,
+ or depth
is less than 0 or greater than GL_MAX_3D_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if border
is not 0 or 1.
+
+ GL_INVALID_OPERATION
is generated if the combination of internalFormat
,
+ format
and type
is not one of those in the tables above.
+
+ GL_INVALID_OPERATION
is generated if target
is GL_TEXTURE_3D
and
+ format
is GL_DEPTH_COMPONENT
, or GL_DEPTH_STENCIL
.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the buffer object's data store is currently mapped.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the data would be unpacked from the buffer
+ object such that the memory reads required would exceed the data store size.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and data
is not evenly divisible
+ into the number of bytes needed to store in memory a datum indicated by type
.
+
+ glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glTexImage3D | +- | +✔ | +
+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexImage3D, + glCompressedTexSubImage2D, + glCompressedTexSubImage3D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glTexImage2D, + glTexSubImage2D, + glTexSubImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glTexParameter — set texture parameters
+
+ void glTexParameterf(
+ |
+ GLenum target, | +
+ | GLenum pname, | +
+ | GLfloat param) ; |
+
+ void glTexParameteri(
+ |
+ GLenum target, | +
+ | GLenum pname, | +
+ | GLint param) ; |
+
+ void glTexParameterfv(
+ |
+ GLenum target, | +
+ | GLenum pname, | +
+ | const GLfloat * params) ; |
+
+ void glTexParameteriv(
+ |
+ GLenum target, | +
+ | GLenum pname, | +
+ | const GLint * params) ; |
+
target
+
+
+
+ Specifies the target texture,
+ which must be either GL_TEXTURE_2D
,
+ GL_TEXTURE_3D
,
+ GL_TEXTURE_2D_ARRAY
,
+ or GL_TEXTURE_CUBE_MAP
.
+
pname
+
+
+
+ Specifies the symbolic name of a single-valued texture parameter.
+ pname
can be one of the following:
+ GL_TEXTURE_BASE_LEVEL
,
+ GL_TEXTURE_COMPARE_FUNC
,
+ GL_TEXTURE_COMPARE_MODE
,
+ GL_TEXTURE_MIN_FILTER
,
+ GL_TEXTURE_MAG_FILTER
,
+ GL_TEXTURE_MIN_LOD
,
+ GL_TEXTURE_MAX_LOD
,
+ GL_TEXTURE_MAX_LEVEL
,
+ GL_TEXTURE_SWIZZLE_R
,
+ GL_TEXTURE_SWIZZLE_G
,
+ GL_TEXTURE_SWIZZLE_B
,
+ GL_TEXTURE_SWIZZLE_A
,
+ GL_TEXTURE_WRAP_S
,
+ GL_TEXTURE_WRAP_T
, or
+ GL_TEXTURE_WRAP_R
.
+
param
+
+
+
+ Specifies the value of pname
.
+
params
+
+
+
+ For the vector commands, specifies a pointer to an array
+ where the value or values of
+ pname
are stored.
+
+ glTexParameter
assigns the value or values in params
to the texture parameter
+ specified as pname
.
+ target
defines the target texture,
+ either GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP
,
+ GL_TEXTURE_2D_ARRAY
, or GL_TEXTURE_3D
.
+ The following symbols are accepted in pname
:
+
GL_TEXTURE_BASE_LEVEL
+
+ + Specifies the index of the lowest defined mipmap level. This is an + integer value. The initial value is 0. +
++
+GL_TEXTURE_COMPARE_FUNC
+
+
+ Specifies the comparison operator used when GL_TEXTURE_COMPARE_MODE
is
+ set to GL_COMPARE_REF_TO_TEXTURE
. Permissible values are:
+
+ Texture Comparison Function + | ++ Computed result + | +
---|---|
+ GL_LEQUAL
+ |
+ + + | +
+ GL_GEQUAL
+ |
+ + + | +
+ GL_LESS
+ |
+ + + | +
+ GL_GREATER
+ |
+ + + | +
+ GL_EQUAL
+ |
+ + + | +
+ GL_NOTEQUAL
+ |
+ + + | +
+ GL_ALWAYS
+ |
+ + + | +
+ GL_NEVER
+ |
+ + + | +
+ where + is the current interpolated texture coordinate, and + + is the depth texture value sampled from the currently bound depth texture. + + is assigned to the the red channel. +
+GL_TEXTURE_COMPARE_MODE
+
+
+ Specifies the texture comparison mode for currently bound depth textures.
+ That is, a texture whose internal format is GL_DEPTH_COMPONENT_*
; see
+ glTexImage2D)
+ Permissible values are:
+
GL_COMPARE_REF_TO_TEXTURE
+
+
+ Specifies that the interpolated and clamped
+
+ texture coordinate should
+ be compared to the value in the currently bound depth texture. See the
+ discussion of GL_TEXTURE_COMPARE_FUNC
for details of how the comparison
+ is evaluated. The result of the comparison is assigned to the red channel.
+
GL_NONE
+
+ + Specifies that the red channel should be assigned the + appropriate value from the currently bound depth texture. +
++
+GL_TEXTURE_MIN_FILTER
+
+ + The texture minifying function is used whenever the level-of-detail function + used when sampling from the texture determines that the texture should be minified. + There are six defined minifying functions. + Two of them use either the nearest texture elements or a weighted average of multiple texture elements + to compute the texture value. + The other four use mipmaps. +
++ A mipmap is an ordered set of arrays representing the same image + at progressively lower resolutions. + If the texture has dimensions + , + there are + + mipmaps. + The first mipmap is the original texture, + with dimensions + . + Each subsequent mipmap has dimensions + , + where + + are the dimensions of the previous mipmap, + until either + + or + . + At that point, + subsequent mipmaps have dimension + + or + + until the final mipmap, + which has dimension + . + To define the mipmaps, call glTexImage2D, + glTexImage3D, + or glCopyTexImage2D + with the level argument indicating the order of the mipmaps. + Level 0 is the original texture; + level + + is the final + + mipmap. +
+
+ params
supplies a function for minifying the texture as one of the
+ following:
+
GL_NEAREST
+
+ + Returns the value of the texture element that is nearest + (in Manhattan distance) + to the specified texture coordinates. +
+GL_LINEAR
+
+
+ Returns the weighted average of the four texture elements
+ that are closest to the specified texture coordinates.
+ These can include items wrapped or repeated from other parts of a texture,
+ depending on the values of GL_TEXTURE_WRAP_S
and GL_TEXTURE_WRAP_T
,
+ and on the exact mapping.
+
GL_NEAREST_MIPMAP_NEAREST
+
+
+ Chooses the mipmap that most closely matches the size of the pixel
+ being textured and uses the GL_NEAREST
criterion
+ (the texture element closest to the specified texture coordinates)
+ to produce a texture value.
+
GL_LINEAR_MIPMAP_NEAREST
+
+
+ Chooses the mipmap that most closely matches the size of the pixel
+ being textured and uses the GL_LINEAR
criterion
+ (a weighted average of the four texture elements that are closest to the specified texture coordinates)
+ to produce a texture value.
+
GL_NEAREST_MIPMAP_LINEAR
+
+
+ Chooses the two mipmaps that most closely match the size of the pixel
+ being textured and uses the GL_NEAREST
criterion
+ (the texture element closest to the specified texture coordinates )
+ to produce a texture value from each mipmap.
+ The final texture value is a weighted average of those two values.
+
GL_LINEAR_MIPMAP_LINEAR
+
+
+ Chooses the two mipmaps that most closely match the size of the pixel
+ being textured and uses the GL_LINEAR
criterion
+ (a weighted average of the texture elements that are closest to the specified texture coordinates)
+ to produce a texture value from each mipmap.
+ The final texture value is a weighted average of those two values.
+
+
+
+ As more texture elements are sampled in the minification process,
+ fewer aliasing artifacts will be apparent.
+ While the GL_NEAREST
and GL_LINEAR
minification functions can be
+ faster than the other four,
+ they sample only one or multiple texture elements to determine the texture value
+ of the pixel being rendered and can produce moire patterns
+ or ragged transitions.
+ The initial value of GL_TEXTURE_MIN_FILTER
is
+ GL_NEAREST_MIPMAP_LINEAR
.
+
+
+GL_TEXTURE_MAG_FILTER
+
+
+ The texture magnification function is used whenever the level-of-detail function
+ used when sampling from the texture determines that the texture should be magified.
+ It sets the texture magnification function to either GL_NEAREST
+ or GL_LINEAR
(see below). GL_NEAREST
is generally faster
+ than GL_LINEAR
,
+ but it can produce textured images with sharper edges
+ because the transition between texture elements is not as smooth.
+ The initial value of GL_TEXTURE_MAG_FILTER
is GL_LINEAR
.
+
GL_NEAREST
+
+ + Returns the value of the texture element that is nearest + (in Manhattan distance) + to the specified texture coordinates. +
+GL_LINEAR
+
+
+ Returns the weighted average of the texture elements
+ that are closest to the specified texture coordinates.
+ These can include items wrapped or repeated from other parts of a texture,
+ depending on the values of GL_TEXTURE_WRAP_S
and GL_TEXTURE_WRAP_T
,
+ and on the exact mapping.
+
+
++
+GL_TEXTURE_MIN_LOD
+
+ + Sets the minimum level-of-detail parameter. This floating-point value + limits the selection of highest resolution mipmap (lowest mipmap + level). The initial value is -1000. +
++
+GL_TEXTURE_MAX_LOD
+
+ + Sets the maximum level-of-detail parameter. This floating-point value + limits the selection of the lowest resolution mipmap (highest mipmap + level). The initial value is 1000. +
++
+GL_TEXTURE_MAX_LEVEL
+
+ + Sets the index of the highest defined mipmap level. This is an integer + value. The initial value is 1000. +
++
+GL_TEXTURE_SWIZZLE_R
+
+
+ Sets the swizzle that will be applied to the
+ component of a texel before it is returned to the shader. Valid values for param
are GL_RED
,
+ GL_GREEN
, GL_BLUE
, GL_ALPHA
, GL_ZERO
and
+ GL_ONE
.
+ If GL_TEXTURE_SWIZZLE_R
is GL_RED
, the value for
+ will be taken from the first
+ channel of the fetched texel.
+ If GL_TEXTURE_SWIZZLE_R
is GL_GREEN
, the value for
+ will be taken from the second
+ channel of the fetched texel.
+ If GL_TEXTURE_SWIZZLE_R
is GL_BLUE
, the value for
+ will be taken from the third
+ channel of the fetched texel.
+ If GL_TEXTURE_SWIZZLE_R
is GL_ALPHA
, the value for
+ will be taken from the fourth
+ channel of the fetched texel.
+ If GL_TEXTURE_SWIZZLE_R
is GL_ZERO
, the value for
+ will be subtituted with
+ .
+ If GL_TEXTURE_SWIZZLE_R
is GL_ONE
, the value for
+ will be subtituted with
+ for integer texture components, otherwise
+ .
+ The initial value is GL_RED
.
+
+
+GL_TEXTURE_SWIZZLE_G
+
+
+ Sets the swizzle that will be applied to the
+ component of a texel before it is returned to the shader. Valid values for param
and their effects are similar to
+ those of GL_TEXTURE_SWIZZLE_R
.
+ The initial value is GL_GREEN
.
+
+
+GL_TEXTURE_SWIZZLE_B
+
+
+ Sets the swizzle that will be applied to the
+ component of a texel before it is returned to the shader. Valid values for param
and their effects are similar to
+ those of GL_TEXTURE_SWIZZLE_R
.
+ The initial value is GL_BLUE
.
+
+
+GL_TEXTURE_SWIZZLE_A
+
+
+ Sets the swizzle that will be applied to the
+ component of a texel before it is returned to the shader. Valid values for param
and their effects are similar to
+ those of GL_TEXTURE_SWIZZLE_R
.
+ The initial value is GL_ALPHA
.
+
+
++
+GL_TEXTURE_WRAP_S
+
+
+ Sets the wrap parameter for texture coordinate
+
+ to either GL_CLAMP_TO_EDGE
,
+ GL_MIRRORED_REPEAT
, or
+ GL_REPEAT
. GL_CLAMP_TO_EDGE
causes
+
+ coordinates to be clamped to the
+ range
+ ,
+ where
+
+ is the size
+ of the texture in the direction of clamping.
+ GL_REPEAT
causes the
+ integer part of the
+
+ coordinate to be ignored; the GL uses only the
+ fractional part, thereby creating a repeating pattern.
+ GL_MIRRORED_REPEAT
causes the
+
+ coordinate to be set to the
+ fractional part of the texture coordinate if the integer part of
+
+ is
+ even; if the integer part of
+
+ is odd, then the
+
+ texture coordinate is
+ set to
+ ,
+ where
+
+ represents the fractional part of
+ .
+ Initially, GL_TEXTURE_WRAP_S
is set to GL_REPEAT
.
+
+
+GL_TEXTURE_WRAP_T
+
+
+ Sets the wrap parameter for texture coordinate
+
+ to either GL_CLAMP_TO_EDGE
,
+ GL_MIRRORED_REPEAT
, or
+ GL_REPEAT
. See the discussion under GL_TEXTURE_WRAP_S
.
+ Initially, GL_TEXTURE_WRAP_T
is set to GL_REPEAT
.
+
+
+GL_TEXTURE_WRAP_R
+
+
+ Sets the wrap parameter for texture coordinate
+
+ to either GL_CLAMP_TO_EDGE
,
+ GL_MIRRORED_REPEAT
, or
+ GL_REPEAT
. See the discussion under GL_TEXTURE_WRAP_S
.
+ Initially, GL_TEXTURE_WRAP_R
is set to GL_REPEAT
.
+
+ Suppose that a program attempts to sample from a texture and
+ has set GL_TEXTURE_MIN_FILTER
to one of the functions that requires a
+ mipmap. If either the dimensions of the texture images currently defined
+ (with previous calls to glTexStorage2D,
+ glTexImage2D,
+ glTexStorage3D,
+ glTexImage3D,
+ or glCopyTexImage2D) do not
+ follow the proper sequence for mipmaps (described above), or there are
+ fewer texture images defined than are needed, or the set of texture images
+ have differing numbers of texture components, then the texture is considered incomplete.
+
+ Linear filtering accesses the four nearest texture elements only in 2D + textures. In 1D textures, linear filtering accesses the two nearest + texture elements. In 3D textures, linear filtering accesses the eight nearest + texture elements. +
+
+ glTexParameter
specifies the texture parameters for the texture object bound to the
+ active texture unit, specified by calling glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
or pname
is not
+ one of the accepted defined values.
+
+ GL_INVALID_ENUM
is generated if params
should have a defined
+ constant value (based on the value of pname
) and does not.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glTexParameterf
+ |
+ ✔ | +✔ | +
+ glTexParameterfv
+ |
+ ✔ | +✔ | +
+ glTexParameteri
+ |
+ ✔ | +✔ | +
+ glTexParameteriv
+ |
+ ✔ | +✔ | +
+ glActiveTexture, + glBindTexture, + glCopyTexImage2D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glSamplerParameter, + glTexStorage2D, + glTexImage2D, + glTexStorage3D, + glTexImage3D, + glTexSubImage2D, + glTexSubImage3D +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glTexStorage2D — simultaneously specify storage for all levels of a two-dimensional texture
+
+ void glTexStorage2D(
+ |
+ GLenum target, | +
+ | GLsizei levels, | +
+ | GLenum internalformat, | +
+ | GLsizei width, | +
+ | GLsizei height) ; |
+
target
+
+
+
+ Specify the target of the operation. target
must be
+ one of GL_TEXTURE_2D
,
+ or GL_TEXTURE_CUBE_MAP
.
+
levels
+
+
+ + Specify the number of texture levels. +
+internalformat
+
+
+ + Specifies the sized internal format to be used to store texture image data. +
+width
+
+
+ + Specifies the width of the texture, in texels. +
+height
+
+
+ + Specifies the height of the texture, in texels. +
+
+ glTexStorage2D
specifies the storage requirements for all levels
+ of a two-dimensional texture simultaneously. Once a texture is specified with this
+ command, the format and dimensions of all levels become immutable.
+ The contents of the image may still be modified, however, its storage requirements
+ may not change. Such a texture is referred to as an immutable-format
+ texture.
+
+ The behavior of glTexStorage2D
depends on the target
parameter.
+ When target
is GL_TEXTURE_2D
,
+ calling glTexStorage2D
is equivalent, assuming no errors are generated,
+ to executing the following pseudo-code:
+
for (i = 0; i < levels; i++) + { + glTexImage2D(target, i, internalformat, width, height, 0, format, type, NULL); + width = max(1, (width / 2)); + height = max(1, (height / 2)); + }+
+ When target
is GL_TEXTURE_CUBE_MAP
, glTexStorage2D
+ is equivalent to:
+
for (i = 0; i < levels; i++) + { + for (face in (+X, -X, +Y, -Y, +Z, -Z)) + { + glTexImage2D(face, i, internalformat, width, height, 0, format, type, NULL); + } + width = max(1, (width / 2)); + height = max(1, (height / 2)); + }+
+ Since no texture data is actually provided, the values used in the pseudo-code
+ for format
and type
are
+ irrelevant and may be considered to be any values that are legal for the
+ chosen internalformat
enumerant. internalformat
+ must be one of the sized internal formats given in Table 1, or one of the compressed internal
+ formats given in Table 2 below. Upon success,
+ the value of GL_TEXTURE_IMMUTABLE_FORMAT
becomes
+ GL_TRUE
. The value of GL_TEXTURE_IMMUTABLE_FORMAT
+ may be discovered by calling glGetTexParameter
+ with pname
set to GL_TEXTURE_IMMUTABLE_FORMAT
.
+ No further changes to the dimensions or format of the texture object may be
+ made. Using any command that might alter the dimensions or format of the
+ texture object (such as glTexImage2D or
+ another call to glTexStorage2D
) will result in the
+ generation of a GL_INVALID_OPERATION
error, even if it
+ would not, in fact, alter the dimensions or format of the object.
+
+
++ Sized Internal Format + | ++ Format + | ++ Type + | ++ Red Bits + | ++ Green Bits + | ++ Blue Bits + | ++ Alpha Bits + | ++ Shared Bits + | ++ Color renderable + | ++ Texture filterable + | +
---|---|---|---|---|---|---|---|---|---|
+ GL_R8
+ |
+
+ GL_RED
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | ++ | + | + | + | Y | +Y | +
+ GL_R8_SNORM
+ |
+
+ GL_RED
+ |
+
+ GL_BYTE
+ |
+ s8 | ++ | + | + | + | + | Y | +
+ GL_R16F
+ |
+
+ GL_RED
+ |
+ GL_HALF_FLOAT ,GL_FLOAT |
+ f16 | ++ | + | + | + | + | Y | +
+ GL_R32F
+ |
+
+ GL_RED
+ |
+
+ GL_FLOAT
+ |
+ f32 | ++ | + | + | + | + | + |
+ GL_R8UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | ++ | + | + | + | Y | ++ |
+ GL_R8I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | ++ | + | + | + | Y | ++ |
+ GL_R16UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | ++ | + | + | + | Y | ++ |
+ GL_R16I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | ++ | + | + | + | Y | ++ |
+ GL_R32UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | ++ | + | + | + | Y | ++ |
+ GL_R32I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | ++ | + | + | + | Y | ++ |
+ GL_RG8
+ |
+
+ GL_RG
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | ++ | + | + | Y | +Y | +
+ GL_RG8_SNORM
+ |
+
+ GL_RG
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | ++ | + | + | + | Y | +
+ GL_RG16F
+ |
+
+ GL_RG
+ |
+ GL_HALF_FLOAT ,GL_FLOAT |
+ f16 | +f16 | ++ | + | + | + | Y | +
+ GL_RG32F
+ |
+
+ GL_RG
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | ++ | + | + | + | + |
+ GL_RG8UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | ++ | + | + | Y | ++ |
+ GL_RG8I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | ++ | + | + | Y | ++ |
+ GL_RG16UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | ++ | + | + | Y | ++ |
+ GL_RG16I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | ++ | + | + | Y | ++ |
+ GL_RG32UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | ++ | + | + | Y | ++ |
+ GL_RG32I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | ++ | + | + | Y | ++ |
+ GL_RGB8
+ |
+
+ GL_RGB
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | ++ | + | Y | +Y | +
+ GL_SRGB8
+ |
+
+ GL_RGB
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | ++ | + | + | Y | +
+ GL_RGB565
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_6_5 |
+ 5 | +6 | +5 | ++ | + | Y | +Y | +
+ GL_RGB8_SNORM
+ |
+
+ GL_RGB
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | +s8 | ++ | + | + | Y | +
+ GL_R11F_G11F_B10F
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_INT_10F_11F_11F_REV ,
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f11 | +f11 | +f10 | ++ | + | + | Y | +
+ GL_RGB9_E5
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_INT_5_9_9_9_REV ,
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ 9 | +9 | +9 | ++ | 5 | ++ | Y | +
+ GL_RGB16F
+ |
+
+ GL_RGB
+ |
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f16 | +f16 | +f16 | ++ | + | + | Y | +
+ GL_RGB32F
+ |
+
+ GL_RGB
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | +f32 | ++ | + | + | + |
+ GL_RGB8UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | +ui8 | ++ | + | + | + |
+ GL_RGB8I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | +i8 | ++ | + | + | + |
+ GL_RGB16UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | +ui16 | ++ | + | + | + |
+ GL_RGB16I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | +i16 | ++ | + | + | + |
+ GL_RGB32UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | +ui32 | ++ | + | + | + |
+ GL_RGB32I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | +i32 | ++ | + | + | + |
+ GL_RGBA8
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | +8 | ++ | Y | +Y | +
+ GL_SRGB8_ALPHA8
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | +8 | ++ | Y | +Y | +
+ GL_RGBA8_SNORM
+ |
+
+ GL_RGBA
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | +s8 | +s8 | ++ | + | Y | +
+ GL_RGB5_A1
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_5_5_1 ,
+ GL_UNSIGNED_INT_2_10_10_10_REV |
+ 5 | +5 | +5 | +1 | ++ | Y | +Y | +
+ GL_RGBA4
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_4_4_4_4 |
+ 4 | +4 | +4 | +4 | ++ | Y | +Y | +
+ GL_RGB10_A2
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ |
+ 10 | +10 | +10 | +2 | ++ | Y | +Y | +
+ GL_RGBA16F
+ |
+
+ GL_RGBA
+ |
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f16 | +f16 | +f16 | +f16 | ++ | + | Y | +
+ GL_RGBA32F
+ |
+
+ GL_RGBA
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | +f32 | +f32 | ++ | + | + |
+ GL_RGBA8UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | +ui8 | +ui8 | ++ | Y | ++ |
+ GL_RGBA8I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | +i8 | +i8 | ++ | Y | ++ |
+ GL_RGB10_A2UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ |
+ ui10 | +ui10 | +ui10 | +ui2 | ++ | Y | ++ |
+ GL_RGBA16UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | +ui16 | +ui16 | ++ | Y | ++ |
+ GL_RGBA16I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | +i16 | +i16 | ++ | Y | ++ |
+ GL_RGBA32I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | +i32 | +i32 | ++ | Y | ++ |
+ GL_RGBA32UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | +ui32 | +ui32 | ++ | Y | ++ |
+ Sized Internal Format + | ++ Format + | ++ Type + | ++ Depth Bits + | ++ Stencil Bits + | +
---|---|---|---|---|
+ GL_DEPTH_COMPONENT16
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ GL_UNSIGNED_SHORT ,
+ GL_UNSIGNED_INT |
+ 16 | ++ |
+ GL_DEPTH_COMPONENT24
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+
+ GL_UNSIGNED_INT
+ |
+ 24 | ++ |
+ GL_DEPTH_COMPONENT32F
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+
+ GL_FLOAT
+ |
+ f32 | ++ |
+ GL_DEPTH24_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+
+ GL_UNSIGNED_INT_24_8
+ |
+ 24 | +8 | +
+ GL_DEPTH32F_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+
+ GL_FLOAT_32_UNSIGNED_INT_24_8_REV
+ |
+ f32 | +8 | +
+
+
++ Compressed Internal Format + | ++ Base Internal Format + | ++ Image Size + | +
---|---|---|
+ GL_COMPRESSED_R11_EAC
+ |
+
+ GL_RED
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SIGNED_R11_EAC
+ |
+
+ GL_RED
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RG11_EAC
+ |
+
+ GL_RG
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_SIGNED_RG11_EAC
+ |
+
+ GL_RG
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_RGB8_ETC2
+ |
+
+ GL_RGB
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SRGB8_ETC2
+ |
+
+ GL_RGB
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RGBA8_ETC2_EAC
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+
+ GL_INVALID_OPERATION
is generated if the default texture object is curently bound to target
.
+
+ GL_INVALID_OPERATION
is generated if the texture object curently bound to target
+ already has GL_TEXTURE_IMMUTABLE_FORMAT
set to GL_TRUE
.
+
+ GL_INVALID_ENUM
is generated if internalformat
is not a
+ valid sized internal format.
+
+ GL_INVALID_ENUM
is generated if target
is not
+ one of the accepted target enumerants.
+
+ GL_INVALID_VALUE
is generated if width
, height
or
+ levels
are less than 1.
+
+ GL_INVALID_OPERATION
is generated if levels
is greater than
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glTexStorage2D | +- | +✔ | +
+ glTexImage2D, + glCompressedTexImage2D, + glTexStorage3D. +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glTexStorage3D — simultaneously specify storage for all levels of a three-dimensional or two-dimensional array texture
+
+ void glTexStorage3D(
+ |
+ GLenum target, | +
+ | GLsizei levels, | +
+ | GLenum internalformat, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLsizei depth) ; |
+
target
+
+
+
+ Specify the target of the operation. target
must be
+ one of GL_TEXTURE_3D
, or GL_TEXTURE_2D_ARRAY
.
+
levels
+
+
+ + Specify the number of texture levels. +
+internalformat
+
+
+ + Specifies the sized internal format to be used to store texture image data. +
+width
+
+
+ + Specifies the width of the texture, in texels. +
+height
+
+
+ + Specifies the height of the texture, in texels. +
+depth
+
+
+ + Specifies the depth of the texture, in texels. +
+
+ glTexStorage3D
specifies the storage requirements for all levels
+ of a three-dimensional or two-dimensional array texture simultaneously. Once a texture is specified with this
+ command, the format and dimensions of all levels become immutable.
+ The contents of the image may still be modified, however, its storage requirements
+ may not change. Such a texture is referred to as an immutable-format
+ texture.
+
+ The behavior of glTexStorage3D
depends on the target
parameter.
+ When target
is GL_TEXTURE_3D
,
+ calling glTexStorage3D
is equivalent, assuming no errors are generated,
+ to executing the following pseudo-code:
+
for (i = 0; i < levels; i++) + { + glTexImage3D(target, i, internalformat, width, height, depth, 0, format, type, NULL); + width = max(1, (width / 2)); + height = max(1, (height / 2)); + depth = max(1, (depth / 2)); + }+
+ When target
is GL_TEXTURE_2D_ARRAY
, glTexStorage3D
+ is equivalent to:
+
for (i = 0; i < levels; i++) + { + glTexImage3D(target, i, internalformat, width, height, depth, 0, format, type, NULL); + width = max(1, (width / 2)); + height = max(1, (height / 2)); + }+
+ Since no texture data is actually provided, the values used in the pseudo-code
+ for format
and type
are
+ irrelevant and may be considered to be any values that are legal for the
+ chosen internalformat
enumerant. internalformat
+ must be one of the sized internal formats given in Table 1, or one of the compressed internal
+ formats given in Table 2 below. Upon success,
+ the value of GL_TEXTURE_IMMUTABLE_FORMAT
becomes
+ GL_TRUE
. The value of GL_TEXTURE_IMMUTABLE_FORMAT
+ may be discovered by calling glGetTexParameter
+ with pname
set to GL_TEXTURE_IMMUTABLE_FORMAT
.
+ No further changes to the dimensions or format of the texture object may be
+ made. Using any command that might alter the dimensions or format of the
+ texture object (such as glTexImage3D or
+ another call to glTexStorage3D
) will result in the
+ generation of a GL_INVALID_OPERATION
error, even if it
+ would not, in fact, alter the dimensions or format of the object.
+
+
++ Sized Internal Format + | ++ Format + | ++ Type + | ++ Red Bits + | ++ Green Bits + | ++ Blue Bits + | ++ Alpha Bits + | ++ Shared Bits + | ++ Color renderable + | ++ Texture filterable + | +
---|---|---|---|---|---|---|---|---|---|
+ GL_R8
+ |
+
+ GL_RED
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | ++ | + | + | + | Y | +Y | +
+ GL_R8_SNORM
+ |
+
+ GL_RED
+ |
+
+ GL_BYTE
+ |
+ s8 | ++ | + | + | + | + | Y | +
+ GL_R16F
+ |
+
+ GL_RED
+ |
+ GL_HALF_FLOAT ,GL_FLOAT |
+ f16 | ++ | + | + | + | + | Y | +
+ GL_R32F
+ |
+
+ GL_RED
+ |
+
+ GL_FLOAT
+ |
+ f32 | ++ | + | + | + | + | + |
+ GL_R8UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | ++ | + | + | + | Y | ++ |
+ GL_R8I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | ++ | + | + | + | Y | ++ |
+ GL_R16UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | ++ | + | + | + | Y | ++ |
+ GL_R16I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | ++ | + | + | + | Y | ++ |
+ GL_R32UI
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | ++ | + | + | + | Y | ++ |
+ GL_R32I
+ |
+
+ GL_RED_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | ++ | + | + | + | Y | ++ |
+ GL_RG8
+ |
+
+ GL_RG
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | ++ | + | + | Y | +Y | +
+ GL_RG8_SNORM
+ |
+
+ GL_RG
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | ++ | + | + | + | Y | +
+ GL_RG16F
+ |
+
+ GL_RG
+ |
+ GL_HALF_FLOAT ,GL_FLOAT |
+ f16 | +f16 | ++ | + | + | + | Y | +
+ GL_RG32F
+ |
+
+ GL_RG
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | ++ | + | + | + | + |
+ GL_RG8UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | ++ | + | + | Y | ++ |
+ GL_RG8I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | ++ | + | + | Y | ++ |
+ GL_RG16UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | ++ | + | + | Y | ++ |
+ GL_RG16I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | ++ | + | + | Y | ++ |
+ GL_RG32UI
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | ++ | + | + | Y | ++ |
+ GL_RG32I
+ |
+
+ GL_RG_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | ++ | + | + | Y | ++ |
+ GL_RGB8
+ |
+
+ GL_RGB
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | ++ | + | Y | +Y | +
+ GL_SRGB8
+ |
+
+ GL_RGB
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | ++ | + | + | Y | +
+ GL_RGB565
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_6_5 |
+ 5 | +6 | +5 | ++ | + | Y | +Y | +
+ GL_RGB8_SNORM
+ |
+
+ GL_RGB
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | +s8 | ++ | + | + | Y | +
+ GL_R11F_G11F_B10F
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_INT_10F_11F_11F_REV ,
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f11 | +f11 | +f10 | ++ | + | + | Y | +
+ GL_RGB9_E5
+ |
+
+ GL_RGB
+ |
+ GL_UNSIGNED_INT_5_9_9_9_REV ,
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ 9 | +9 | +9 | ++ | 5 | ++ | Y | +
+ GL_RGB16F
+ |
+
+ GL_RGB
+ |
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f16 | +f16 | +f16 | ++ | + | + | Y | +
+ GL_RGB32F
+ |
+
+ GL_RGB
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | +f32 | ++ | + | + | + |
+ GL_RGB8UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | +ui8 | ++ | + | + | + |
+ GL_RGB8I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | +i8 | ++ | + | + | + |
+ GL_RGB16UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | +ui16 | ++ | + | + | + |
+ GL_RGB16I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | +i16 | ++ | + | + | + |
+ GL_RGB32UI
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | +ui32 | ++ | + | + | + |
+ GL_RGB32I
+ |
+
+ GL_RGB_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | +i32 | ++ | + | + | + |
+ GL_RGBA8
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | +8 | ++ | Y | +Y | +
+ GL_SRGB8_ALPHA8
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ 8 | +8 | +8 | +8 | ++ | Y | +Y | +
+ GL_RGBA8_SNORM
+ |
+
+ GL_RGBA
+ |
+
+ GL_BYTE
+ |
+ s8 | +s8 | +s8 | +s8 | ++ | + | Y | +
+ GL_RGB5_A1
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_5_5_5_1 ,
+ GL_UNSIGNED_INT_2_10_10_10_REV |
+ 5 | +5 | +5 | +1 | ++ | Y | +Y | +
+ GL_RGBA4
+ |
+
+ GL_RGBA
+ |
+ GL_UNSIGNED_BYTE ,
+ GL_UNSIGNED_SHORT_4_4_4_4 |
+ 4 | +4 | +4 | +4 | ++ | Y | +Y | +
+ GL_RGB10_A2
+ |
+
+ GL_RGBA
+ |
+
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ |
+ 10 | +10 | +10 | +2 | ++ | Y | +Y | +
+ GL_RGBA16F
+ |
+
+ GL_RGBA
+ |
+ GL_HALF_FLOAT ,
+ GL_FLOAT |
+ f16 | +f16 | +f16 | +f16 | ++ | + | Y | +
+ GL_RGBA32F
+ |
+
+ GL_RGBA
+ |
+
+ GL_FLOAT
+ |
+ f32 | +f32 | +f32 | +f32 | ++ | + | + |
+ GL_RGBA8UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_BYTE
+ |
+ ui8 | +ui8 | +ui8 | +ui8 | ++ | Y | ++ |
+ GL_RGBA8I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_BYTE
+ |
+ i8 | +i8 | +i8 | +i8 | ++ | Y | ++ |
+ GL_RGB10_A2UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ |
+ ui10 | +ui10 | +ui10 | +ui2 | ++ | Y | ++ |
+ GL_RGBA16UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_SHORT
+ |
+ ui16 | +ui16 | +ui16 | +ui16 | ++ | Y | ++ |
+ GL_RGBA16I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_SHORT
+ |
+ i16 | +i16 | +i16 | +i16 | ++ | Y | ++ |
+ GL_RGBA32I
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_INT
+ |
+ i32 | +i32 | +i32 | +i32 | ++ | Y | ++ |
+ GL_RGBA32UI
+ |
+
+ GL_RGBA_INTEGER
+ |
+
+ GL_UNSIGNED_INT
+ |
+ ui32 | +ui32 | +ui32 | +ui32 | ++ | Y | ++ |
+ Sized Internal Format + | ++ Format + | ++ Type + | ++ Depth Bits + | ++ Stencil Bits + | +
---|---|---|---|---|
+ GL_DEPTH_COMPONENT16
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+ GL_UNSIGNED_SHORT ,
+ GL_UNSIGNED_INT |
+ 16 | ++ |
+ GL_DEPTH_COMPONENT24
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+
+ GL_UNSIGNED_INT
+ |
+ 24 | ++ |
+ GL_DEPTH_COMPONENT32F
+ |
+
+ GL_DEPTH_COMPONENT
+ |
+
+ GL_FLOAT
+ |
+ f32 | ++ |
+ GL_DEPTH24_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+
+ GL_UNSIGNED_INT_24_8
+ |
+ 24 | +8 | +
+ GL_DEPTH32F_STENCIL8
+ |
+
+ GL_DEPTH_STENCIL
+ |
+
+ GL_FLOAT_32_UNSIGNED_INT_24_8_REV
+ |
+ f32 | +8 | +
+
+
++ Compressed Internal Format + | ++ Base Internal Format + | ++ Image Size + | +
---|---|---|
+ GL_COMPRESSED_R11_EAC
+ |
+
+ GL_RED
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SIGNED_R11_EAC
+ |
+
+ GL_RED
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RG11_EAC
+ |
+
+ GL_RG
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_SIGNED_RG11_EAC
+ |
+
+ GL_RG
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_RGB8_ETC2
+ |
+
+ GL_RGB
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SRGB8_ETC2
+ |
+
+ GL_RGB
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 8 |
+
+ GL_COMPRESSED_RGBA8_ETC2_EAC
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+ |
+
+ GL_RGBA
+ |
+ ceil(width /4) * ceil(height /4) * 16 |
+
+
+ GL_INVALID_OPERATION
is generated if the default texture object is curently bound to target
.
+
+ GL_INVALID_OPERATION
is generated if the texture object curently bound to target
+ already has GL_TEXTURE_IMMUTABLE_FORMAT
set to GL_TRUE
.
+
+ GL_INVALID_ENUM
is generated if internalformat
is not a
+ valid sized internal format.
+
+ GL_INVALID_ENUM
is generated if target
is not
+ one of the accepted target enumerants.
+
+ GL_INVALID_VALUE
is generated if width
, height
,
+ depth
or levels
are less than 1.
+
+ GL_INVALID_OPERATION
is generated if target
is GL_TEXTURE_3D
+ and levels
is greater than
+
+ GL_INVALID_OPERATION
is generated if target
is GL_TEXTURE_2D_ARRAY
+ and levels
is greater than
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glTexStorage3D | +- | +✔ | +
+ glTexImage3D, + glCompressedTexImage3D, + glTexStorage2D. +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glTexSubImage2D — specify a two-dimensional texture subimage
+
+ void glTexSubImage2D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLint xoffset, | +
+ | GLint yoffset, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLenum format, | +
+ | GLenum type, | +
+ | const GLvoid * data) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+xoffset
+
+
+ + Specifies a texel offset in the x direction within the texture array. +
+yoffset
+
+
+ + Specifies a texel offset in the y direction within the texture array. +
+width
+
+
+ + Specifies the width of the texture subimage. +
+height
+
+
+ + Specifies the height of the texture subimage. +
+format
+
+
+
+ Specifies the format of the pixel data.
+ The following symbolic values are accepted:
+ GL_RED
,
+ GL_RED_INTEGER
,
+ GL_RG
,
+ GL_RG_INTEGER
,
+ GL_RGB
,
+ GL_RGB_INTEGER
,
+ GL_RGBA
,
+ GL_RGBA_INTEGER
,
+ GL_DEPTH_COMPONENT
,
+ GL_DEPTH_STENCIL
,
+ GL_LUMINANCE_ALPHA
,
+ GL_LUMINANCE
, and
+ GL_ALPHA
.
+
type
+
+
+
+ Specifies the data type of the pixel data.
+ The following symbolic values are accepted:
+ GL_UNSIGNED_BYTE
,
+ GL_BYTE
,
+ GL_UNSIGNED_SHORT
,
+ GL_SHORT
,
+ GL_UNSIGNED_INT
,
+ GL_INT
,
+ GL_HALF_FLOAT
,
+ GL_FLOAT
,
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
,
+ GL_UNSIGNED_SHORT_5_5_5_1
,
+ GL_UNSIGNED_INT_2_10_10_10_REV
,
+ GL_UNSIGNED_INT_10F_11F_11F_REV
,
+ GL_UNSIGNED_INT_5_9_9_9_REV
,
+ GL_UNSIGNED_INT_24_8
, and
+ GL_FLOAT_32_UNSIGNED_INT_24_8_REV
.
+
data
+
+
+ + Specifies a pointer to the image data in memory. +
++ Texturing allows elements of an image array to be read by shaders. +
+
+ glTexSubImage2D
redefines a contiguous subregion of an existing two-dimensional
+ texture image.
+ The texels referenced by data
replace the portion of the
+ existing texture array with x indices xoffset
and
+ yoffset
and
+
+ If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER
target
+ (see glBindBuffer) while a texture image is
+ specified, data
is treated as a byte offset into the buffer object's data store.
+
+ glPixelStorei modes affect texture images. +
+
+ glTexSubImage2D
specifies a two-dimensional subtexture for the texture object bound to the
+ current texture unit, specified with glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_2D
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
+
+ GL_INVALID_ENUM
is generated if format
is not an accepted
+ format constant.
+
+ GL_INVALID_ENUM
is generated if type
is not a type constant.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater
+ than
+ GL_MAX_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if
+ GL_TEXTURE_WIDTH
, and
+ GL_TEXTURE_HEIGHT
+ of the texture image being modified.
+
+ GL_INVALID_VALUE
is generated if width
or height
is less than 0.
+
+ GL_INVALID_OPERATION
is generated if the texture array has not
+ been defined by a previous glTexImage2D or
+ glTexStorage2D operation.
+
+ GL_INVALID_OPERATION
is generated if the combination of internalFormat
of the
+ previously specified texture array, format
and type
is not valid. See
+ glTexImage2D.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the buffer object's data store is currently mapped.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the data would be unpacked from the buffer
+ object such that the memory reads required would exceed the data store size.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and data
is not evenly divisible
+ into the number of bytes needed to store in memory a datum indicated by type
.
+
+ glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glTexSubImage2D | +✔ | +✔ | +
+ glActiveTexture, + glCopyTexImage2D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glTexImage2D, + glTexImage3D, + glTexStorage2D, + glTexStorage3D, + glTexSubImage3D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glTexSubImage3D — specify a three-dimensional texture subimage
+
+ void glTexSubImage3D(
+ |
+ GLenum target, | +
+ | GLint level, | +
+ | GLint xoffset, | +
+ | GLint yoffset, | +
+ | GLint zoffset, | +
+ | GLsizei width, | +
+ | GLsizei height, | +
+ | GLsizei depth, | +
+ | GLenum format, | +
+ | GLenum type, | +
+ | const GLvoid * data) ; |
+
target
+
+
+
+ Specifies the target texture.
+ Must be GL_TEXTURE_3D
or GL_TEXTURE_2D_ARRAY
.
+
level
+
+
+ + Specifies the level-of-detail number. + Level 0 is the base image level. + Level n is the nth mipmap reduction image. +
+xoffset
+
+
+ + Specifies a texel offset in the x direction within the texture array. +
+yoffset
+
+
+ + Specifies a texel offset in the y direction within the texture array. +
+zoffset
+
+
+ + Specifies a texel offset in the z direction within the texture array. +
+width
+
+
+ + Specifies the width of the texture subimage. +
+height
+
+
+ + Specifies the height of the texture subimage. +
+depth
+
+
+ + Specifies the depth of the texture subimage. +
+format
+
+
+
+ Specifies the format of the pixel data.
+ The following symbolic values are accepted:
+ GL_RED
,
+ GL_RED_INTEGER
,
+ GL_RG
,
+ GL_RG_INTEGER
,
+ GL_RGB
,
+ GL_RGB_INTEGER
,
+ GL_RGBA
,
+ GL_RGBA_INTEGER
,
+ GL_DEPTH_COMPONENT
,
+ GL_DEPTH_STENCIL
,
+ GL_LUMINANCE_ALPHA
,
+ GL_LUMINANCE
, and
+ GL_ALPHA
.
+
type
+
+
+
+ Specifies the data type of the pixel data.
+ The following symbolic values are accepted:
+ GL_UNSIGNED_BYTE
,
+ GL_BYTE
,
+ GL_UNSIGNED_SHORT
,
+ GL_SHORT
,
+ GL_UNSIGNED_INT
,
+ GL_INT
,
+ GL_HALF_FLOAT
,
+ GL_FLOAT
,
+ GL_UNSIGNED_SHORT_5_6_5
,
+ GL_UNSIGNED_SHORT_4_4_4_4
,
+ GL_UNSIGNED_SHORT_5_5_5_1
,
+ GL_UNSIGNED_INT_2_10_10_10_REV
,
+ GL_UNSIGNED_INT_10F_11F_11F_REV
,
+ GL_UNSIGNED_INT_5_9_9_9_REV
,
+ GL_UNSIGNED_INT_24_8
, and
+ GL_FLOAT_32_UNSIGNED_INT_24_8_REV
.
+
data
+
+
+ + Specifies a pointer to the image data in memory. +
++ Texturing allows elements of an image array to be read by shaders. +
+
+ glTexSubImage3D
redefines a contiguous subregion of an existing three-dimensional
+ or two-dimensional array texture image.
+ The texels referenced by data
replace the portion of the
+ existing texture array with x indices xoffset
and
+ yoffset
and
+ zoffset
and
+
+ If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER
target
+ (see glBindBuffer) while a texture image is
+ specified, data
is treated as a byte offset into the buffer object's data store.
+
+ The glPixelStorei modes affect texture images. +
+
+ glTexSubImage3D
specifies a three-dimensional subtexture for the texture object bound to the
+ current texture unit, specified with glActiveTexture.
+
+ GL_INVALID_ENUM
is generated if target
is not GL_TEXTURE_3D
or
+ GL_TEXTURE_2D_ARRAY
.
+
+ GL_INVALID_ENUM
is generated if format
is not an accepted
+ format constant.
+
+ GL_INVALID_ENUM
is generated if type
is not a type constant.
+
+ GL_INVALID_VALUE
is generated if level
is less than 0.
+
+ GL_INVALID_VALUE
may be generated if level
is greater
+ than
+ GL_MAX_3D_TEXTURE_SIZE
.
+
+ GL_INVALID_VALUE
is generated if
+ GL_TEXTURE_WIDTH
,
+ GL_TEXTURE_HEIGHT
,
+ GL_TEXTURE_DEPTH
of the texture image being modified.
+
+ GL_INVALID_VALUE
is generated if width
, height
, or depth
+ is less than 0.
+
+ GL_INVALID_OPERATION
is generated if the texture array has not
+ been defined by a previous glTexImage3D or
+ glTexStorage3D operation.
+
+ GL_INVALID_OPERATION
is generated if the combination of internalFormat
of the
+ previously specified texture array, format
and type
is not valid. See
+ glTexImage3D.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the buffer object's data store is currently mapped.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and the data would be unpacked from the buffer
+ object such that the memory reads required would exceed the data store size.
+
+ GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to the
+ GL_PIXEL_UNPACK_BUFFER
target and data
is not evenly divisible
+ into the number of bytes needed to store in memory a datum indicated by type
.
+
+ glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glTexSubImage3D | +- | +✔ | +
+ glActiveTexture, + glCopyTexImage2D, + glCopyTexSubImage2D, + glCopyTexSubImage3D, + glPixelStorei, + glTexImage2D, + glTexImage3D, + glTexStorage2D, + glTexStorage3D, + glTexSubImage2D, + glTexParameter +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glTransformFeedbackVaryings — specify values to record in transform feedback buffers
+
+ void glTransformFeedbackVaryings(
+ |
+ GLuint program, | +
+ | GLsizei count, | +
+ | const char ** varyings, | +
+ | GLenum bufferMode) ; |
+
program
+
+
+ + The name of the target program object. +
+count
+
+
+ + The number of varying variables used for transform feedback. +
+varyings
+
+
+
+ An array of count
zero-terminated strings specifying the
+ names of the varying variables to use for transform feedback.
+
bufferMode
+
+
+
+ Identifies the mode used to capture the varying variables when transform feedback is active.
+ bufferMode
must be GL_INTERLEAVED_ATTRIBS
or GL_SEPARATE_ATTRIBS
.
+
+ The names of the vertex shader outputs to be recorded in transform feedback mode
+ are specified using glTransformFeedbackVaryings
.Transform feedback
+ records the values of the selected vertex shader outputs.
+
+ The state set by glTranformFeedbackVaryings
is stored and takes effect
+ next time glLinkProgram is called
+ on program
. When glLinkProgram
+ is called, program
is linked so that the values of the specified varying variables
+ for the vertices of each primitive generated by the GL are written to a single buffer
+ object if bufferMode
is GL_INTERLEAVED_ATTRIBS
or multiple
+ buffer objects if bufferMode
is GL_SEPARATE_ATTRIBS
.
+
+ In addition to the errors generated by glTransformFeedbackVaryings
, the
+ program program
will fail to link if:
+
+ Any variable name specified in the varyings
array is not declared as an output
+ in the vertex shader.
+
+ Any two entries in the varyings
array specify the same varying variable.
+
+ The total number of components to capture in any varying variable in varyings
+ is greater than the constant GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
+ and the buffer mode is GL_SEPARATE_ATTRIBS
.
+
+ The total number of components to capture is greater than the constant
+ GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS
and the buffer
+ mode is GL_INTERLEAVED_ATTRIBS
.
+
+
+
+ GL_INVALID_VALUE
is generated if program
is not
+ the name of a program object.
+
+ GL_INVALID_VALUE
is generated if bufferMode
is GL_SEPARATE_ATTRIBS
+ and count
is greater than the implementation-dependent limit GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glTransformFeedbackVaryings | +- | +✔ | +
+ glBeginTransformFeedback, + glEndTransformFeedback, + glGetTransformFeedbackVarying +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glUniform — Specify the value of a uniform variable for the current program object
+
+ void glUniform1f(
+ |
+ GLint location, | +
+ | GLfloat v0) ; |
+
+ void glUniform2f(
+ |
+ GLint location, | +
+ | GLfloat v0, | +
+ | GLfloat v1) ; |
+
+ void glUniform3f(
+ |
+ GLint location, | +
+ | GLfloat v0, | +
+ | GLfloat v1, | +
+ | GLfloat v2) ; |
+
+ void glUniform4f(
+ |
+ GLint location, | +
+ | GLfloat v0, | +
+ | GLfloat v1, | +
+ | GLfloat v2, | +
+ | GLfloat v3) ; |
+
+ void glUniform1i(
+ |
+ GLint location, | +
+ | GLint v0) ; |
+
+ void glUniform2i(
+ |
+ GLint location, | +
+ | GLint v0, | +
+ | GLint v1) ; |
+
+ void glUniform3i(
+ |
+ GLint location, | +
+ | GLint v0, | +
+ | GLint v1, | +
+ | GLint v2) ; |
+
+ void glUniform4i(
+ |
+ GLint location, | +
+ | GLint v0, | +
+ | GLint v1, | +
+ | GLint v2, | +
+ | GLint v3) ; |
+
+ void glUniform1ui(
+ |
+ GLint location, | +
+ | GLuint v0) ; |
+
+ void glUniform2ui(
+ |
+ GLint location, | +
+ | GLuint v0, | +
+ | GLuint v1) ; |
+
+ void glUniform3ui(
+ |
+ GLint location, | +
+ | GLuint v0, | +
+ | GLuint v1, | +
+ | GLuint v2) ; |
+
+ void glUniform4ui(
+ |
+ GLint location, | +
+ | GLint v0, | +
+ | GLuint v1, | +
+ | GLuint v2, | +
+ | GLuint v3) ; |
+
+ void glUniform1fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLfloat *value) ; |
+
+ void glUniform2fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLfloat *value) ; |
+
+ void glUniform3fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLfloat *value) ; |
+
+ void glUniform4fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLfloat *value) ; |
+
+ void glUniform1iv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLint *value) ; |
+
+ void glUniform2iv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLint *value) ; |
+
+ void glUniform3iv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLint *value) ; |
+
+ void glUniform4iv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLint *value) ; |
+
+ void glUniform1uiv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLuint *value) ; |
+
+ void glUniform2uiv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLuint *value) ; |
+
+ void glUniform3uiv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLuint *value) ; |
+
+ void glUniform4uiv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | const GLuint *value) ; |
+
+ void glUniformMatrix2fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | GLboolean transpose, | +
+ | const GLfloat *value) ; |
+
+ void glUniformMatrix3fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | GLboolean transpose, | +
+ | const GLfloat *value) ; |
+
+ void glUniformMatrix4fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | GLboolean transpose, | +
+ | const GLfloat *value) ; |
+
+ void glUniformMatrix2x3fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | GLboolean transpose, | +
+ | const GLfloat *value) ; |
+
+ void glUniformMatrix3x2fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | GLboolean transpose, | +
+ | const GLfloat *value) ; |
+
+ void glUniformMatrix2x4fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | GLboolean transpose, | +
+ | const GLfloat *value) ; |
+
+ void glUniformMatrix4x2fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | GLboolean transpose, | +
+ | const GLfloat *value) ; |
+
+ void glUniformMatrix3x4fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | GLboolean transpose, | +
+ | const GLfloat *value) ; |
+
+ void glUniformMatrix4x3fv(
+ |
+ GLint location, | +
+ | GLsizei count, | +
+ | GLboolean transpose, | +
+ | const GLfloat *value) ; |
+
location
+
+
+ Specifies the location of the uniform variable + to be modified.
+count
+
+
+
+ For the vector (glUniform*v
) commands,
+ specifies the number of elements that are to be modified.
+ This should be 1 if the targeted uniform variable is not an
+ array, and 1 or more if it is an array.
+
+ For the matrix (glUniformMatrix*
)
+ commands, specifies the number of matrices that are to be
+ modified. This should be 1 if the targeted uniform variable
+ is not an array of matrices, and 1 or more if it is an array
+ of matrices.
+
transpose
+
+
+ + For the matrix commands, specifies whether to transpose the + matrix as the values are loaded into the uniform variable. +
+v0
,
+ v1
,
+ v2
,
+ v3
+
+ + For the scalar commands, specifies the new values to be used + for the specified uniform variable. +
+value
+
+
+
+ For the vector and matrix commands, specifies a pointer to
+ an array of count
values that will be
+ used to update the specified uniform variable.
+
glUniform
* modifies the value of a
+ uniform variable or a uniform variable array in the default
+ uniform block. The location of
+ the uniform variable to be modified is specified by
+ location
, which should be a value
+ returned by
+ glGetUniformLocation.
+ glUniform
operates on the program object
+ that was made part of current state by calling
+ glUseProgram.
The commands glUniform{1|2|3|4}{f|i|ui}
+ are used to change the value of the uniform variable specified
+ by location
using the values passed as
+ arguments. The number specified in the command should match the
+ number of components in the data type of the specified uniform
+ variable (e.g., 1
for float
, int
, unsigned int
, bool
;
+ 2
for vec2
, ivec2
, uvec2
, bvec2
, etc.). The suffix
+ f
indicates that floating-point values are
+ being passed; the suffix i
indicates that
+ integer values are being passed; the suffix ui
indicates that
+ unsigned integer values are being passed, and this type should also match
+ the data type of the specified uniform variable. The
+ i
variants of this function should be used
+ to provide values for uniform variables defined as int
, ivec2
,
+ ivec3
, ivec4
, or arrays of these. The
+ ui
variants of this function should be used
+ to provide values for uniform variables defined as unsigned int
, uvec2
,
+ uvec3
, uvec4
, or arrays of these. The f
+ variants should be used to provide values for uniform variables
+ of type float
, vec2
, vec3
, vec4
, or arrays of these. Either the
+ i
, ui
or f
variants
+ may be used to provide values for uniform variables of type
+ bool
, bvec2
, bvec3
, bvec4
, or arrays of these. The uniform
+ variable will be set to false
if the input value is 0 or 0.0f,
+ and it will be set to true
otherwise.
All active uniform variables defined in a program object
+ are initialized to 0 when the program object is linked
+ successfully. They retain the values assigned to them by a call
+ to glUniform
until the next successful
+ link operation occurs on the program object, when they are once
+ again initialized to 0.
The commands glUniform{1|2|3|4}{f|i|ui}v
+ can be used to modify a single uniform variable or a uniform
+ variable array. These commands pass a count and a pointer to the
+ values to be loaded into a uniform variable or a uniform
+ variable array. A count of 1 should be used if modifying the
+ value of a single uniform variable, and a count of 1 or greater
+ can be used to modify an entire array or part of an array. When
+ loading n elements starting at an arbitrary
+ position m in a uniform variable array,
+ elements m + n - 1 in
+ the array will be replaced with the new values. If
+ m
+ n
- 1 is
+ larger than the size of the uniform variable array, values for
+ all array elements beyond the end of the array will be ignored.
+ The number specified in the name of the command indicates the
+ number of components for each element in
+ value
, and it should match the number of
+ components in the data type of the specified uniform variable
+ (e.g., 1
for float, int, bool;
+ 2
for vec2, ivec2, bvec2, etc.). The data
+ type specified in the name of the command must match the data
+ type for the specified uniform variable as described previously
+ for glUniform{1|2|3|4}{f|i|ui}
.
For uniform variable arrays, each element of the array is
+ considered to be of the type indicated in the name of the
+ command (e.g., glUniform3f
or
+ glUniform3fv
can be used to load a uniform
+ variable array of type vec3). The number of elements of the
+ uniform variable array to be modified is specified by
+ count
The commands
+ glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv
+ are used to modify a matrix or an array of matrices. The numbers in the
+ command name are interpreted as the dimensionality of the matrix.
+ The number 2
indicates a 2 × 2 matrix
+ (i.e., 4 values), the number 3
indicates a
+ 3 × 3 matrix (i.e., 9 values), and the number
+ 4
indicates a 4 × 4 matrix (i.e., 16
+ values). Non-square matrix dimensionality is explicit, with the first
+ number representing the number of columns and the second number
+ representing the number of rows. For example,
+ 2x4
indicates a 2 × 4 matrix with 2 columns
+ and 4 rows (i.e., 8 values).
+ If transpose
is
+ GL_FALSE
, each matrix is assumed to be
+ supplied in column major order. If
+ transpose
is
+ GL_TRUE
, each matrix is assumed to be
+ supplied in row major order. The count
+ argument indicates the number of matrices to be passed. A count
+ of 1 should be used if modifying the value of a single matrix,
+ and a count greater than 1 can be used to modify an array of
+ matrices.
glUniform1i
and
+ glUniform1iv
are the only two functions
+ that may be used to load uniform variables defined as sampler
+ types. Loading samplers with any other function will result in a
+ GL_INVALID_OPERATION
error.
If count
is greater than 1 and the
+ indicated uniform variable is not an array, a
+ GL_INVALID_OPERATION
error is generated and the
+ specified uniform variable will remain unchanged.
Other than the preceding exceptions, if the type and size
+ of the uniform variable as defined in the shader do not match
+ the type and size specified in the name of the command used to
+ load its value, a GL_INVALID_OPERATION
error will
+ be generated and the specified uniform variable will remain
+ unchanged.
If location
is a value other than
+ -1 and it does not represent a valid uniform variable location
+ in the current program object, an error will be generated, and
+ no changes will be made to the uniform variable storage of the
+ current program object. If location
is
+ equal to -1, the data passed in will be silently ignored and the
+ specified uniform variable will not be changed.
GL_INVALID_OPERATION
is generated if there
+ is no current program object.
GL_INVALID_OPERATION
is generated if the
+ size of the uniform variable declared in the shader does not
+ match the size indicated by the glUniform
+ command.
GL_INVALID_OPERATION
is generated if one of
+ the signed or unsigned integer variants of this function is used to load a uniform
+ variable of type float
, vec2
, vec3
, vec4
, or an array of these,
+ or if one of the floating-point variants of this function is
+ used to load a uniform variable of type int
, ivec2
, ivec3
,
+ ivec4
, unsigned int
, uvec2
, uvec3
,
+ uvec4
, or an array of these.
GL_INVALID_OPERATION
is generated if one of
+ the signed integer variants of this function is used to load a uniform
+ variable of type unsigned int
, uvec2
, uvec3
,
+ uvec4
, or an array of these.
GL_INVALID_OPERATION
is generated if one of
+ the unsigned integer variants of this function is used to load a uniform
+ variable of type int
, ivec2
, ivec3
,
+ ivec4
, or an array of these.
GL_INVALID_OPERATION
is generated if
+ location
is an invalid uniform location
+ for the current program object and
+ location
is not equal to -1.
GL_INVALID_VALUE
is generated if
+ count
is less than 0.
GL_INVALID_OPERATION
is generated if
+ count
is greater than 1 and the indicated
+ uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a
+ sampler is loaded using a command other than
+ glUniform1i
and
+ glUniform1iv
.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveUniform + with the handle of a program object and the index of an active uniform variable
+glGetUniform + with the handle of a program object and the location of a + uniform variable
+glGetUniformLocation + with the handle of a program object and the name of a uniform + variable
++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glUniform1f
+ |
+ ✔ | +✔ | +
+ glUniform2f
+ |
+ ✔ | +✔ | +
+ glUniform3f
+ |
+ ✔ | +✔ | +
+ glUniform4f
+ |
+ ✔ | +✔ | +
+ glUniform1i
+ |
+ ✔ | +✔ | +
+ glUniform2i
+ |
+ ✔ | +✔ | +
+ glUniform3i
+ |
+ ✔ | +✔ | +
+ glUniform4i
+ |
+ ✔ | +✔ | +
+ glUniform1ui
+ |
+ - | +✔ | +
+ glUniform2ui
+ |
+ - | +✔ | +
+ glUniform3ui
+ |
+ - | +✔ | +
+ glUniform4ui
+ |
+ - | +✔ | +
+ glUniform1fv
+ |
+ ✔ | +✔ | +
+ glUniform2fv
+ |
+ ✔ | +✔ | +
+ glUniform3fv
+ |
+ ✔ | +✔ | +
+ glUniform4fv
+ |
+ ✔ | +✔ | +
+ glUniform1iv
+ |
+ ✔ | +✔ | +
+ glUniform2iv
+ |
+ ✔ | +✔ | +
+ glUniform3iv
+ |
+ ✔ | +✔ | +
+ glUniform4iv
+ |
+ ✔ | +✔ | +
+ glUniform1uiv
+ |
+ - | +✔ | +
+ glUniform2uiv
+ |
+ - | +✔ | +
+ glUniform3uiv
+ |
+ - | +✔ | +
+ glUniform4uiv
+ |
+ - | +✔ | +
+ glUniformMatrix2fv
+ |
+ ✔ | +✔ | +
+ glUniformMatrix3fv
+ |
+ ✔ | +✔ | +
+ glUniformMatrix4fv
+ |
+ ✔ | +✔ | +
+ glUniformMatrix2x3fv
+ |
+ - | +✔ | +
+ glUniformMatrix3x2fv
+ |
+ - | +✔ | +
+ glUniformMatrix2x4fv
+ |
+ - | +✔ | +
+ glUniformMatrix4x2fv
+ |
+ - | +✔ | +
+ glUniformMatrix3x4fv
+ |
+ - | +✔ | +
+ glUniformMatrix4x3fv
+ |
+ - | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glUniformBlockBinding — assign a binding point to an active uniform block
+
+ void glUniformBlockBinding(
+ |
+ GLuint program, | +
+ | GLuint uniformBlockIndex, | +
+ | GLuint uniformBlockBinding) ; |
+
program
+
+
+ + The name of a program object containing the active uniform block whose binding to assign. +
+uniformBlockIndex
+
+
+
+ The index of the active uniform block within program
whose binding to assign.
+
uniformBlockBinding
+
+
+
+ Specifies the binding point to which to bind the uniform block with index uniformBlockIndex
within program
.
+
+ Binding points for active uniform blocks are assigned using glUniformBlockBinding
. Each of a program's active uniform
+ blocks has a corresponding uniform buffer binding point. program
is the name of a program object for which the command
+ glLinkProgram has been issued in the past.
+
+ If successful, glUniformBlockBinding
specifies that program
will use the data store of the
+ buffer object bound to the binding point uniformBlockBinding
to extract the values of the uniforms in the
+ uniform block identified by uniformBlockIndex
.
+
+ When a program object is linked or re-linked, the uniform buffer object binding point assigned to each of its active uniform blocks is reset to zero. +
+
+ GL_INVALID_VALUE
is generated if uniformBlockIndex
is not an active uniform block index of program
.
+
+ GL_INVALID_VALUE
is generated if uniformBlockBinding
is greater than or equal to the value of GL_MAX_UNIFORM_BUFFER_BINDINGS
.
+
+ GL_INVALID_VALUE
is generated if program
is not the name of a program object generated by the GL.
+
+ glGet with argument GL_MAX_UNIFORM_BUFFER_BINDINGS
+
+ glGetActiveUniformBlockiv with argument GL_UNIFORM_BLOCK_BINDING
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glUniformBlockBinding | +- | +✔ | +
+ glLinkProgram, + glBindBufferBase, + glBindBufferRange, + glGetActiveUniformBlockiv +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glUseProgram — Installs a program object as part of current rendering state
+
+ void glUseProgram(
+ |
+ GLuint program) ; |
+
program
+
+
+ Specifies the handle of the program object + whose executables are to be used as part of current + rendering state.
+glUseProgram
installs the program
+ object specified by program
as part of
+ current rendering state. One or more executables are created in
+ a program object by successfully attaching shader objects to it
+ with
+ glAttachShader,
+ successfully compiling the shader objects with
+ glCompileShader,
+ and successfully linking the program object with
+ glLinkProgram.
+
A program object will contain an executable that will run
+ on the vertex processor if it contains a shader
+ object of type GL_VERTEX_SHADER
that has
+ been successfully compiled and linked.
+ Similarly, a program object will contain an executable that will run on the
+ fragment processor if it contains a shader object of type
+ GL_FRAGMENT_SHADER
that has been
+ successfully compiled and linked.
While a program object is in use, applications are free to
+ modify attached shader objects, compile attached shader objects,
+ attach additional shader objects, and detach or delete shader
+ objects. None of these operations will affect the executables
+ that are part of the current state. However, relinking the
+ program object that is currently in use will install the program
+ object as part of the current rendering state if the link
+ operation was successful (see
+ glLinkProgram
+ ). If the program object currently in use is relinked
+ unsuccessfully, its link status will be set to
+ GL_FALSE
, but the executables and
+ associated state will remain part of the current state until a
+ subsequent call to glUseProgram
removes it
+ from use. After it is removed from use, it cannot be made part
+ of current state until it has been successfully relinked.
If program
is zero, then the current rendering
+ state refers to an invalid program object and the
+ results of shader execution are undefined. However, this is not an error.
Like buffer and texture objects, the name space for + program objects may be shared across a set of contexts, as long + as the server sides of the contexts share the same address + space. If the name space is shared across contexts, any attached + objects and the data associated with those attached objects are + shared as well.
+Applications are responsible for providing the + synchronization across API calls when objects are accessed from + different execution threads.
+GL_INVALID_VALUE
is generated if
+ program
is neither 0 nor a value
+ generated by OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
GL_INVALID_OPERATION
is generated if
+ program
could not be made part of current
+ state.
GL_INVALID_OPERATION
is generated if
+ transform feedback mode is active and not paused.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib + with a valid program object and the index of an active attribute + variable
+glGetActiveUniform + with a valid program object and the index of an active uniform + variable
+glGetAttachedShaders + with a valid program object
+glGetAttribLocation + with a valid program object and the name of an attribute + variable
+glGetProgramiv + with a valid program object and the parameter to be queried
+glGetProgramInfoLog + with a valid program object
+glGetUniform + with a valid program object and the location of a uniform + variable
+glGetUniformLocation + with a valid program object and the name of a uniform + variable
+ ++ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glUseProgram | +✔ | +✔ | +
glAttachShader, + glBindAttribLocation, + glCompileShader, + glCreateProgram, + glDeleteProgram, + glDetachShader, + glLinkProgram, + glUniform, + glValidateProgram, + glVertexAttrib
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glValidateProgram — Validates a program object
+
+ void glValidateProgram(
+ |
+ GLuint program) ; |
+
program
+
+
+ Specifies the handle of the program object to + be validated.
+glValidateProgram
checks to see
+ whether the executables contained in
+ program
can execute given the current
+ OpenGL state. The information generated by the validation
+ process will be stored in program
's
+ information log. The validation information may consist of an
+ empty string, or it may be a string containing information about
+ how the current program object interacts with the rest of
+ current OpenGL state. This provides a way for OpenGL
+ implementers to convey more information about why the current
+ program is inefficient, suboptimal, failing to execute, and so
+ on.
The status of the validation operation will be stored as
+ part of the program object's state. This value will be set to
+ GL_TRUE
if the validation succeeded, and
+ GL_FALSE
otherwise. It can be queried by
+ calling
+ glGetProgramiv
+ with arguments program
and
+ GL_VALIDATE_STATUS
. If validation is
+ successful, program
is guaranteed to
+ execute given the current state. Otherwise,
+ program
is guaranteed to not execute.
This function is typically useful only during application + development. The informational string stored in the information + log is completely implementation dependent; therefore, an + application should not expect different OpenGL implementations + to produce identical information strings.
+This function mimics the validation operation that OpenGL
+ implementations must perform when rendering commands are issued
+ while programmable shaders are part of current state. The error
+ GL_INVALID_OPERATION
will be generated by
+ any command that triggers the rendering of geometry if:
any two active samplers in the current program + object are of different types, but refer to the same + texture image unit,
+the number of active samplers in the program exceeds the maximum + number of texture image units allowed.
+It may be difficult or cause a performance degradation for
+ applications to catch these errors when rendering commands are
+ issued. Therefore, applications are advised to make calls to
+ glValidateProgram
to detect these issues
+ during application development.
GL_INVALID_VALUE
is generated if
+ program
is not a value generated by
+ OpenGL.
GL_INVALID_OPERATION
is generated if
+ program
is not a program object.
glGetProgramiv
+ with arguments program
and
+ GL_VALIDATE_STATUS
glGetProgramInfoLog
+ with argument program
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glValidateProgram | +✔ | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glVertexAttrib — Specifies the value of a generic vertex attribute
+
+ void glVertexAttrib1f(
+ |
+ GLuint index, | +
+ | GLfloat v0) ; |
+
+ void glVertexAttrib2f(
+ |
+ GLuint index, | +
+ | GLfloat v0, | +
+ | GLfloat v1) ; |
+
+ void glVertexAttrib3f(
+ |
+ GLuint index, | +
+ | GLfloat v0, | +
+ | GLfloat v1, | +
+ | GLfloat v2) ; |
+
+ void glVertexAttrib4f(
+ |
+ GLuint index, | +
+ | GLfloat v0, | +
+ | GLfloat v1, | +
+ | GLfloat v2, | +
+ | GLfloat v3) ; |
+
+ void glVertexAttribI4i(
+ |
+ GLuint index, | +
+ | GLint v0, | +
+ | GLint v1, | +
+ | GLint v2, | +
+ | GLint v3) ; |
+
+ void glVertexAttribI4ui(
+ |
+ GLuint index, | +
+ | GLuint v0, | +
+ | GLuint v1, | +
+ | GLuint v2, | +
+ | GLuint v3) ; |
+
+ void glVertexAttrib1fv(
+ |
+ GLuint index, | +
+ | const GLfloat *v) ; |
+
+ void glVertexAttrib2fv(
+ |
+ GLuint index, | +
+ | const GLfloat *v) ; |
+
+ void glVertexAttrib3fv(
+ |
+ GLuint index, | +
+ | const GLfloat *v) ; |
+
+ void glVertexAttrib4fv(
+ |
+ GLuint index, | +
+ | const GLfloat *v) ; |
+
+ void glVertexAttribI4iv(
+ |
+ GLuint index, | +
+ | const GLint *v) ; |
+
+ void glVertexAttribI4uiv(
+ |
+ GLuint index, | +
+ | const GLuint *v) ; |
+
index
+
+
+ Specifies the index of the generic vertex + attribute to be modified.
+v0
,
+ v1
,
+ v2
,
+ v3
+
+ + For the scalar commands, specifies the new values to be used + for the specified vertex attribute. +
+v
+
+
+
+ For the vector commands
+ (glVertexAttrib*v
), specifies a pointer
+ to an array of values to be used for the generic vertex
+ attribute.
+
The glVertexAttrib
family of entry points
+ allows an application to pass generic vertex attributes in
+ numbered locations.
Generic attributes are defined as four-component values
+ that are organized into an array. The first entry of this array
+ is numbered 0, and the size of the array is specified by the
+ implementation-dependent constant
+ GL_MAX_VERTEX_ATTRIBS
. Individual elements
+ of this array can be modified with a
+ glVertexAttrib
call that specifies the
+ index of the element to be modified and a value for that
+ element.
These commands can be used to specify one, two, three, or
+ all four components of the generic vertex attribute specified by
+ index
. A 1
in the
+ name of the command indicates that only one value is passed, and
+ it will be used to modify the first component of the generic
+ vertex attribute. The second and third components will be set to
+ 0, and the fourth component will be set to 1. Similarly, a
+ 2
in the name of the command indicates that
+ values are provided for the first two components, the third
+ component will be set to 0, and the fourth component will be set
+ to 1. A 3
in the name of the command
+ indicates that values are provided for the first three
+ components and the fourth component will be set to 1, whereas a
+ 4
in the name indicates that values are
+ provided for all four components.
The letters f
, i
,
+ and ui
indicate
+ whether the arguments are of type float, int, or unsigned int. When
+ v
is appended to the name, the commands can
+ take a pointer to an array of such values.
Additional capitalized letters can indicate further alterations + to the default behavior of the glVertexAttrib function:
+
+ The commands containing I
indicate that
+ the arguments are extended to full signed or unsigned integers.
+
OpenGL ES Shading Language attribute variables are allowed to
+ be of type mat2, mat3, or mat4. Attributes of these types may be
+ loaded using the glVertexAttrib
entry
+ points. Matrices must be loaded into successive generic
+ attribute slots in column major order, with one column of the
+ matrix in each generic attribute slot.
A user-defined attribute variable declared in a vertex + shader can be bound to a generic attribute index by calling + glBindAttribLocation. + This allows an application to use more descriptive variable + names in a vertex shader. A subsequent change to the specified + generic vertex attribute will be immediately reflected as a + change to the corresponding attribute variable in the vertex + shader.
+The binding between a generic vertex attribute index and a + user-defined attribute variable in a vertex shader is part of + the state of a program object, but the current value of the + generic vertex attribute is not. The value of each generic + vertex attribute is part of current state, and it is maintained + even if a different program object is used.
+An application may freely modify generic vertex attributes + that are not bound to a named vertex shader attribute variable. + These values are simply maintained as part of current state and + will not be accessed by the vertex shader. If a generic vertex + attribute bound to an attribute variable in a vertex shader is + not updated while the vertex shader is executing, the vertex + shader will repeatedly use the current value for the generic + vertex attribute.
+Generic vertex attributes can be updated at any time.
+It is possible for an application to bind more than one + attribute name to the same generic vertex attribute index. This + is referred to as aliasing, and it is allowed only if just one + of the aliased attribute variables is active in the vertex + shader, or if no path through the vertex shader consumes more + than one of the attributes aliased to the same location. OpenGL + implementations are not required to do error checking to detect + aliasing, they are allowed to assume that aliasing will not + occur, and they are allowed to employ optimizations that work + only in the absence of aliasing.
+The resulting attribute values are undefined if the base
+ type of the shader attribute at slot index
+ does not match the type of glUniform command used.
+ If the attribute is floating point, the glUniform*f[v]
commands
+ should be used. If the attribute is unsigned integer,
+ the glUniformI4ui*
commands should be used. If the attribute is
+ a signed integer, the glUniformI4i*
commands should be used.
+
GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to
+ GL_MAX_VERTEX_ATTRIBS
.
glGet
+ with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib
+ with argument program
and the index of an active
+ attribute variable
glGetAttribLocation
+ with argument program
and an attribute
+ variable name
glGetVertexAttrib
+ with arguments GL_CURRENT_VERTEX_ATTRIB
and
+ index
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glVertexAttrib1f
+ |
+ ✔ | +✔ | +
+ glVertexAttrib2f
+ |
+ ✔ | +✔ | +
+ glVertexAttrib3f
+ |
+ ✔ | +✔ | +
+ glVertexAttrib4f
+ |
+ ✔ | +✔ | +
+ glVertexAttribI4i
+ |
+ - | +✔ | +
+ glVertexAttribI4ui
+ |
+ - | +✔ | +
+ glVertexAttrib1fv
+ |
+ ✔ | +✔ | +
+ glVertexAttrib2fv
+ |
+ ✔ | +✔ | +
+ glVertexAttrib3fv
+ |
+ ✔ | +✔ | +
+ glVertexAttrib4fv
+ |
+ ✔ | +✔ | +
+ glVertexAttribI4iv
+ |
+ - | +✔ | +
+ glVertexAttribI4uiv
+ |
+ - | +✔ | +
+ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glVertexAttribDivisor — modify the rate at which generic vertex attributes advance during instanced rendering
+
+ void glVertexAttribDivisor(
+ |
+ GLuint index, | +
+ | GLuint divisor) ; |
+
index
+
+
+ + Specify the index of the generic vertex attribute. +
+divisor
+
+
+
+ Specify the number of instances that will pass between updates of the generic attribute at slot index
.
+
+ glVertexAttribDivisor
modifies the rate at which generic vertex attributes advance when rendering
+ multiple instances of primitives in a single draw call (see glDrawArraysInstanced and
+ glDrawElementsInstanced). If divisor
is zero, the attribute at slot
+ index
advances once per vertex. If divisor
is non-zero, the attribute advances
+ once per divisor
instances of the set(s) of vertices being rendered. An attribute
+ is referred to as instanced if its GL_VERTEX_ATTRIB_ARRAY_DIVISOR
value is non-zero.
+
+ index
must be less than the value of GL_MAX_VERTEX_ATTRIBUTES
.
+
+ GL_INVALID_VALUE
is generated if index
is greater
+ than or equal to the value of GL_MAX_VERTEX_ATTRIBUTES
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glVertexAttribDivisor | +- | +✔ | +
+ glDrawArraysInstanced, + glDrawElementsInstanced, + glVertexAttribPointer, + glEnableVertexAttribArray, + glDisableVertexAttribArray +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glVertexAttribPointer — define an array of generic vertex attribute data
+
+ void glVertexAttribPointer(
+ |
+ GLuint index, | +
+ | GLint size, | +
+ | GLenum type, | +
+ | GLboolean normalized, | +
+ | GLsizei stride, | +
+ | const GLvoid * pointer) ; |
+
+ void glVertexAttribIPointer(
+ |
+ GLuint index, | +
+ | GLint size, | +
+ | GLenum type, | +
+ | GLsizei stride, | +
+ | const GLvoid * pointer) ; |
+
index
+
+
+ Specifies the index of the generic vertex + attribute to be modified.
+size
+
+
+ Specifies the number of components per + generic vertex attribute. Must + be 1, 2, 3, 4. The initial value is 4.
+type
+
+
+ Specifies the data type of each component in
+ the array. The symbolic constants
+ GL_BYTE
,
+ GL_UNSIGNED_BYTE
,
+ GL_SHORT
,
+ GL_UNSIGNED_SHORT
,
+ GL_INT
, and
+ GL_UNSIGNED_INT
are accepted by both functions. Additionally
+ GL_HALF_FLOAT
,
+ GL_FLOAT
,
+ GL_FIXED
,
+ GL_INT_2_10_10_10_REV
, and
+ GL_UNSIGNED_INT_2_10_10_10_REV
are accepted by glVertexAttribPointer
.
+ The initial value is GL_FLOAT
.
normalized
+
+
+ For glVertexAttribPointer
, specifies whether fixed-point data values
+ should be normalized (GL_TRUE
)
+ or converted directly as fixed-point values
+ (GL_FALSE
) when they are
+ accessed. This parameter is ignored if type
is GL_FIXED
.
stride
+
+
+ Specifies the byte offset between consecutive
+ generic vertex attributes. If stride
+ is 0, the generic vertex attributes are
+ understood to be tightly packed in the
+ array. The initial value is 0.
pointer
+
+
+ Specifies a pointer to the first generic vertex attribute in the array. If a non-zero buffer is currently
+ bound to the GL_ARRAY_BUFFER
target, pointer
specifies an offset of
+ into the array in the data store of that buffer. The initial value is 0.
+ glVertexAttribPointer
and glVertexAttribIPointer
specify the
+ location and data format of the array of generic vertex attributes at index index
+ to use when rendering. size
specifies the number of components per attribute and
+ must be 1, 2, 3 or 4. type
specifies the data type
+ of each component, and stride
specifies the byte stride from one attribute to the next,
+ allowing vertices and attributes to be packed into a single array or stored in separate arrays.
+
+ For glVertexAttribPointer
, if normalized
is set to GL_TRUE
,
+ it indicates that values stored in an integer format are to be mapped to the range [-1,1] (for signed values) or [0,1] (for
+ unsigned values) when they are accessed and converted to floating point. Otherwise, values will
+ be converted to floats directly without normalization.
+
+ For glVertexAttribIPointer
, only the integer types GL_BYTE
,
+ GL_UNSIGNED_BYTE
, GL_SHORT
, GL_UNSIGNED_SHORT
,
+ GL_INT
, GL_UNSIGNED_INT
are accepted. Values are always left as integer values.
+
+ If a non-zero named buffer object is bound to the GL_ARRAY_BUFFER
target
+ (see glBindBuffer),
+ pointer
is treated as a byte offset into the buffer object's data store and
+ the buffer object binding (GL_ARRAY_BUFFER_BINDING
) is saved as generic vertex attribute array
+ state (GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
) for index index
.
+
+ Client vertex arrays (a binding of zero to the GL_ARRAY_BUFFER
target) are only valid in
+ conjunction with the zero named vertex array object. This is provided for backwards compatibility with OpenGL ES 2.0.
+
+ When a generic vertex attribute array is specified,
+ size
, type
,
+ normalized
,
+ stride
, and
+ pointer
are saved as vertex array
+ state, in addition to the current vertex array buffer object binding.
+
+ To enable and disable a generic vertex attribute array, call
+ glEnableVertexAttribArray and
+ glDisableVertexAttribArray with index
.
+ If enabled, the generic vertex attribute array is used when glDrawArrays,
+ glDrawArraysInstanced, glDrawElements,
+ glDrawElementsIntanced, or glDrawRangeElements
+ is called.
+
+ Each generic vertex attribute array is initially disabled and isn't accessed when + glDrawElements, glDrawRangeElements, + glDrawArrays, glDrawArraysInstanced, or glDrawElementsInstanced + is called. +
+GL_INVALID_VALUE
is generated if
+ index
is greater than or equal to
+ GL_MAX_VERTEX_ATTRIBS
.
GL_INVALID_VALUE
is generated if
+ size
is not 1, 2, 3 or 4.
GL_INVALID_ENUM
is generated if
+ type
is not an accepted value.
GL_INVALID_VALUE
is generated if
+ stride
is negative.
GL_INVALID_OPERATION
is generated if type
+ is GL_INT_2_10_10_10_REV
or GL_UNSIGNED_INT_2_10_10_10_REV
+ and size
is not 4.
GL_INVALID_OPERATION
is generated a non-zero vertex array
+ object is bound, zero is bound to the GL_ARRAY_BUFFER
buffer object
+ binding point and the pointer
argument is not NULL
.
glGet
+ with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_ENABLED
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_SIZE
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_TYPE
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_STRIDE
glGetVertexAttrib
+ with arguments index
and GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
glGet with argument
+ GL_ARRAY_BUFFER_BINDING
glGetVertexAttribPointerv
+ with arguments index
and
+ GL_VERTEX_ATTRIB_ARRAY_POINTER
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
+ glVertexAttribPointer
+ |
+ ✔ | +✔ | +
+ glVertexAttribIPointer
+ |
+ - | +✔ | +
+ glBindAttribLocation, + glBindBuffer, + glDisableVertexAttribArray, + glDrawArrays, + glDrawElements, + glDrawRangeElements, + glEnableVertexAttribArray, + glDrawArraysInstanced, + glDrawElementsIntanced, + glVertexAttrib +
++ Copyright © 2003-2005 3Dlabs Inc. Ltd. + Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+glViewport — set the viewport
+
+ void glViewport(
+ |
+ GLint x, | +
+ | GLint y, | +
+ | GLsizei width, | +
+ | GLsizei height) ; |
+
x
,
+
+
+ y
+
+
+ + Specify the lower left corner of the viewport rectangle, + in pixels. The initial value is (0,0). +
+width
,
+
+
+ height
+
+
+
+ Specify the width and height
+ of the viewport.
+ When a GL context is first attached to a window,
+ width
and height
are set to the dimensions of that
+ window.
+
+ glViewport
specifies the affine transformation of
+
+
++
++
++
+
+ Viewport width and height are silently clamped
+ to a range that depends on the implementation.
+ To query this range, call glGet with argument
+ GL_MAX_VIEWPORT_DIMS
.
+
+ GL_INVALID_VALUE
is generated if either width
or height
is negative.
+
+ glGet with argument GL_VIEWPORT
+
+ glGet with argument GL_MAX_VIEWPORT_DIMS
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glViewport | +✔ | +✔ | +
+ glDepthRangef +
++ Copyright © 1991-2006 Silicon Graphics, Inc. + Copyright © 2010-2014 Khronos Group. + This document is licensed under the SGI Free Software B License. + For details, see + http://oss.sgi.com/projects/FreeB/. +
+glWaitSync — instruct the GL server to block until the specified sync object becomes signaled
+
+ void glWaitSync(
+ |
+ GLsync sync, | +
+ | GLbitfield flags, | +
+ | GLuint64 timeout) ; |
+
sync
+
+
+ + Specifies the sync object whose status to wait on. +
+flags
+
+
+
+ A bitfield controlling the command flushing behavior. flags
must be zero.
+
timeout
+
+
+
+ Specifies the timeout that the server should wait before continuing. timeout
must be GL_TIMEOUT_IGNORED
.
+
+ glWaitSync
causes the GL server to block and wait until sync
becomes signaled. sync
+ is the name of an existing sync object upon which to wait. flags
and timeout
are currently not used and
+ must be set to zero and the special value GL_TIMEOUT_IGNORED
, respectively[1]. glWaitSync
will always wait no longer than an implementation-dependent timeout. The
+ duration of this timeout in nanoseconds may be queried by calling glGet with the
+ parameter GL_MAX_SERVER_WAIT_TIMEOUT
. There is currently no way to determine whether glWaitSync
unblocked
+ because the timeout expired or because the sync object being waited on was signaled.
+
+ If an error occurs, glWaitSync
does not cause the GL server to block.
+
+ GL_INVALID_OPERATION
is generated if sync
is not the name of a sync object.
+
+ GL_INVALID_VALUE
is generated if flags
is not zero.
+
+ GL_INVALID_VALUE
is generated if timeout
is not GL_TIMEOUT_IGNORED
.
+
+ + | ++ OpenGL ES API Version + | +|
---|---|---|
+ Function Name + | ++ 2.0 + | ++ 3.0 + | +
glWaitSync | +- | +✔ | +
+ glFenceSync, + glClientWaitSync +
++ Copyright © 2010-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+[1] flags
and
+ timeout
are placeholders for anticipated future extensions of sync object capabilities. They must have these reserved values in
+ order that existing code calling glWaitSync
operate properly in the presence of such extensions.
gl_FragCoord — contains the window-relative coordinates of the current fragment
+in highp vec4 gl_FragCoord ;
+
+ Available only in the fragment language, gl_FragCoord
is an input variable that contains the
+ window relative coordinate (x, y, z, 1/w) values for the fragment. If multi-sampling,
+ this value can be for any location within the pixel, or one of the fragment samples.
+ This value is the result of fixed functionality that interpolates primitives after vertex
+ processing to generate fragments. The z component is the depth value that would be used for the
+ fragment's depth if no shader contained any writes to gl_FragDepth.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Variable Name + | ++ 1.00 + | ++ 3.00 + | +
gl_FragCoord | +✔ | +✔ | +
+ gl_FragDepth +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+gl_FragDepth — establishes a depth value for the current fragment
+out highp float gl_FragDepth ;
+
+ Available only in the fragment language, gl_FragDepth
is an output variable
+ that is used to establish the depth value for the current fragment. If depth buffering is enabled
+ and no shader writes to gl_FragDepth
, then the fixed varname value for
+ depth will be used (this value is contained in the z component of gl_FragCoord)
+ otherwise, the value written to gl_FragDepth
is used.
+ If a shader statically assigns to gl_FragDepth
, then the value of the fragment's depth
+ may be undefined for executions of the shader that take that path. That is, if the set of linked fragment
+ shaders statically contain a write to gl_FragDepth
, then it is responsible for always
+ writing it.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Variable Name + | ++ 1.00 + | ++ 3.00 + | +
gl_FragDepth | +- | +✔ | +
+ gl_FragCoord +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+gl_FrontFacing — indicates whether a primitive is front or back facing
+in bool gl_FrontFacing ;
+
+ Available only in the fragment language, gl_FrontFacing
is an input variable
+ whose value is true
if the fragment belongs to a front-facing primitive and
+ false otherwise. The determination of whether a triangle primitive is front-facing is made by
+ examining the sign of the area of the triangle, including a possible reversal of this sign
+ as controlled by glFrontFace
. One way to compute this area is:
+
+
+ where
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Variable Name + | ++ 1.00 + | ++ 3.00 + | +
gl_FrontFacing | +✔ | +✔ | +
+ gl_FragCoord +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+gl_InstanceID — contains the index of the current primitive in an instanced draw command
+in highp int gl_InstanceID ;
+
+ gl_InstanceID
is a vertex language input variable that
+ holds the integer index of the current primitive in an instanced draw
+ command such as glDrawArraysInstanced
. If the current
+ primitive does not originate from an instanced draw command, the value
+ of gl_InstanceID
is zero.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Variable Name + | ++ 1.00 + | ++ 3.00 + | +
gl_InstanceID | +- | +✔ | +
+ gl_VertexID +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+gl_PointCoord — contains the coordinate of a fragment within a point
+in mediump vec2 gl_PointCoord ;
+
+ gl_PointCoord
is a fragment language input variable that contains
+ the two-dimensional coordinates indicating where within a point primitive the current
+ fragment is located. If the current primitive is not a point, then values read
+ from gl_PointCoord
are undefined.
+
+ gl_PointCoord.s
ranges from 0.0 to 1.0 across the point horizontally
+ from left to right. gl_PointCoord.t
varies
+ from 0.0 to 1.0 vertically from top to bottom.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Variable Name + | ++ 1.00 + | ++ 3.00 + | +
gl_PointCoord | +✔ | +✔ | +
+ gl_FragCoord, + gl_FragDepth +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+gl_PointSize — contains size of rasterized points, in pixels
+out highp float gl_PointSize ;
+
+ The variable gl_PointSize
is intended for a vertex shader to write
+ the size of the point to be rasterized. It is measured in pixels.
+ If gl_PointSize
is not written to, its value is undefined in subsequent
+ pipeline stages.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Variable Name + | ++ 1.00 + | ++ 3.00 + | +
gl_PointSize | +✔ | +✔ | +
+ gl_Position +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+gl_Position — contains the position of the current vertex
+out highp vec4 gl_Position ;
+
+ The variable gl_Position
is intended for writing the homogeneous
+ vertex position. It can be written at any time during vertexshader execution. This value
+ will be used by primitive assembly, clipping, culling, and other fixed functionality
+ operations, if present, that operate on primitives after vertex processing has occurred.
+ Its value is undefined after the vertex processing stage if the vertex shader executable
+ does not write gl_Position
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Variable Name + | ++ 1.00 + | ++ 3.00 + | +
gl_Position | +✔ | +✔ | +
+ gl_PointSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+gl_VertexID — contains the index of the current vertex
+in highp int gl_VertexID ;
+
+ gl_VertexID
is a vertex language input variable that holds an
+ integer index for the vertex. The index is impliclty generated by glDrawArrays
+ and other commands that do not reference the content of the GL_ELEMENT_ARRAY_BUFFER
, or
+ explicitly generated from the content of the GL_ELEMENT_ARRAY_BUFFER
+ by commands such as glDrawElements
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Variable Name + | ++ 1.00 + | ++ 3.00 + | +
gl_VertexID | +- | +✔ | +
+ gl_InstanceID +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+greaterThan — perform a component-wise greater-than comparison of two vectors
+
+ bvec greaterThan(
+ |
+ vec x, | +
+ | vec y) ; |
+
+ bvec greaterThan(
+ |
+ ivec x, | +
+ | ivec y) ; |
+
+ bvec greaterThan(
+ |
+ uvec x, | +
+ | uvec y) ; |
+
x
+
+
+ + Specifies the first vector to be used in the comparison operation. +
+y
+
+
+ + Specifies the second vector to be used in the comparison operation. +
+
+ greaterThan
returns a boolean vector in which each element i is computed
+ as x
[i] > y
[i].
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
greaterThan (vec) | +✔ | +✔ | +
greaterThan (ivec) | +✔ | +✔ | +
greaterThan (uvec) | +- | +✔ | +
+ lessThan, + lessThanEqual, + greaterThanEqual, + equal, + notEqual, + any, + all, + not +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+greaterThanEqual — perform a component-wise greater-than-or-equal comparison of two vectors
+
+ bvec greaterThanEqual(
+ |
+ vec x, | +
+ | vec y) ; |
+
+ bvec greaterThanEqual(
+ |
+ ivec x, | +
+ | ivec y) ; |
+
+ bvec greaterThanEqual(
+ |
+ uvec x, | +
+ | uvec y) ; |
+
x
+
+
+ + Specifies the first vector to be used in the comparison operation. +
+y
+
+
+ + Specifies the second vector to be used in the comparison operation. +
+
+ greaterThanEqual
returns a boolean vector in which each element i is computed
+ as x
[i] ≥ y
[i].
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
greaterThanEqual (vec) | +✔ | +✔ | +
greaterThanEqual (ivec) | +✔ | +✔ | +
greaterThanEqual (uvec) | +- | +✔ | +
+ lessThan, + lessThanEqual, + greaterThan, + equal, + notEqual, + any, + all, + not +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+intBitsToFloat, uintBitsToFloat — produce a floating point using an encoding supplied as an integer
+
+ genType intBitsToFloat(
+ |
+ genIType x) ; |
+
+ genType uintBitsToFloat(
+ |
+ genUType x) ; |
+
x
+
+
+ + Specifies the bit encoding to return as a floating point value. +
+
+ intBitsToFloat
and uintBitsToFloat
return the encoding
+ passed in parameter x
as a highp floating-point value. If the encoding of
+ a NaN is passed in x
, it will not signal and the resulting value will
+ be undefined. If the encoding of a floating point infinity is passed in parameter x
,
+ the resulting floating-point value is the corresponding (positive or negative) floating
+ point infinity. For lowp and mediump, the value is first converted to the corresponding signed or
+ unsigned highp integer and then reinterpreted as a highp floating point value as before.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
intBitsToFloat | +- | +✔ | +
uintBitsToFloat | +- | +✔ | +
+ floatBitsToInt, + floatBitsToUint, + isnan, + isinf +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+inverse — calculate the inverse of a matrix
+
+ mat2 inverse(
+ |
+ mat2 m) ; |
+
+ mat3 inverse(
+ |
+ mat3 m) ; |
+
+ mat4 inverse(
+ |
+ mat4 m) ; |
+
m
+
+
+ + Specifies the matrix of which to take the inverse. +
+
+ inverse
returns the inverse of the matrix m
. The values in the
+ returned matrix are undefined if m
is singular or poorly-conditioned (nearly singular).
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
inverse (genType) | +- | +✔ | +
+ transpose, + determinant +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+inversesqrt — return the inverse of the square root of the parameter
+
+ genType inversesqrt(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value of which to take the inverse of the square root. +
+
+ inversesqrt
returns the inverse of the square root of x
.
+ i.e., the value
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
inversesqrt (genType) | +✔ | +✔ | +
+ sqrt +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+isinf — determine whether the parameter is positive or negative infinity
+
+ genBType isinf(
+ |
+ genType x) ; |
+
x
+
+
+ + Specifies the value to test for infinity. +
+
+ For each element element i of the result, isinf
returns true
if
+ x
[i] is posititve or negative floating point infinity and false otherwise.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
isinf (genType) | +- | +✔ | +
+ isnan +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+isnan — determine whether the parameter is a number
+
+ genBType isnan(
+ |
+ genType x) ; |
+
x
+
+
+ + Specifies the value to test for NaN. +
+
+ For each element element i of the result, isnan
returns true
if
+ x
[i] is posititve or negative floating point NaN (Not a Number) and false otherwise.
+ NaNs may not be supported by the implementation, in which case isnan
returns false.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
isnan (genType) | +- | +✔ | +
+ isinf +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+length — calculate the length of a vector
+
+ float length(
+ |
+ genType x) ; |
+
x
+
+
+ + Specifies a vector of which to calculate the length. +
+
+ length
returns the length of the vector. i.e.,
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
length (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+lessThan — perform a component-wise less-than comparison of two vectors
+
+ bvec lessThan(
+ |
+ vec x, | +
+ | vec y) ; |
+
+ bvec lessThan(
+ |
+ ivec x, | +
+ | ivec y) ; |
+
+ bvec lessThan(
+ |
+ uvec x, | +
+ | uvec y) ; |
+
x
+
+
+ + Specifies the first vector to be used in the comparison operation. +
+y
+
+
+ + Specifies the second vector to be used in the comparison operation. +
+
+ lessThan
returns a boolean vector in which each element i is computed
+ as x
[i] < y
[i].
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
lessThan (vec) | +✔ | +✔ | +
lessThan (ivec) | +✔ | +✔ | +
lessThan (uvec) | +- | +✔ | +
+ lessThanEqual, + greaterThan, + greaterThanEqual, + equal, + notEqual, + any, + all, + not +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+lessThanEqual — perform a component-wise less-than-or-equal comparison of two vectors
+
+ bvec lessThanEqual(
+ |
+ vec x, | +
+ | vec y) ; |
+
+ bvec lessThanEqual(
+ |
+ ivec x, | +
+ | ivec y) ; |
+
+ bvec lessThanEqual(
+ |
+ uvec x, | +
+ | uvec y) ; |
+
x
+
+
+ + Specifies the first vector to be used in the comparison operation. +
+y
+
+
+ + Specifies the second vector to be used in the comparison operation. +
+
+ lessThanEqual
returns a boolean vector in which each element i is computed
+ as x
[i] ≤ y
[i].
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
lessThanEqual (vec) | +✔ | +✔ | +
lessThanEqual (ivec) | +✔ | +✔ | +
lessThanEqual (uvec) | +- | +✔ | +
+ lessThan, + greaterThan, + greaterThanEqual, + equal, + notEqual, + any, + all, + not +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+log — return the natural logarithm of the parameter
+
+ genType log(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value of which to take the natural logarithm. +
+
+ log
returns the natural logarithm of x
. i.e., the value
+ x
≤ 0.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
log | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+log2 — return the base 2 logarithm of the parameter
+
+ genType log2(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value of which to take the base 2 logarithm. +
+
+ log2
returns the base 2 logarithm of x
. i.e., the value
+ x
≤ 0.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
log2 | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+matrixCompMult — perform a component-wise multiplication of two matrices
+
+ mat matrixCompMult(
+ |
+ mat x, | +
+ | mat y) ; |
+
x
+
+
+ + Specifies the first matrix multiplicand. +
+y
+
+
+ + Specifies the second matrix multiplicand. +
+
+ matrixCompMult
performs a component-wise multiplication of two
+ matrices, yielding a result matrix where each component, result[i][j]
is
+ computed as the scalar product of
and
+ x
[i][j]
.
+ y
[i][j]
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
matrixCompMult (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+max — return the greater of two values
+
+ genType max(
+ |
+ genType x, | +
+ | genType y) ; |
+
+ genType max(
+ |
+ genType x, | +
+ | float y) ; |
+
+ genIType max(
+ |
+ genIType x, | +
+ | genIType y) ; |
+
+ genIType max(
+ |
+ genIType x, | +
+ | int y) ; |
+
+ genUType max(
+ |
+ genUType x, | +
+ | genUType y) ; |
+
+ genUType max(
+ |
+ genUType x, | +
+ | uint y) ; |
+
x
+
+
+ + Specify the first value to compare. +
+y
+
+
+ + Specify the second value to compare. +
+
+ max
returns the maximum of the two parameters. It
+ returns y
if y
is greater than
+ x
, otherwise it returns x
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
max (genType) | +✔ | +✔ | +
max (genIType) | +- | +✔ | +
max (genUType) | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+min — return the lesser of two values
+
+ genType min(
+ |
+ genType x, | +
+ | genType y) ; |
+
+ genType min(
+ |
+ genType x, | +
+ | float y) ; |
+
+ genIType min(
+ |
+ genIType x, | +
+ | genIType y) ; |
+
+ genIType min(
+ |
+ genIType x, | +
+ | int y) ; |
+
+ genUType min(
+ |
+ genUType x, | +
+ | genUType y) ; |
+
+ genUType min(
+ |
+ genUType x, | +
+ | uint y) ; |
+
x
+
+
+ + Specify the first value to compare. +
+y
+
+
+ + Specify the second value to compare. +
+
+ min
returns the minimum of the two parameters. It
+ returns y
if y
is less than
+ x
, otherwise it returns x
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
min (genType) | +✔ | +✔ | +
min (genIType) | +- | +✔ | +
min (genUType) | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+mix — linearly interpolate between two values
+
+ genType mix(
+ |
+ genType x, | +
+ | genType y, | +
+ | genType a) ; |
+
+ genType mix(
+ |
+ genType x, | +
+ | genType y, | +
+ | float a) ; |
+
+ genType mix(
+ |
+ genType x, | +
+ | genType y, | +
+ | genBType a) ; |
+
x
+
+
+ + Specify the start of the range in which to interpolate. +
+y
+
+
+ + Specify the end of the range in which to interpolate. +
+a
+
+
+
+ Specify the value to use to interpolate between x
and y
.
+
+ mix
performs a linear interpolation between x
+ and y
using a
to weight between them. The return value
+ is computed as follows:
+
+ For the variants of mix
where a
is genBType
,
+ elements for which a
[i] is false
, the result for that
+ element is taken from x
, and where a
[i] is
+ true
, it will be taken from y
. Components of x
+ and y
that are not selected are allowed to be invalid floating point values and will have no effect
+ on the results.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
mix (genType) | +✔ | +✔ | +
mix (genBType) | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+mod — compute value of one parameter modulo another
+
+ genType mod(
+ |
+ genType x, | +
+ | float y) ; |
+
+ genType mod(
+ |
+ genType x, | +
+ | genType y) ; |
+
x
+
+
+ + Specify the value to evaluate. +
+y
+
+
+ + Specify the value by which to perform the modulo. +
+
+ mod
returns the value of x
modulo
+ y
. This is computed as x
- y
*
+ floor(x
/y
).
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
mod (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+modf — separate a value into its integer and fractional components
+
+ genType modf(
+ |
+ genType x, | +
+ | out genType i) ; |
+
x
+
+
+ + Specify the value to separate. +
+out i
+
+
+ + A variable that receives the integer part of the argument. +
+
+ modf
separates a floating point value x
+ into its integer and fractional parts. The fractional part of the number is returned
+ from the function and the integer part (as a floating point quantity) is returned
+ in the output parameter i
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
modf (genType) | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+normalize — calculate the normalize product of two vectors
+
+ genType normalize(
+ |
+ genType v) ; |
+
v
+
+
+ + Specifies the vector to normalize. +
+
+ normalize
returns a vector with the same direction as its parameter, v
, but with length 1.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
normalize (genType) | +✔ | +✔ | +
+ length +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+not — logically invert a boolean vector
+
+ bvec not(
+ |
+ bvec x) ; |
+
x
+
+
+ + Specifies the vector to be inverted. +
+
+ not
logically inverts the boolean vector x
. It returns
+ a new boolean vector for which each element i is computed as !
.
+ x
[i
]
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
not | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+notEqual — perform a component-wise not-equal-to comparison of two vectors
+
+ bvec notEqual(
+ |
+ vec x, | +
+ | vec y) ; |
+
+ bvec notEqual(
+ |
+ ivec x, | +
+ | ivec y) ; |
+
+ bvec notEqual(
+ |
+ bvec x, | +
+ | bvec y) ; |
+
+ bvec notEqual(
+ |
+ uvec x, | +
+ | uvec y) ; |
+
x
+
+
+ + Specifies the first vector to be used in the comparison operation. +
+y
+
+
+ + Specifies the second vector to be used in the comparison operation. +
+
+ notEqual
returns a boolean vector in which each element i is computed
+ as x
[i] != y
[i].
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
notEqual (vec) | +✔ | +✔ | +
notEqual (ivec) | +✔ | +✔ | +
notEqual (bvec) | +✔ | +✔ | +
notEqual (uvec) | +- | +✔ | +
+ lessThan, + lessThanEqual, + greaterThan, + greaterThanEqual, + equal, + any, + all, + not +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+outerProduct — calculate the outer product of a pair of vectors
+
+ mat2 outerProduct(
+ |
+ vec2 c, | +
+ | vec2 r) ; |
+
+ mat3 outerProduct(
+ |
+ vec3 c, | +
+ | vec3 r) ; |
+
+ mat4 outerProduct(
+ |
+ vec4 c, | +
+ | vec4 r) ; |
+
+ mat2x3 outerProduct(
+ |
+ vec3 c, | +
+ | vec2 r) ; |
+
+ mat3x2 outerProduct(
+ |
+ vec2 c, | +
+ | vec3 r) ; |
+
+ mat2x4 outerProduct(
+ |
+ vec4 c, | +
+ | vec2 r) ; |
+
+ mat4x2 outerProduct(
+ |
+ vec2 c, | +
+ | vec4 r) ; |
+
+ mat3x4 outerProduct(
+ |
+ vec4 c, | +
+ | vec3 r) ; |
+
+ mat4x3 outerProduct(
+ |
+ vec3 c, | +
+ | vec4 r) ; |
+
c
+
+
+ + Specifies the parameter to be treated as a column vector. +
+r
+
+
+ + Specifies the parameter to be treated as a row vector. +
+
+ outerProduct
treats the first parameter c
as a column
+ vector (matrix with one column) and the second parameter r
as a row vector
+ (matrix with one row) and does a linear algebraic matrix multiply c
* r
,
+ yielding a matrix whose number of rows is the number of components in c
and
+ whose number of columns is the number of components in r
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
outerProduct (float) | +- | +✔ | +
+ dot +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+packHalf2x16 — convert two 32-bit floating-point quantities to 16-bit quantities and pack them into a single 32-bit integer
+
+ uint packHalf2x16(
+ |
+ vec2 v) ; |
+
v
+
+
+ + Specify a vector of two 32-bit floating point values that are to be converted to 16-bit representation and packed into the result. +
+
+ packHalf2x16
returns an unsigned integer obtained by converting the
+ components of a two-component floating-point vector to
+ the 16-bit floating-point representation found in the
+ OpenGL ES Specification, and then packing these two 16-bit integers into a 32-bit unsigned integer.
+ The first vector component specifies the 16 least-significant bits of the result; the second component
+ specifies the 16 most-significant bits.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
packHalf2x16 | +- | +✔ | +
+ unpackHalf2x16 +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+packUnorm2x16, packSnorm2x16 — pack floating-point values into an unsigned integer
+
+ uint packUnorm2x16(
+ |
+ vec2 v) ; |
+
+ uint packSnorm2x16(
+ |
+ vec2 v) ; |
+
v
+
+
+ + Specifies a vector of values to be packed into an unsigned integer. +
+
+ packUnorm2x16
and packSnorm2x16
converts
+ each component of the normalized floating-point value v
into 16-bit integer
+ values and then packs the results into a 32-bit unsigned intgeter.
+
+ The conversion for component c
of v
to fixed-point is
+ performed as follows:
+
+ packUnorm2x16
: round(clamp(
+ c
, 0.0, 1.0) * 65535.0)
+ packSnorm2x16
: round(clamp(
+ c
, -1.0, 1.0) * 32767.0)
+
++ The first component of the vector will be written to the least significant bits of the output; + the last component will be written to the most significant bits. +
++ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
packUnorm2x16 | +- | +✔ | +
packSnorm2x16 | +- | +✔ | +
+ clamp, + round, + unpackUnorm2x16, + unpackSnorm2x16, +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+pow — return the value of the first parameter raised to the power of the second
+
+ genType pow(
+ |
+ genType x, | +
+ | genType y) ; |
+
x
+
+
+
+ Specify the value to raise to the power y
.
+
y
+
+
+
+ Specify the power to which to raise x
.
+
+ pow
returns the value of x
raised to the y
power. i.e.,
+ x
< 0
+ or if x
== 0 and y
≤ 0.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
pow | +✔ | +✔ | +
+ exp +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+radians — convert a quantity in degrees to radians
+
+ genType radians(
+ |
+ genType degrees) ; |
+
degrees
+
+
+ + Specify the quantity, in degrees, to be converted to radians. +
+
+ radians
converts a quantity, specified in degrees into radians. That is,
+ the return value is
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
radians | +✔ | +✔ | +
+ degrees, +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+reflect — calculate the reflection direction for an incident vector
+
+ genType reflect(
+ |
+ genType I, | +
+ | genType N) ; |
+
I
+
+
+ + Specifies the incident vector. +
+N
+
+
+ + Specifies the normal vector. +
+
+ For a given incident vector I
and surface normal N
reflect
returns
+ the reflection direction calculated as
.
+ I
- 2.0 * dot(N
, I
) * N
+ N
should be normalized in order to achieve the desired result.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
reflect (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+refract — calculate the refraction direction for an incident vector
+
+ genType refract(
+ |
+ genType I, | +
+ | genType N, | +
+ | float eta) ; |
+
I
+
+
+ + Specifies the incident vector. +
+N
+
+
+ + Specifies the normal vector. +
+eta
+
+
+ + Specifies the ratio of indices of refraction. +
+
+ For a given incident vector I
, surface normal N
and ratio of
+ indices of refraction, eta
, refract
returns the refraction vector,
+ R
.
+
+ R
is calculated as:
+
+
+k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)); + if (k < 0.0) + R = genType(0.0); // or genDType(0.0) + else + R = eta * I - (eta * dot(N, I) + sqrt(k)) * N;+
+
+
+ The input parameters I
and N
should be normalized in order to achieve the desired result.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
refract (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+round — find the nearest integer to the parameter
+
+ genType round(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value to evaluate. +
+
+ round
returns a value equal to the nearest integer to x
.
+ The fraction 0.5 will round in a direction chosen by the implementation, usually in the direction that is
+ fastest. This includes the possibility that round
(x
) returns the
+ same value as roundEven(x
)
+ for all values of x
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
round (genType) | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+roundEven — find the nearest even integer to the parameter
+
+ genType roundEven(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value to evaluate. +
+
+ roundEven
returns a value equal to the nearest integer to x
.
+ The fractional part of 0.5 will round toward the nearest even integer.
+ For example, both 3.5 and 4.5 will round to 4.0.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
roundEven (genType) | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+sign — extract the sign of the parameter
+
+ genType sign(
+ |
+ genType x) ; |
+
+ genIType sign(
+ |
+ genIType x) ; |
+
x
+
+
+ + Specify the value from which to extract the sign. +
+
+ sign
returns -1.0 if
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
sign (genType) | +✔ | +✔ | +
sign (genIType) | +- | +✔ | +
+ abs +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+sin — return the sine of the parameter
+
+ genType sin(
+ |
+ genType angle) ; |
+
angle
+
+
+ + Specify the quantity, in radians, of which to return the sine. +
+
+ sin
returns the trigonometric sine of angle
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
sin | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+sinh — return the hyperbolic sine of the parameter
+
+ genType sinh(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value whose hyperbolic sine to return. +
+
+ sinh
returns the hyperbolic sine of
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
sinh | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+smoothstep — perform Hermite interpolation between two values
+
+ genType smoothstep(
+ |
+ genType edge0, | +
+ | genType edge1, | +
+ | genType x) ; |
+
+ genType smoothstep(
+ |
+ float edge0, | +
+ | float edge1, | +
+ | genType x) ; |
+
edge0
+
+
+ + Specifies the value of the lower edge of the Hermite function. +
+edge1
+
+
+ + Specifies the value of the upper edge of the Hermite function. +
+x
+
+
+ + Specifies the source value for interpolation. +
+
+ smoothstep
performs smooth Hermite interpolation between 0 and
+ 1 when edge0
< x
< edge1
.
+ This is useful in cases where a threshold function with a smooth transition is desired.
+ smoothstep
is equivalent to:
+
+
+genType t; /* Or genDType t; */ + t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); + return t * t * (3.0 - 2.0 * t);+
+
+
+ smoothstep
returns 0.0 if x
≤ edge0
and
+ 1.0 if x
≥ edge1
.
+
+ Results are undefined if edge0
≥ edge1
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
smoothstep (genType) | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+sqrt — return the square root of the parameter
+
+ genType sqrt(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value of which to take the square root. +
+
+ sqrt
returns the square root of x
. i.e., the value
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
sqrt (genType) | +✔ | +✔ | +
+ inversesqrt +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+step — generate a step function by comparing two values
+
+ genType step(
+ |
+ genType edge, | +
+ | genType x) ; |
+
+ genType step(
+ |
+ float edge, | +
+ | genType x) ; |
+
edge
+
+
+ + Specifies the location of the edge of the step function. +
+x
+
+
+ + Specify the value to be used to generate the step function. +
+
+ step
generates a step function by comparing x
to edge
.
+
+ For element i of the return value, 0.0 is returned if x
[i]
+ < edge
[i], and 1.0 is returned otherwise.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
step (genType) | +✔ | +✔ | +
+ mix, + smoothstep +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+tan — return the tangent of the parameter
+
+ genType tan(
+ |
+ genType angle) ; |
+
angle
+
+
+ + Specify the quantity, in radians, of which to return the tangent. +
+
+ tan
returns the trigonometric tangent of angle
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
tan | +✔ | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+tanh — return the hyperbolic tangent of the parameter
+
+ genType tanh(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value whose hyperbolic tangent to return. +
+
+ tanh
returns the hyperbolic tangent of
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
tanh | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+texelFetch — perform a lookup of a single texel within a texture
+
+ gvec4 texelFetch(
+ |
+ gsampler2D sampler, | +
+ | ivec2 P, | +
+ | int lod) ; |
+
+ gvec4 texelFetch(
+ |
+ gsampler3D sampler, | +
+ | ivec3 P, | +
+ | int lod) ; |
+
+ gvec4 texelFetch(
+ |
+ gsampler2DArray sampler, | +
+ | ivec3 P, | +
+ | int lod) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+lod
+
+
+ + If present, specifies the level-of-detail within the texture from which the texel will be fetched. +
+
+ texelFetch
performs a lookup of a single texel from texture coordinate P
+ in the texture bound to sampler
. The array layer is specified in the last component of
+ P
for array forms. The lod
parameter (if present) specifies the level-of-detail
+ from which the texel will be fetched.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
texelFetch | +- | +✔ | +
+ texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+texelFetchOffset — perform a lookup of a single texel within a texture with an offset
+
+ gvec4 texelFetchOffset(
+ |
+ gsampler2D sampler, | +
+ | ivec2 P, | +
+ | int lod, | +
+ | ivec2 offset) ; |
+
+ gvec4 texelFetchOffset(
+ |
+ gsampler3D sampler, | +
+ | ivec3 P, | +
+ | int lod, | +
+ | ivec3 offset) ; |
+
+ gvec4 texelFetchOffset(
+ |
+ gsampler2DArray sampler, | +
+ | ivec3 P, | +
+ | int lod, | +
+ | ivec2 offset) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+lod
+
+
+ + If present, specifies the level-of-detail within the texture from which the texel will be fetched. +
+offset
+
+
+
+ Specifies offset, in texels that will be applied to P
before looking up the texel.
+
+ texelFetchOffset
performs a lookup of a single texel from texture coordinate P
+ in the texture bound to sampler
. Before fetching the texel, the offset specified in offset
+ is added to P
. offset
must be a constant expression. The array layer is specified in the last component of
+ P
for array forms. The lod
parameter (if present) specifies the level-of-detail
+ from which the texel will be fetched. The sample
parameter specifies which sample within the texel will be
+ returned when reading from a multi-sample texure.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
texelFetchOffset | +- | +✔ | +
+ texelFetch, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+texture — retrieves texels from a texture
+
+ gvec4 texture(
+ |
+ gsampler2D sampler, | +
+ | vec2 P, | +
+ | [float bias]) ; |
+
+ gvec4 texture(
+ |
+ gsampler3D sampler, | +
+ | vec3 P, | +
+ | [float bias]) ; |
+
+ gvec4 texture(
+ |
+ gsamplerCube sampler, | +
+ | vec3 P, | +
+ | [float bias]) ; |
+
+ float texture(
+ |
+ sampler2DShadow sampler, | +
+ | vec3 P, | +
+ | [float bias]) ; |
+
+ float texture(
+ |
+ samplerCubeShadow sampler, | +
+ | vec4 P, | +
+ | [float bias]) ; |
+
+ gvec4 texture(
+ |
+ gsampler2DArray sampler, | +
+ | vec3 P, | +
+ | [float bias]) ; |
+
+ float texture(
+ |
+ gsampler2DArrayShadow sampler, | +
+ | vec4 P) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+bias
+
+
+ + Specifies an optional bias to be applied during level-of-detail computation. +
+
+ texture
samples texels from the texture bound to sampler
at texture
+ coordinate P
. An optional bias, specified in bias
is included in
+ the level-of-detail computation that is used to choose mipmap(s) from which to sample.
+
+ For shadow forms, when compare
is present, it is used as
+
. When P
.wcompare
is
+ not present, the last component of P
is used as
+ P
.
+
+ For non-shadow variants, the array layer comes from the last component of P
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
texture | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureGrad — perform a texture lookup with explicit gradients
+
+ gvec4 textureGrad(
+ |
+ gsampler2D sampler, | +
+ | vec2 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy) ; |
+
+ gvec4 textureGrad(
+ |
+ gsampler3D sampler, | +
+ | vec3 P, | +
+ | vec3 dPdx, | +
+ | vec3 dPdy) ; |
+
+ gvec4 textureGrad(
+ |
+ gsamplerCube sampler, | +
+ | vec3 P, | +
+ | vec3 dPdx, | +
+ | vec3 dPdy) ; |
+
+ float textureGrad(
+ |
+ sampler2DShadow sampler, | +
+ | vec3 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy) ; |
+
+ float textureGrad(
+ |
+ samplerCubeShadow sampler, | +
+ | vec4 P, | +
+ | vec3 dPdx, | +
+ | vec3 dPdy) ; |
+
+ gvec4 textureGrad(
+ |
+ gsampler2DArray sampler, | +
+ | vec3 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy) ; |
+
+ float textureGrad(
+ |
+ gsampler2DArrayShadow sampler, | +
+ | vec4 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+dPdx
+
+
+
+ Specifies the partial derivative of P
with respect to window x.
+
dPdy
+
+
+
+ Specifies the partial derivative of P
with respect to window y.
+
+ textureGrad
performs a texture lookup at coordinate P
from the
+ texture bound to sampler
with explicit texture coordinate gradiends as specified in
+ dPdx
and dPdy
. Set:
+
+
+
+
+
+
+
+ For the cube version, the partial derivatives of P
are assumed to be
+ in the coordinate system used before texture coordinates are projected onto the appropriate
+ cube face.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureGrad | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureGradOffset — perform a texture lookup with explicit gradients and offset
+
+ gvec4 textureGradOffset(
+ |
+ gsampler2D sampler, | +
+ | vec2 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy, | +
+ | ivec2 offset) ; |
+
+ gvec4 textureGradOffset(
+ |
+ gsampler3D sampler, | +
+ | vec3 P, | +
+ | vec3 dPdx, | +
+ | vec3 dPdy, | +
+ | ivec3 offset) ; |
+
+ float textureGradOffset(
+ |
+ sampler2DShadow sampler, | +
+ | vec3 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy, | +
+ | ivec2 offset) ; |
+
+ gvec4 textureGradOffset(
+ |
+ gsampler2DArray sampler, | +
+ | vec3 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy, | +
+ | ivec2 offset) ; |
+
+ float textureGradOffset(
+ |
+ sampler2DArrayShadow sampler, | +
+ | vec4 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy, | +
+ | ivec2 offset) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+dPdx
+
+
+
+ Specifies the partial derivative of P
with respect to window x.
+
dPdy
+
+
+
+ Specifies the partial derivative of P
with respect to window y.
+
offset
+
+
+ + Specifies the offset to be applied to the texture coordinates before sampling. +
+
+ textureGradOffset
performs a texture lookup at coordinate P
from the
+ texture bound to sampler
with explicit texture coordinate gradiends as specified in
+ dPdx
and dPdy
. An explicit offset is also supplied in offset
.
+ textureGradOffset
consumes dPdx
and dPdy
as
+ textureGrad and offset
as
+ textureOffset.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureGradOffset | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureLod — perform a texture lookup with explicit level-of-detail
+
+ gvec4 textureLod(
+ |
+ gsampler2D sampler, | +
+ | vec2 P, | +
+ | float lod) ; |
+
+ gvec4 textureLod(
+ |
+ gsampler3D sampler, | +
+ | vec3 P, | +
+ | float lod) ; |
+
+ gvec4 textureLod(
+ |
+ gsamplerCube sampler, | +
+ | vec3 P, | +
+ | float lod) ; |
+
+ float textureLod(
+ |
+ sampler2DShadow sampler, | +
+ | vec3 P, | +
+ | float lod) ; |
+
+ gvec4 textureLod(
+ |
+ gsampler2DArray sampler, | +
+ | vec3 P, | +
+ | float lod) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+lod
+
+
+ + Specifies the explicit level-of-detail +
+
+ textureLod
performs a texture lookup at coordinate P
from the
+ texture bound to sampler
with an explicit level-of-detail as specified in lod
.
+ lod
specifies
+
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureLod | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureLodOffset — perform a texture lookup with explicit level-of-detail and offset
+
+ gvec4 textureLodOffset(
+ |
+ gsampler2D sampler, | +
+ | vec2 P, | +
+ | float lod, | +
+ | ivec2 offset) ; |
+
+ gvec4 textureLodOffset(
+ |
+ gsampler3D sampler, | +
+ | vec3 P, | +
+ | float lod, | +
+ | ivec3 offset) ; |
+
+ float textureLodOffset(
+ |
+ sampler2DShadow sampler, | +
+ | vec3 P, | +
+ | float lod, | +
+ | ivec2 offset) ; |
+
+ gvec4 textureLodOffset(
+ |
+ gsampler2DArray sampler, | +
+ | vec3 P, | +
+ | float lod, | +
+ | ivec2 offset) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which the texture will be sampled. +
+lod
+
+
+ + Specifies the explicit level-of-detail from which texels will be fetched. +
+offset
+
+
+
+ Specifies the offset that will be applied to P
before texels are fetched.
+
+ textureLodOffset
performs a texture lookup at coordinate P
from the
+ texture bound to sampler
with an explicit level-of-detail as specified in lod
.
+ Behavior is the same as in textureLod except that before
+ sampling, offset
is added to P
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureLodOffset | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureOffset — perform a texture lookup with offset
+
+ gvec4 textureOffset(
+ |
+ gsampler2D sampler, | +
+ | vec2 P, | +
+ | ivec2 offset, | +
+ | [float bias]) ; |
+
+ gvec4 textureOffset(
+ |
+ gsampler3D sampler, | +
+ | vec3 P, | +
+ | ivec3 offset, | +
+ | [float bias]) ; |
+
+ float textureOffset(
+ |
+ sampler2DShadow sampler, | +
+ | vec3 P, | +
+ | ivec2 offset, | +
+ | [float bias]) ; |
+
+ gvec4 textureOffset(
+ |
+ gsampler2DArray sampler, | +
+ | vec3 P, | +
+ | ivec2 offset, | +
+ | [float bias]) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+offset
+
+
+
+ Specifies offset, in texels that will be applied to P
before looking up the texel.
+
bias
+
+
+ + Specifies an optional bias to be applied during level-of-detail computation. +
+
+ textureOffset
performs a texture lookup at coordinate P
from the
+ texture bound to sampler
with an an additional offset, specified in texels in offset
+ that will be applied to the (u, v, w) texture coordinates before looking up each texel.
+ The offset value must be a constant expression. A limited range of offset values are supported;
+ the minimum and maximum offset values are implementation-dependent and may be determined
+ by querying GL_MIN_PROGRAM_TEXEL_OFFSET
and GL_MAX_PROGRAM_TEXEL_OFFSET
,
+ respectively.
+
+ Note that offset
does not apply to the layer coordinate for texture arrays. Also note
+ that offsets are not supported for cube maps.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureOffset | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureProj — perform a texture lookup with projection
+
+ gvec4 textureProj(
+ |
+ gsampler2D sampler, | +
+ | vec3 P, | +
+ | [float bias]) ; |
+
+ gvec4 textureProj(
+ |
+ gsampler2D sampler, | +
+ | vec4 P, | +
+ | [float bias]) ; |
+
+ gvec4 textureProj(
+ |
+ gsampler3D sampler, | +
+ | vec4 P, | +
+ | [float bias]) ; |
+
+ float textureProj(
+ |
+ sampler2DShadow sampler, | +
+ | vec4 P, | +
+ | [float bias]) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+bias
+
+
+ + Specifies an optional bias to be applied during level-of-detail computation. +
+
+ textureProj
performs a texture lookup with projection. The texture coordinates
+ consumed from P
, not including the last component of P
,
+ are divided by the last component of P
. The resulting P
in the shadow forms is used as
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureProjOffset | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureProjGrad — perform a texture lookup with projection and explicit gradients
+
+ gvec4 textureProjGrad(
+ |
+ gsampler2D sampler, | +
+ | vec3 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy) ; |
+
+ gvec4 textureProjGrad(
+ |
+ gsampler2D sampler, | +
+ | vec4 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy) ; |
+
+ gvec4 textureProjGrad(
+ |
+ gsampler3D sampler, | +
+ | vec4 P, | +
+ | vec3 dPdx, | +
+ | vec3 dPdy) ; |
+
+ float textureProjGrad(
+ |
+ sampler2DShadow sampler, | +
+ | vec4 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+dPdx
+
+
+
+ Specifies the partial derivative of P
with respect to window x.
+
dPdy
+
+
+
+ Specifies the partial derivative of P
with respect to window y.
+
+ textureProjGrad
performs a texture lookup with projection and explicit gradients. The texture coordinates
+ consumed from P
, not including the last component of P
,
+ are divided by the last component of P
. The resulting P
in the shadow forms is used as
+ dPdx
and dPdy
as gradients.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureProjGrad | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureProjGradOffset — perform a texture lookup with projection, explicit gradients and offset
+
+ gvec4 textureProjGradOffset(
+ |
+ gsampler2D sampler, | +
+ | vec3 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy, | +
+ | ivec2 offset) ; |
+
+ gvec4 textureProjGradOffset(
+ |
+ gsampler2D sampler, | +
+ | vec4 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy, | +
+ | ivec2 offset) ; |
+
+ gvec4 textureProjGradOffset(
+ |
+ gsampler3D sampler, | +
+ | vec4 P, | +
+ | vec3 dPdx, | +
+ | vec3 dPdy, | +
+ | ivec3 offset) ; |
+
+ float textureProjGradOffset(
+ |
+ sampler2DShadow sampler, | +
+ | vec4 P, | +
+ | vec2 dPdx, | +
+ | vec2 dPdy, | +
+ | ivec2 offset) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+dPdx
+
+
+
+ Specifies the partial derivative of P
with respect to window x.
+
dPdy
+
+
+
+ Specifies the partial derivative of P
with respect to window y.
+
offset
+
+
+
+ Specifies the offsets, in texels at which the texture will be sampled relative to the projection of P
.
+
+ textureProjGradOffset
performs a texture lookup with projection and explicit gradients and offsets. The texture coordinates
+ consumed from P
, not including the last component of P
,
+ are divided by the last component of P
. The resulting P
in the shadow forms is used as
+ dPdx
and dPdy
as gradients, and offset
as the offset.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureProjGradOffset | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjLod, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureProjLod — perform a texture lookup with projection and explicit level-of-detail
+
+ gvec4 textureProjLod(
+ |
+ gsampler2D sampler, | +
+ | vec3 P, | +
+ | float lod) ; |
+
+ gvec4 textureProjLod(
+ |
+ gsampler2D sampler, | +
+ | vec4 P, | +
+ | float lod) ; |
+
+ gvec4 textureProjLod(
+ |
+ gsampler3D sampler, | +
+ | vec4 P, | +
+ | float lod) ; |
+
+ float textureProjLod(
+ |
+ sampler2DShadow sampler, | +
+ | vec4 P, | +
+ | float lod) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+lod
+
+
+ + Specifies the explicit level-of-detail from which to fetch texels. +
+
+ textureProjLod
performs a texture lookup with projection from an explicitly specified level-of-detail. The texture coordinates
+ consumed from P
, not including the last component of P
,
+ are divided by the last component of P
. The resulting P
in the shadow forms is used as
+ lod
used to specify the level-of-detail from which the texture will be sampled.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureProjLod | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLodOffset, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureProjLodOffset — perform a texture lookup with projection and explicit level-of-detail and offset
+
+ gvec4 textureProjLodOffset(
+ |
+ gsampler2D sampler, | +
+ | vec3 P, | +
+ | float lod, | +
+ | ivec2 offset) ; |
+
+ gvec4 textureProjLodOffset(
+ |
+ gsampler2D sampler, | +
+ | vec4 P, | +
+ | float lod, | +
+ | ivec2 offset) ; |
+
+ gvec4 textureProjLodOffset(
+ |
+ gsampler3D sampler, | +
+ | vec4 P, | +
+ | float lod, | +
+ | ivec3 offset) ; |
+
+ float textureProjLodOffset(
+ |
+ sampler2DShadow sampler, | +
+ | vec4 P, | +
+ | float lod, | +
+ | ivec2 offset) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which texture will be sampled. +
+lod
+
+
+ + Specifies the explicit level-of-detail from which to fetch texels. +
+offset
+
+
+
+ Specifies the offset, in texels, to be applied to P
before fetching texels.
+
+ textureProjLodOffset
performs a texture lookup with projection from an explicitly specified level-of-detail with an offset applied
+ to the texture coordinates before sampling. The texture coordinates
+ consumed from P
, not including the last component of P
,
+ are divided by the last component of P
. The resulting P
in the shadow forms is used as
+ lod
used to specify the level-of-detail from which the texture will be sampled and offset
+ used to specifiy the offset, in texels, to be applied to the texture coordinates before sampling.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureProjLodOffset | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureProjOffset — perform a texture lookup with projection and offset
+
+ gvec4 textureProjOffset(
+ |
+ gsampler2D sampler, | +
+ | vec3 P, | +
+ | ivec2 offset, | +
+ | [float bias]) ; |
+
+ gvec4 textureProjOffset(
+ |
+ gsampler2D sampler, | +
+ | vec4 P, | +
+ | ivec2 offset, | +
+ | [float bias]) ; |
+
+ gvec4 textureProjOffset(
+ |
+ gsampler3D sampler, | +
+ | vec4 P, | +
+ | ivec3 offset, | +
+ | [float bias]) ; |
+
+ float textureProjOffset(
+ |
+ sampler2DShadow sampler, | +
+ | vec4 P, | +
+ | ivec2 offset, | +
+ | [float bias]) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture from which texels will be retrieved is bound. +
+P
+
+
+ + Specifies the texture coordinates at which the texture will be sampled. +
+offset
+
+
+
+ Specifies the offset that is applied to P
before sampling occurs.
+
bias
+
+
+ + Specifies an optional bias to be applied during level-of-detail computation. +
+
+ textureProjOffset
performs a texture lookup with projection. The texture coordinates
+ consumed from P
, not including the last component of P
,
+ are divided by the last component of P
. The resulting P
in the shadow forms is used as
+ offset
used to offset the computed texture coordinates.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureProjOffset | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureSize +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+textureSize — retrieve the dimensions of a level of a texture
+
+ ivec2 textureSize(
+ |
+ gsampler2D sampler, | +
+ | int lod) ; |
+
+ ivec3 textureSize(
+ |
+ gsampler3D sampler, | +
+ | int lod) ; |
+
+ ivec2 textureSize(
+ |
+ gsamplerCube sampler, | +
+ | int lod) ; |
+
+ ivec2 textureSize(
+ |
+ sampler2DShadow sampler, | +
+ | int lod) ; |
+
+ ivec2 textureSize(
+ |
+ samplerCubeShadow sampler, | +
+ | int lod) ; |
+
+ ivec3 textureSize(
+ |
+ gsampler2DArray sampler, | +
+ | int lod) ; |
+
+ ivec3 textureSize(
+ |
+ sampler2DArrayShadow sampler, | +
+ | int lod) ; |
+
sampler
+
+
+ + Specifies the sampler to which the texture whose dimensions to retrieve is bound. +
+lod
+
+
+ + Specifies the level of the texture for which to retrieve the dimensions. +
+
+ textureSize
returns the dimensions of level lod
(if present)
+ of the texture bound to sampler
. The components in the return value are filled in,
+ in order, with the width, height and depth of the texture. For the array forms, the last component of the
+ return value is the number of layers in the texture array. The return values are returned as highp ints.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
textureSize | +- | +✔ | +
+ texelFetch, + texelFetchOffset, + texture, + textureGrad, + textureGradOffset, + textureLod, + textureLodOffset, + textureOffset, + textureProj, + textureProjGrad, + textureProjGradOffset, + textureProjLod, + textureProjLodOffset, + textureProjOffset, +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+transpose — calculate the transpose of a matrix
+
+ mat2 transpose(
+ |
+ mat2 m) ; |
+
+ mat3 transpose(
+ |
+ mat3 m) ; |
+
+ mat4 transpose(
+ |
+ mat4 m) ; |
+
+ mat2x3 transpose(
+ |
+ mat3x2 m) ; |
+
+ mat2x4 transpose(
+ |
+ mat4x2 m) ; |
+
+ mat3x2 transpose(
+ |
+ mat2x3 m) ; |
+
+ mat3x4 transpose(
+ |
+ mat4x3 m) ; |
+
+ mat4x2 transpose(
+ |
+ mat2x4 m) ; |
+
+ mat4x3 transpose(
+ |
+ mat3x4 m) ; |
+
m
+
+
+ + Specifies the matrix of which to take the transpose. +
+
+ transpose
returns the transpose of the matrix m
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
transpose (float) | +- | +✔ | +
+ determinant, + inverse +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+trunc — find the truncated value of the parameter
+
+ genType trunc(
+ |
+ genType x) ; |
+
x
+
+
+ + Specify the value to evaluate. +
+
+ trunc
returns a value equal to the nearest integer to x
+ whose absolute value is not larger than the absolute value of x
.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
trunc (genType) | +- | +✔ | +
+ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+unpackHalf2x16 — convert two 16-bit floating-point values packed into a single 32-bit integer into a vector of two 32-bit floating-point quantities
+
+ vec2 unpackHalf2x16(
+ |
+ uint v) ; |
+
v
+
+
+ + Specify a single 32-bit unsigned integer values that contains two 16-bit floating point values to be unpacked. +
+
+ unpackHalf2x16
returns a two-component floating-point vector with
+ components obtained by unpacking a 32-bit unsigned
+ integer into a pair of 16-bit values, interpreting those
+ values as 16-bit floating-point numbers according to the
+ OpenGL ES Specification, and converting them to 32-bit
+ floating-point values.
+ The first component of the vector is obtained from the
+ 16 least-significant bits of v; the second component is
+ obtained from the 16 most-significant bits of v.
+
+ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
unpackHalf2x16 | +- | +✔ | +
+ packHalf2x16 +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+unpackUnorm2x16, unpackSnorm2x16 — unpack floating-point values from an unsigned integer
+
+ vec2 unpackUnorm2x16(
+ |
+ uint p) ; |
+
+ vec2 unpackSnorm2x16(
+ |
+ uint p) ; |
+
p
+
+
+ + Specifies an unsigned integer containing packed floating-point values. +
+
+ unpackUnorm2x16
, unpackSnorm2x16
unpack
+ single 32-bit unsigned integers, specified in the parameter p
into a pair of 16-bit unsigned integers.
+ Then, each component is converted to a normalized floating-point
+ value to generate the returned two- or four-component vector.
+
+ The conversion for unpacked fixed point value f to floating-point is performed as follows: +
+
+ unpackUnorm2x16
: f / 65535.0
+
+ unpackSnorm2x16
: clamp(f / 32727.0, -1.0, 1.0)
+
+
++ The first component of the returned vector will be extracted from the least significant bits of the input; + the last component will be extracted from the most significant bits. +
++ + | ++ OpenGL ES Shading Language Version + | +|
---|---|---|
+ Function Name + | ++ 1.00 + | ++ 3.00 + | +
unpackUnorm2x16 | +- | +✔ | +
unpackSnorm2x16 | +- | +✔ | +
+ clamp, + packUnorm2x16, + packSnorm2x16 +
++ Copyright © 2011-2014 Khronos Group. + This material may be distributed subject to the terms and conditions set forth in + the Open Publication License, v 1.0, 8 June 1999. + http://opencontent.org/openpub/. +
+