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

Name

glActiveTexture — select server-side active texture unit

C Specification

void glActiveTexture(GLenum texture);
 

Parameters

+ 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_TEXTUREi, + where + + 0 + <= + i + < + GL_MAX_TEXTURE_UNITS + , + which is an implementation-dependent value. The intial value is + GL_TEXTURE0. +

Description

+ 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.

Errors

+ GL_INVALID_ENUM is generated if + texture is not one of + GL_TEXTUREi, + where + + 0 + <= + i + < + GL_MAX_TEXTURE_UNITS + . +

Notes

It is always the case that + + GL_TEXTUREi = + GL_TEXTURE0+i + .

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.

Associated Gets

+ glGet + with argument GL_ACTIVE_TEXTURE or + GL_MAX_TEXTURE_UNITS +

See Also

+ glBindTexture, + glClientActiveTexture, + glEnable, + glGet, + glMatrixMode, + glMultiTexCoord, + glTexEnv +

Copyright

+ 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/. +

diff --git a/es1/glAlphaFunc.xml b/es1/glAlphaFunc.xml new file mode 100644 index 00000000..a3d1671a --- /dev/null +++ b/es1/glAlphaFunc.xml @@ -0,0 +1,93 @@ + + + +glAlphaFunc

Name

glAlphaFunc — specify the alpha test function

C Specification

void glAlphaFunc(GLenum func,
 GLclampf ref);
 
void glAlphaFuncx(GLenum func,
 GLclampx ref);
 

Parameters

+ 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. +

Description

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. +

Errors

+ GL_INVALID_ENUM is generated if + func is not an accepted value. +

See Also

+ glBlendFunc, + glClear, + glDepthFunc, + glEnable, + glStencilFunc +

Copyright

+ 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/. +

diff --git a/es1/glBindBuffer.xml b/es1/glBindBuffer.xml new file mode 100644 index 00000000..377f89b3 --- /dev/null +++ b/es1/glBindBuffer.xml @@ -0,0 +1,87 @@ + + + +glBindBuffer

Name

glBindBuffer — bind a named buffer to a target

C Specification

void glBindBuffer(GLenum target,
 GLuint buffer);
 

Parameters

+ 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.

Description

+ 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. +

Errors

GL_INVALID_ENUM is generated if + target is not one of the allowable values.

Associated Gets

+ glGet + with argument GL_ARRAY_BUFFER_BINDING or + GL_ELEMENT_ARRAY_BUFFER_BINDING +

See Also

+ glBufferData, + glBufferSubData, + glDeleteBuffers, + glGenBuffers +

Copyright

+ 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/. +

diff --git a/es1/glBindTexture.xml b/es1/glBindTexture.xml new file mode 100644 index 00000000..fb6d6242 --- /dev/null +++ b/es1/glBindTexture.xml @@ -0,0 +1,57 @@ + + + +glBindTexture

Name

glBindTexture — bind a named texture to a texturing target

C Specification

void glBindTexture(GLenum target,
 GLuint texture);
 

Parameters

+ target +

Specifies the target to which the texture is bound. + Must be GL_TEXTURE_2D.

+ texture +

Specifies the name of a texture.

Description

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.

Errors

GL_INVALID_ENUM is generated if + target is not one of the allowable values.

Associated Gets

+ glGet + with argument GL_TEXTURE_BINDING_2D +

See Also

+ eglCreateContext, + glActiveTexture, + glCompressedTexImage2D, + glCopyTexImage2D, + glDeleteTextures, + glGenTextures, + glGet, + glTexImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es1/glBlendFunc.xml b/es1/glBlendFunc.xml new file mode 100644 index 00000000..d075eecf --- /dev/null +++ b/es1/glBlendFunc.xml @@ -0,0 +1,378 @@ + + +glBlendFunc

Name

glBlendFunc — specify pixel arithmetic

C Specification

void glBlendFunc(GLenum sfactor,
 GLenum dfactor);
 

Parameters

+ 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.

Description

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 + ( + Rs, + Gs, + Bs, + As + ) + and + ( + Rd, + Gd, + Bd, + Ad + ). + They are understood to have integer values between 0 and + ( + kR, + kG, + kB, + kA + ), + where

+ kc + = + 2mc + - + 1 +

and + ( + mR, + mG, + mB, + mA + ) + is the number of red, green, blue, and alpha bitplanes.

Source and destination scale factors are referred to as + ( + sR, + sG, + sB, + sA + ) + and + ( + dR, + dG, + dB, + dA + ). + + The scale factors described in the table, denoted + ( + fR, + fG, + fB, + fA + ), + represent either source or destination factors. All scale + factors have range [0, 1].

Parameter + ( + fR, + fG, + fB, + fA + ) +
+ GL_ZERO + + ( + 0, + 0, + 0, + 0 + ) +
+ GL_ONE + + ( + 1, + 1, + 1, + 1 + ) +
+ GL_SRC_COLOR + + ( + Rs/kR, + Gs/kG, + Bs/kB, + As/kA + ) +
+ GL_ONE_MINUS_SRC_COLOR + + + ( + 1, + 1, + 1, + 1 + ) + - + ( + Rs/kR, + Gs/kG, + Bs/kB, + As/kA + ) +
+ GL_DST_COLOR + + ( + Rd/kR, + Gd/kG, + Bd/kB, + Ad/kA + ) +
+ GL_ONE_MINUS_DST_COLOR + + + ( + 1, + 1, + 1, + 1 + ) + - + ( + Rd/kR, + Gd/kG, + Bd/kB, + Ad/kA + ) +
+ GL_SRC_ALPHA + + ( + As/kA, + As/kA, + As/kA, + As/kA + ) +
+ GL_ONE_MINUS_SRC_ALPHA + + + ( + 1, + 1, + 1, + 1 + ) + - + ( + As/kA, + As/kA, + As/kA, + As/kA + ) +
+ GL_DST_ALPHA + + ( + Ad/kA, + Ad/kA, + Ad/kA, + Ad/kA + ) +
+ GL_ONE_MINUS_DST_ALPHA + + + ( + 1, + 1, + 1, + 1 + ) + - + ( + Ad/kA, + Ad/kA, + Ad/kA, + Ad/kA + ) +
+ GL_SRC_ALPHA_SATURATE + + ( + i, + i, + i, + 1 + ) +

In the table,

+ i=min( + As, + kA-Ad + ) + / + kA +

To determine the blended values of a pixel, the system + uses the following equations:

+ + Rd + + = + + min( + kR, + Rs + sR+ + Rd + dR + ) + + + Gd + + = + + min( + kG, + Gs + sG+ + Gd + dG + ) + + + Bd + + = + + min( + kB, + Bs + sB+ + Bd + dB + ) + + + Ad + + = + + min( + kA, + As + sA+ + Ad + dA + ) + +

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 + As + is equal to + kA, + the equations reduce to simple replacement:

+ + Rd + + = + + Rs + + + Gd + + = + + Gs + + + Bd + + = + + Bs + + + Ad + + = + + As + +

+ glBlendFunc operates on all pixel write operations, + including the scan conversion of points, lines, and polygons. + glBlendFunc does not affect + glClear. +

Examples

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. +

Notes

Incoming (source) alpha is correctly thought of as a + material opacity, ranging from 1.0 + (kA), + representing complete opacity, to 0.0 (0), representing + complete transparency.

Errors

GL_INVALID_ENUM is generated if either + sfactor or dfactor + is not an accepted value.

See Also

+ glAlphaFunc, + glClear, + glDepthFunc, + glEnable, + glLogicOp, + glStencilFunc +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glBufferData.xml b/es1/glBufferData.xml new file mode 100644 index 00000000..6f95cd26 --- /dev/null +++ b/es1/glBufferData.xml @@ -0,0 +1,70 @@ + + +glBufferData

Name

glBufferData — creates and initializes a buffer object's data store.

C Specification

void glBufferData(GLenum target,
 GLsizeiptr size,
 const GLvoid * data,
 GLenum usage);
 

Parameters

+ 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. +

Description

+ 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. +

+

Notes

+ 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 N bytes be a + multiple of N. +

Errors

+ 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. +

Associated Gets

+ glGetBufferParameteriv with argument GL_BUFFER_SIZE or GL_BUFFER_USAGE +

See Also

+ glBufferSubData, + glBindBuffer +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glBufferSubData.xml b/es1/glBufferSubData.xml new file mode 100644 index 00000000..78e570bd --- /dev/null +++ b/es1/glBufferSubData.xml @@ -0,0 +1,54 @@ + + +glBufferSubData

Name

glBufferSubData — updates a subset of a buffer object's data store.

C Specification

void glBufferSubData(GLenum target,
 GLintptr offset,
 GLsizeiptr size,
 const GLvoid * data);
 

Parameters

+ 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.

Description

+ 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. +

Notes

+ 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 N bytes be a + multiple of N. +

Errors

+ 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. +

See Also

+ glBindBuffer, + glBufferData +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glClear.xml b/es1/glClear.xml new file mode 100644 index 00000000..cc40a764 --- /dev/null +++ b/es1/glClear.xml @@ -0,0 +1,53 @@ + + +glClear

Name

glClear — clear buffers to preset values

C Specification

void glClear(GLbitfield mask);
 

Parameters

+ 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.

Description

+ 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.

Notes

If a buffer is not present, then a glClear + directed at that buffer has no effect.

Errors

GL_INVALID_VALUE + is generated if any bit other than the defined bits is set in + mask.

Associated Gets

+ glGet with argument GL_COLOR_CLEAR_VALUE +

+ glGet with argument GL_DEPTH_CLEAR_VALUE +

+ glGet with argument GL_STENCIL_CLEAR_VALUE +

See Also

+ glClearColor, + glClearDepth, + glClearStencil, + glColorMask, + glDepthMask, + glScissor, + glStencilMask +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glClearColor.xml b/es1/glClearColor.xml new file mode 100644 index 00000000..5dcd3998 --- /dev/null +++ b/es1/glClearColor.xml @@ -0,0 +1,28 @@ + + +glClearColor

Name

glClearColor — specify clear values for the color buffer

C Specification

void glClearColor(GLclampf red,
 GLclampf green,
 GLclampf blue,
 GLclampf alpha);
 
void glClearColorx(GLclampx red,
 GLclampx green,
 GLclampx blue,
 GLclampx alpha);
 

Parameters

+ 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.

Description

+ 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].

Associated Gets

+ glGet with argument GL_COLOR_CLEAR_VALUE +

See Also

+ glClear, + glClearDepth, + glClearStencil, + glColorMask +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glClearDepth.xml b/es1/glClearDepth.xml new file mode 100644 index 00000000..a648b3b3 --- /dev/null +++ b/es1/glClearDepth.xml @@ -0,0 +1,24 @@ + + +glClearDepth

Name

glClearDepth — specify the clear value for the depth buffer

C Specification

void glClearDepthf(GLclampf depth);
 
void glClearDepthx(GLclampx depth);
 

Parameters

+ depth +

Specifies the depth value used when the depth + buffer is cleared. The initial value is 1.

Description

+ glClearDepth specifies the depth value used by + glClear + to clear the depth buffer. Values specified by + glClearDepth + are clamped to the range [0, 1].

Associated Gets

+ glGet with argument GL_DEPTH_CLEAR_VALUE +

See Also

+ glClear, + glClearColor, + glClearStencil, + glDepthFunc, + glDepthMask +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glClearStencil.xml b/es1/glClearStencil.xml new file mode 100644 index 00000000..1b6d771e --- /dev/null +++ b/es1/glClearStencil.xml @@ -0,0 +1,33 @@ + + +glClearStencil

Name

glClearStencil — specify the clear value for the stencil buffer

C Specification

void glClearStencil(GLint s);
 

Parameters

+ s +

Specifies the index used when the stencil buffer is + cleared. The initial value is 0.

Description

glClearStencil + specifies the index used by + glClear + to clear the stencil buffer. s + is masked with + + 2m-1 + , where + m + is the number of bits in the stencil buffer.

Associated Gets

+ glGet with argument GL_STENCIL_CLEAR_VALUE +

+ glGet + with argument GL_STENCIL_BITS +

See Also

+ glClear, + glClearColor, + glClearDepth, + glGet, + glStencilFunc, + glStencilOp, + glStencilMask +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glClientActiveTexture.xml b/es1/glClientActiveTexture.xml new file mode 100644 index 00000000..7269a713 --- /dev/null +++ b/es1/glClientActiveTexture.xml @@ -0,0 +1,61 @@ + + +glClientActiveTexture

Name

glClientActiveTexture — select client-side active texture unit

C Specification

void glClientActiveTexture(GLenum texture);
 

Parameters

+ 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_TEXTUREi, + + 0 + <= + i + < + GL_MAX_TEXTURE_UNITS + , + which is an implementation-dependent value. The initial + value is GL_TEXTURE0. +

Description

+ 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.

Errors

+ GL_INVALID_ENUM is generated if + texture is not one of + GL_TEXTUREi, + where + + 0 + <= + i + < + GL_MAX_TEXTURE_UNITS + . +

Notes

It is always the case that + + GL_TEXTUREi = + GL_TEXTURE0+i + .

Associated Gets

+ glGet + with argument GL_CLIENT_ACTIVE_TEXTURE or + GL_MAX_TEXTURE_UNITS +

See Also

+ glActiveTexture, + glEnableClientState, + glGet, + glMultiTexCoord, + glTexCoordPointer +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glClipPlane.xml b/es1/glClipPlane.xml new file mode 100644 index 00000000..90f2b172 --- /dev/null +++ b/es1/glClipPlane.xml @@ -0,0 +1,63 @@ + + +glClipPlane

Name

glClipPlane — specify a plane against which all geometry is + clipped

C Specification

void glClipPlanef(GLenum plane,
 const GLfloat *equation);
 
void glClipPlanex(GLenum plane,
 const GLfixed *equation);
 

Parameters

plane

Specifies which clipping plane is being positioned. Symbolic + names of the form GL_CLIP_PLANEi, + where i is an integer + between 0 and GL_MAX_CLIP_PLANES + + + + -1 + , are accepted.

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.

Description

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.

Notes

It is always the case that + + + GL_CLIP_PLANEi + + + + = + + + + GL_CLIP_PLANE0 + + + + + + + + + i + + . +

Errors

GL_INVALID_ENUM is generated if + plane is not an accepted value.

Associated Gets

glGetClipPlane, glIsEnabled with argument + GL_CLIP_PLANEi.

See Also

glGetClipPlane, glGet, glEnable

Copyright

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/.

\ No newline at end of file diff --git a/es1/glColor.xml b/es1/glColor.xml new file mode 100644 index 00000000..fa6c0bc5 --- /dev/null +++ b/es1/glColor.xml @@ -0,0 +1,29 @@ + + +glColor

Name

glColor — set the current color

C Specification

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);
 

Parameters

+ red, + green, + blue, + alpha +

Specify new red, green, blue, and alpha values for + the current color.

Description

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).

Notes

The initial value for the current color is (1, 1, 1, 1).

Associated Gets

+ glGet with argument GL_CURRENT_COLOR +

See Also

+ glColorPointer, + glNormal, + glMultiTexCoord +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glColorMask.xml b/es1/glColorMask.xml new file mode 100644 index 00000000..69fb667c --- /dev/null +++ b/es1/glColorMask.xml @@ -0,0 +1,34 @@ + + +glColorMask

Name

glColorMask — enable and disable writing of color buffer + components

C Specification

void glColorMask(GLboolean red,
 GLboolean green,
 GLboolean blue,
 GLboolean alpha);
 

Parameters

+ 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.

Description

+ 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.

See Also

+ glClear, + glColor, + glColorPointer, + glDepthMask, + glStencilMask +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glColorPointer.xml b/es1/glColorPointer.xml new file mode 100644 index 00000000..4a2c4193 --- /dev/null +++ b/es1/glColorPointer.xml @@ -0,0 +1,81 @@ + + +glColorPointer

Name

glColorPointer — define an array of colors

C Specification

void glColorPointer(GLint size,
 GLenum type,
 GLsizei stride,
 const GLvoid * pointer);
 

Parameters

+ 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.

Description

+ 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.

Notes

glColorPointer + is typically implemented on the client side.

Errors

+ 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.

See Also

+ glColor, + glDrawArrays, + glDrawElements, + glEnableClientState, + glNormalPointer, + glTexCoordPointer, + glVertexPointer +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glCompressedTexImage2D.xml b/es1/glCompressedTexImage2D.xml new file mode 100644 index 00000000..1f8152b9 --- /dev/null +++ b/es1/glCompressedTexImage2D.xml @@ -0,0 +1,138 @@ + + + +glCompressedTexImage2D

Name

glCompressedTexImage2D — specify a two-dimensional compressed texture image

C Specification

void glCompressedTexImage2D(GLenum target,
 GLint level,
 GLenum internalformat,
 GLsizei width,
 GLsizei height,
 GLint border,
 GLsizei imageSize,
 const GLvoid * data);
 

Parameters

+ 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 + + 2n + + for some integer n. + All implementations support texture images that are at + least 64 texels wide.

+ height +

Specifies the height of the texture image. Must be + + 2m + + for some integer 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.

Description

+ 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.

Notes

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. +

Errors

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 + + log2max + , where + 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 + + log2max + , where + 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 + + 2k + + for some integer 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.

Associated Gets

+ glGet with arguments + GL_NUM_COMPRESSED_TEXTURE_FORMATS and + GL_COMPRESSED_TEXTURE_FORMATS +

+ glGet + with argument GL_MAX_TEXTURE_SIZE

See Also

+ glActiveTexture, + glBindTexture, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glPixelStorei, + glTexEnv, + glTexImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es1/glCompressedTexSubImage2D.xml b/es1/glCompressedTexSubImage2D.xml new file mode 100644 index 00000000..2895dcbb --- /dev/null +++ b/es1/glCompressedTexSubImage2D.xml @@ -0,0 +1,153 @@ + + +glCompressedTexSubImage2D

Name

glCompressedTexSubImage2D — specify a two-dimensional compressed texture subimage

C Specification

void glCompressedTexSubImage2D(GLenum target,
 GLint level,
 GLint xoffset,
 GLint yoffset,
 GLsizei width,
 GLsizei height,
 GLenum format,
 GLsizei imageSize,
 const GLvoid * data);
 

Parameters

+ 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.

Description

+ 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 + + xoffset+width-1 + , + inclusive, and y indices yoffset and + + yoffset+height-1 + , + inclusive. This region may not include any texels outside the + range of 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.

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.

Notes

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. +

Errors

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 + + log2max + , where + max is the returned value of + GL_MAX_TEXTURE_SIZE.

+ GL_INVALID_VALUE is generated if + + + + xoffset + < + 0 + + , + + + + + + xoffset + + + width + + + > + w + + , + + + + yoffset + < + 0 + + , + or + + + + + + yoffset + + + height + + + > + h + + , + where + w + is the width and + h + is the 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 + 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. +

Associated Gets

+ glGet with arguments + GL_NUM_COMPRESSED_TEXTURE_FORMATS and + GL_COMPRESSED_TEXTURE_FORMATS +

+ glGet + with argument GL_MAX_TEXTURE_SIZE

See Also

+ glActiveTexture, + glBindTexture, + glCompressedTexImage2D, + glCopyTexSubImage2D, + glGet, + glPixelStorei, + glTexEnv, + glTexParameter +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glCopyTexImage2D.xml b/es1/glCopyTexImage2D.xml new file mode 100644 index 00000000..40f889a6 --- /dev/null +++ b/es1/glCopyTexImage2D.xml @@ -0,0 +1,115 @@ + + + +glCopyTexImage2D

Name

glCopyTexImage2D — specify a two-dimensional texture image with pixels from the color buffer

C Specification

void glCopyTexImage2D(GLenum target,
 GLint level,
 GLenum internalformat,
 GLint x,
 GLint y,
 GLsizei width,
 GLsizei height,
 GLint border);
 

Parameters

+ 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 nth 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 + + 2n + + for some integer n.

+ height +

Specifies the height of the texture image. Must be 0 or + + 2m + + for some integer m.

+ border +

Specifies the width of the border. Must be 0.

Description

+ 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 + + width + + and a height of + + height + + defines the texture array at the mipmap level specified by + 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.

Notes

An image with height or width of 0 indicates a + null-texture.

Errors

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 + + log2max + , where + 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 + + 2k + + for some integer k.

GL_INVALID_VALUE is generated if + border is not 0.

+ GL_INVALID_ENUM is generated if + internalformat + is not an accepted constant. +

Associated Gets

+ glGet + with argument GL_MAX_TEXTURE_SIZE

See Also

+ glCompressedTexImage2D, + glCopyTexSubImage2D, + glGet, + glTexEnv, + glTexImage2D, + glTexSubImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es1/glCopyTexSubImage2D.xml b/es1/glCopyTexSubImage2D.xml new file mode 100644 index 00000000..62032ec9 --- /dev/null +++ b/es1/glCopyTexSubImage2D.xml @@ -0,0 +1,113 @@ + + + +glCopyTexSubImage2D

Name

glCopyTexSubImage2D — specify a two-dimensional texture subimage with pixels from the color buffer

C Specification

void glCopyTexSubImage2D(GLenum target,
 GLint level,
 GLint xoffset,
 GLint yoffset,
 GLint x,
 GLint y,
 GLsizei width,
 GLsizei height);
 

Parameters

+ 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 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.

Description

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 + + xoffset+width-1 + , + inclusive, and y indices + yoffset through + + yoffset+height-1 + , + inclusive, at the mipmap level specified by + 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.

Errors

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 + + log2max + , where + max is the returned value of + GL_MAX_TEXTURE_SIZE.

GL_INVALID_VALUE is generated if + + xoffset<0 + , + + xoffset+width> + w + , + + yoffset<0 + , or + + yoffset+height> + h + , where + w is the texture width and + h is the texture height.

Associated Gets

+ glGet + with argument GL_MAX_TEXTURE_SIZE

See Also

+ glCompressedTexSubImage2D, + glCopyTexImage2D, + glGet, + glTexEnv, + glTexImage2D, + glTexParameter, + glTexSubImage2D +

Copyright

+ 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/. +

diff --git a/es1/glCullFace.xml b/es1/glCullFace.xml new file mode 100644 index 00000000..348e0be5 --- /dev/null +++ b/es1/glCullFace.xml @@ -0,0 +1,42 @@ + + +glCullFace

Name

glCullFace — specify whether front- or back-facing polygons are + culled

C Specification

void glCullFace(GLenum mode);
 

Parameters

+ 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.

Description

+ 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.

Notes

If mode is + GL_FRONT_AND_BACK, + no polygons are drawn, but other primitives such as points and + lines are drawn.

Errors

GL_INVALID_ENUM is generated if + mode is not an accepted value.

Associated Gets

+ glIsEnabled with argument GL_CULL_FACE +

+ glGet with argument GL_CULL_FACE_MODE +

See Also

+ glEnable, + glFrontFace +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glDeleteBuffers.xml b/es1/glDeleteBuffers.xml new file mode 100644 index 00000000..b24ba1d8 --- /dev/null +++ b/es1/glDeleteBuffers.xml @@ -0,0 +1,39 @@ + + +glDeleteBuffers

Name

glDeleteBuffers — delete named buffer objects

C Specification

void glDeleteBuffers(GLsizei n,
 const GLuint * buffers);
 

Parameters

+ n +

Specifies the number of buffer objects to be + deleted.

+ buffers +

Specifies an array of buffer object names to be + deleted.

Description

+ 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.

Notes

+ 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. +

Errors

GL_INVALID_VALUE is generated if + n is negative.

Associated Gets

+ glIsBuffer +

See Also

+ glBufferData, + glBufferSubData, + glBindBuffer, + glGenBuffers +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glDeleteTextures.xml b/es1/glDeleteTextures.xml new file mode 100644 index 00000000..f76a262a --- /dev/null +++ b/es1/glDeleteTextures.xml @@ -0,0 +1,31 @@ + + +glDeleteTextures

Name

glDeleteTextures — delete named textures

C Specification

void glDeleteTextures(GLsizei n,
 const GLuint * textures);
 

Parameters

+ n +

Specifies the number of textures to be + deleted.

+ textures +

Specifies an array of textures to be + deleted.

Description

+ 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.

Errors

GL_INVALID_VALUE is generated if + n is negative.

Associated Gets

+ glIsTexture +

See Also

+ glBindTexture, + glGenTextures +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glDepthFunc.xml b/es1/glDepthFunc.xml new file mode 100644 index 00000000..a51f9af9 --- /dev/null +++ b/es1/glDepthFunc.xml @@ -0,0 +1,62 @@ + + +glDepthFunc

Name

glDepthFunc — specify the value used for depth buffer comparisons

C Specification

void glDepthFunc(GLenum func);
 

Parameters

+ 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.

Description

+ 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.

Errors

GL_INVALID_ENUM is generated if + func is not an accepted value.

See Also

+ glDepthRange, + glEnable, + glPolygonOffset +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glDepthMask.xml b/es1/glDepthMask.xml new file mode 100644 index 00000000..9808e03a --- /dev/null +++ b/es1/glDepthMask.xml @@ -0,0 +1,24 @@ + + +glDepthMask

Name

glDepthMask — enable or disable writing into the depth buffer

C Specification

void glDepthMask(GLboolean flag);
 

Parameters

+ 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.

Description

+ 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.

See Also

+ glClear, + glColorMask, + glDepthFunc, + glDepthRange, + glStencilMask +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glDepthRange.xml b/es1/glDepthRange.xml new file mode 100644 index 00000000..7e98ab49 --- /dev/null +++ b/es1/glDepthRange.xml @@ -0,0 +1,44 @@ + + +glDepthRange

Name

glDepthRange — specify mapping of depth values from normalized + device coordinates to window coordinates

C Specification

void glDepthRangef(GLclampf near,
 GLclampf far);
 
void glDepthRangex(GLclampx near,
 GLclampx far);
 

Parameters

+ 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.

Description

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.

Notes

It is not necessary that near + be less than far. + Reverse mappings such as + + near + = + 1 + , + and + + far + = + 0 + + are acceptable.

See Also

+ glDepthFunc, + glPolygonOffset, + glViewport +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glDisable.xml b/es1/glDisable.xml new file mode 100644 index 00000000..b4d33296 --- /dev/null +++ b/es1/glDisable.xml @@ -0,0 +1,4 @@ + + + +glDisable diff --git a/es1/glDisableClientState.xml b/es1/glDisableClientState.xml new file mode 100644 index 00000000..46863b4e --- /dev/null +++ b/es1/glDisableClientState.xml @@ -0,0 +1,4 @@ + + + +glDisableClientState diff --git a/es1/glDrawArrays.xml b/es1/glDrawArrays.xml new file mode 100644 index 00000000..5f0fed10 --- /dev/null +++ b/es1/glDrawArrays.xml @@ -0,0 +1,53 @@ + + +glDrawArrays

Name

glDrawArrays — render primitives from array data

C Specification

void glDrawArrays(GLenum mode,
 GLint first,
 GLsizei count);
 

Parameters

+ 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.

Description

+ 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.

Errors

GL_INVALID_ENUM is generated if + mode is not an accepted value.

GL_INVALID_VALUE is generated if + count is negative.

See Also

+ glClientActiveTexture, + glColorPointer, + glDrawElements, + glNormalPointer, + glTexCoordPointer, + glVertexPointer +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glDrawElements.xml b/es1/glDrawElements.xml new file mode 100644 index 00000000..f77c058c --- /dev/null +++ b/es1/glDrawElements.xml @@ -0,0 +1,60 @@ + + +glDrawElements

Name

glDrawElements — render primitives from array data

C Specification

void glDrawElements(GLenum mode,
 GLsizei count,
 GLenum type,
 const GLvoid * indices);
 

Parameters

+ 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.

Description

+ 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.

Errors

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.

See Also

+ glClientActiveTexture, + glColorPointer, + glDrawArrays, + glNormalPointer, + glTexCoordPointer, + glVertexPointer

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glEnable.xml b/es1/glEnable.xml new file mode 100644 index 00000000..2d20f83e --- /dev/null +++ b/es1/glEnable.xml @@ -0,0 +1,181 @@ + + +glEnable

Name

glEnable — enable or disable server-side GL capabilities

C Specification

void glEnable(GLenum cap);
 
void glDisable(GLenum cap);
 

Parameters

+ cap +

Specifies a symbolic constant indicating a GL capability.

Description

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_PLANEi +

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_LIGHTi +

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.

Notes

+ GL_CLIP_PLANEi and + GL_POINT_SPRITE_OES are only supported if the GL version is + 1.1 or greater. +

Errors

GL_INVALID_ENUM is generated if + cap + is not one of the values listed previously.

Associated Gets

+ glIsEnabled +

+ glGet +

See Also

+ 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

+ 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/. +

\ No newline at end of file diff --git a/es1/glEnableClientState.xml b/es1/glEnableClientState.xml new file mode 100644 index 00000000..9a950f6a --- /dev/null +++ b/es1/glEnableClientState.xml @@ -0,0 +1,80 @@ + + + +glEnableClientState

Name

glEnableClientState — enable or disable client-side capability

C Specification

void glEnableClientState(GLenum array);
 
void glDisableClientState(GLenum array);
 

Parameters

+ 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. +

Description

+ 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.

Notes

Enabling and disabling + GL_TEXTURE_COORD_ARRAY + affects the active client texture unit. The active client + texture unit is controlled with + glClientActiveTexture.

Errors

GL_INVALID_ENUM is generated if + array is not an accepted value.

Associated Gets

+ glIsEnabled +

See Also

+ glClientActiveTexture, + glColorPointer, + glDrawArrays, + glDrawElements, + glEnable, + glNormalPointer, + glTexCoordPointer, + glVertexPointer +

Copyright

+ 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/. +

diff --git a/es1/glFinish.xml b/es1/glFinish.xml new file mode 100644 index 00000000..a53af0f2 --- /dev/null +++ b/es1/glFinish.xml @@ -0,0 +1,24 @@ + + + +glFinish

Name

glFinish — block until all GL execution is complete

C Specification

void glFinish(void); 
 

Description

+ 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.

Notes

+ 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. +

See Also

+ glFlush + glReadPixels + eglSwapBuffers +

Copyright

+ 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/. +

diff --git a/es1/glFlush.xml b/es1/glFlush.xml new file mode 100644 index 00000000..b3650a92 --- /dev/null +++ b/es1/glFlush.xml @@ -0,0 +1,26 @@ + + +glFlush

Name

glFlush — force execution of GL commands in finite time

C Specification

void glFlush(void); 
 

Description

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.

Notes

+ glFlush + can return at any time. It does not wait until the execution of + all previously issued GL commands is complete. +

See Also

+ glFinish +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glFog.xml b/es1/glFog.xml new file mode 100644 index 00000000..d9ec8332 --- /dev/null +++ b/es1/glFog.xml @@ -0,0 +1,145 @@ + + +glFog

Name

glFog — specify fog parameters

C Specification

void glFogf(GLenum pname,
 GLfloat param);
 
void glFogx(GLenum pname,
 GLfixed param);
 

Parameters

+ 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.

C Specification

void glFogfv(GLenum pname,
 const GLfloat * params);
 
void glFogxv(GLenum pname,
 const GLfixed * params);
 

Parameters

+ 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.

Description

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 + + Cf + , + the fog color. Both fixed-point and floating-point + values are mapped directly. After conversion, all color + components are clamped to the range [0, 1]. The initial + fog color is (0, 0, 0, 0).

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

+ f= + + end-z + end-start + +

The equation for GL_EXP fog is

+ f= + + e + -(density-z) + +

The equation for GL_EXP2 fog is

+ f= + + e + + -(density-z) + 2 + + +

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 + + Cr + , + are replaced by

+ C'r= + f + + C + r + + + + 1-f + + C + f + +

Fog does not affect a fragment's alpha component.

Errors

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.

See Also

+ glEnable +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glFrontFace.xml b/es1/glFrontFace.xml new file mode 100644 index 00000000..901bab5c --- /dev/null +++ b/es1/glFrontFace.xml @@ -0,0 +1,42 @@ + + +glFrontFace

Name

glFrontFace — define front- and back-facing polygons

C Specification

void glFrontFace(GLenum mode);
 

Parameters

+ mode +

Specifies the orientation of front-facing polygons. + GL_CW and + GL_CCW are accepted. The initial value is + GL_CCW.

Description

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.

Errors

GL_INVALID_ENUM is generated if + mode is not an accepted value.

See Also

+ glCullFace, + glEnable, + glLightModel +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glFrustum.xml b/es1/glFrustum.xml new file mode 100644 index 00000000..edeaa97f --- /dev/null +++ b/es1/glFrustum.xml @@ -0,0 +1,281 @@ + + +glFrustum

Name

glFrustum — multiply the current matrix by a perspective matrix

C Specification

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);
 

Parameters

+ 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.

Description

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:

+

+ + + + + + + + + + 2 + + near + + + + + right + - + left + + + + + + + 0 + + + A + + + 0 + + + + + 0 + + + + + + + 2 + + near + + + + + top + - + bottom + + + + + + + B + + + 0 + + + + + 0 + + + 0 + + + C + + + D + + + + + 0 + + + 0 + + + -1 + + + 0 + + + + +

+

+

+ + + A + = + + + + right + + + left + + + + + right + - + left + + + + +

+

+

+ + + B + = + + + + top + + + bottom + + + + + top + - + bottom + + + + +

+

+

+ + + C + = + + - + + + + + far + + + near + + + + + far + - + near + + + + + + +

+

+

+ + + D + = + + - + + + + + 2 + + far + + near + + + + + far + - + near + + + + + + +

+

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.

Notes

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

+ + r + = + farnear + +

roughly + + log2(r) + + bits of depth buffer precision are lost. Because + r approaches infinity as + near approaches 0, + near must never be set to 0.

Errors

+ GL_INVALID_VALUE is generated if + near or far + is not positive, or if + left = right, or + bottom = top, or + near = far. +

See Also

+ glOrtho, + glMatrixMode, + glMultMatrix, + glPushMatrix, + glViewport +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glGenBuffers.xml b/es1/glGenBuffers.xml new file mode 100644 index 00000000..fdf5897b --- /dev/null +++ b/es1/glGenBuffers.xml @@ -0,0 +1,29 @@ + + +glGenBuffers

Name

glGenBuffers — generate buffer object names

C Specification

void glGenBuffers(GLsizei n,
 GLuint * buffers);
 

Parameters

+ n +

Specifies the number of buffer object names to be generated.

+ buffers +

Specifies an array in which the generated + buffer object names are stored.

Description

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.

Errors

GL_INVALID_VALUE is generated if + n is negative.

Associated Gets

+ glIsBuffer +

See Also

+ glBindBuffer, + glBufferData, + glBufferSubData, + glDeleteBuffers, +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glGenTextures.xml b/es1/glGenTextures.xml new file mode 100644 index 00000000..9e9c0e79 --- /dev/null +++ b/es1/glGenTextures.xml @@ -0,0 +1,34 @@ + + +glGenTextures

Name

glGenTextures — generate texture names

C Specification

void glGenTextures(GLsizei n,
 GLuint * textures);
 

Parameters

+ n +

Specifies the number of texture names to be generated.

+ textures +

Specifies an array in which the generated texture + names are stored.

Description

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.

Errors

GL_INVALID_VALUE is generated if + n is negative.

Associated Gets

+ glIsTexture +

See Also

+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glTexImage2D, + glTexParameter +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glGet.xml b/es1/glGet.xml new file mode 100644 index 00000000..6d231f80 --- /dev/null +++ b/es1/glGet.xml @@ -0,0 +1,948 @@ + + + +glGet

Name

glGet — return the value or values of a selected parameter

C Specification

void glGetBooleanv(GLenum pname,
 GLboolean * params);
 
void glGetFixedv(GLenum pname,
 GLfixed * params);
 
void glGetFloatv(GLenum pname,
 GLfloat * params);
 
void glGetIntegerv(GLenum pname,
 GLint * params);
 

Parameters

+ 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.

Description

+ 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_PLANEi +

+ 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 + + + -1.0 + + returns the most negative representable integer value. + The initial value is (1, 1, 1, 1). + See glColor. +

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 + + + -1.0 + + returns the most negative representable integer value. + The initial value is (0, 0, 1). + See glNormal. +

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_LIGHTi +

+ 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. +

Notes

+ 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. +

Errors

GL_INVALID_ENUM is generated if + pname is not an accepted value.

See Also

+ glGetError, + glGetString +

Copyright

+ 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/. +

diff --git a/es1/glGetBufferParameteriv.xml b/es1/glGetBufferParameteriv.xml new file mode 100644 index 00000000..f76dbfa8 --- /dev/null +++ b/es1/glGetBufferParameteriv.xml @@ -0,0 +1,44 @@ + + +glGetBufferParameteriv

Name

glGetBufferParameteriv — return parameters of a buffer object

C Specification

void glGetBufferParameteriv(GLenum target,
 GLenum pname,
 GLint * params);
 

Parameters

+ 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.

Description

+ 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. +

Notes

+ If an error is generated, + no change is made to the contents of params. +

Errors

+ 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. +

See Also

+ glBufferData, + glBindBuffer +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glGetClipPlane.xml b/es1/glGetClipPlane.xml new file mode 100644 index 00000000..c46a0956 --- /dev/null +++ b/es1/glGetClipPlane.xml @@ -0,0 +1,42 @@ + + +glGetClipPlane

Name

glGetClipPlane — return the coefficients of the specified clipping + plane

C Specification

void glGetClipPlanef(GLenum plane,
 GLfloat *equation);
 
void glGetClipPlanex(GLenum plane,
 GLfixed *equation);
 

Parameters

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 + + + -1 + , are accepted.

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).

Description

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.

Notes

It is always the case that + + + GL_CLIP_PLANEi + + = + + + + GL_CLIP_PLANE0 + + + + + i + + . +

If an error is generated, no change is made to the contents of + equation.

Errors

GL_INVALID_ENUM is generated if + plane is not an accepted value.

See Also

glClipPlane

Copyright

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/.

\ No newline at end of file diff --git a/es1/glGetError.xml b/es1/glGetError.xml new file mode 100644 index 00000000..7f51ec22 --- /dev/null +++ b/es1/glGetError.xml @@ -0,0 +1,68 @@ + + +glGetError

Name

glGetError — return error information

C Specification

GLenum glGetError(void); 
 

Description

+ 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

+ 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/. +

\ No newline at end of file diff --git a/es1/glGetLight.xml b/es1/glGetLight.xml new file mode 100644 index 00000000..eb5723c6 --- /dev/null +++ b/es1/glGetLight.xml @@ -0,0 +1,163 @@ + + + +glGetLight

Name

glGetLight — return light source parameter values

C Specification

void glGetLightfv(GLenum light,
 GLenum pname,
 GLfloat * params);
 
void glGetLightxv(GLenum light,
 GLenum pname,
 GLfixed * params);
 

Parameters

+ 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 + + GL_LIGHTi where + 0<i< + GL_MAX_LIGHTS + +

+ 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. +

Description

+ 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_LIGHTi for + 0<i< + GL_MAX_LIGHTS + + where 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).

Notes

+ It is always the case that + + GL_LIGHTi= + GL_LIGHT0+i. + +

+ If an error is generated, no change is made to the contents + of params. +

Errors

+ GL_INVALID_ENUM is generated if + light or pname + is not an accepted value. +

See Also

+ glLight +

Copyright

+ 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/. +

diff --git a/es1/glGetMaterial.xml b/es1/glGetMaterial.xml new file mode 100644 index 00000000..7e6d772b --- /dev/null +++ b/es1/glGetMaterial.xml @@ -0,0 +1,97 @@ + + +glGetMaterial

Name

glGetMaterial — return material parameters values

C Specification

void glGetMaterialfv(GLenum face,
 GLenum pname,
 GLfloat * params);
 
void glGetMaterialxv(GLenum face,
 GLenum pname,
 GLfixed * params);
 

Parameters

+ 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. +

Description

+ 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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if + face or pname + is not an accepted value. +

See Also

+ glMaterial +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glGetPointerv.xml b/es1/glGetPointerv.xml new file mode 100644 index 00000000..46fa8391 --- /dev/null +++ b/es1/glGetPointerv.xml @@ -0,0 +1,63 @@ + + + +glGetPointerv

Name

glGetPointerv — return the address of the specified pointer

C Specification

void glGetPointerv(GLenum pname,
 GLvoid ** params);
 

Parameters

+ 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. +

Description

+ 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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if + pname is not an accepted value. +

See Also

+ glBindBuffer, + glClientActiveTexture, + glColorPointer, + glDrawArrays, + glMatrixIndexPointer, + glNormalPointer, + glTexCoordPointer, + glPointSizePointerOES, + glVertexPointer + +

Copyright

+ 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/. +

diff --git a/es1/glGetString.xml b/es1/glGetString.xml new file mode 100644 index 00000000..669d84ec --- /dev/null +++ b/es1/glGetString.xml @@ -0,0 +1,56 @@ + + +glGetString

Name

glGetString — return a string describing the current GL + connection

C Specification

const GLubyte * glGetString(GLenum name);
 

Parameters

+ name +

Specifies a symbolic constant, one of + GL_VENDOR, + GL_RENDERER, + GL_VERSION, or + GL_EXTENSIONS.

Description

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.

Notes

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.

Errors

GL_INVALID_ENUM is generated if + name is not an accepted value.

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glGetTexEnv.xml b/es1/glGetTexEnv.xml new file mode 100644 index 00000000..68d74960 --- /dev/null +++ b/es1/glGetTexEnv.xml @@ -0,0 +1,135 @@ + + +glGetTexEnv

Name

glGetTexEnv — return texture environment parameters

C Specification

void glGetTexEnvfv(GLenum target,
 GLenum pname,
 GLfloat * params);
 
void glGetTexEnviv(GLenum target,
 GLenum pname,
 GLint * params);
 
void glGetTexEnvxv(GLenum target,
 GLenum pname,
 GLfixed * params);
 

Parameters

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. +

Description

+ 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 + + + -1.0 + + maps to the most negative representable integer. The initial + value is (0, 0, 0, 0). +

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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if target or pname is not an + accepted value. +

See Also

+ glActiveTexture, + glTexEnv +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glGetTexParameter.xml b/es1/glGetTexParameter.xml new file mode 100644 index 00000000..f51a1670 --- /dev/null +++ b/es1/glGetTexParameter.xml @@ -0,0 +1,90 @@ + + +glGetTexParameter

Name

glGetTexParameter — return texture parameter values

C Specification

void glGetTexParameterfv(GLenum target,
 GLenum pname,
 GLfloat * params);
 
void glGetTexParameteriv(GLenum target,
 GLenum pname,
 GLint * params);
 
void glGetTexParameterxv(GLenum target,
 GLenum pname,
 GLfixed * params);
 

Parameters

+ 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.

Description

+ 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. +

Notes

+ If an error is generated, no change is made to the contents of + param. +

Errors

GL_INVALID_ENUM is generated if + target or + pname + is not one of the accepted defined values.

See Also

+ glTexParameter +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glHint.xml b/es1/glHint.xml new file mode 100644 index 00000000..8f217e8c --- /dev/null +++ b/es1/glHint.xml @@ -0,0 +1,78 @@ + + +glHint

Name

glHint — specify implementation-specific hints

C Specification

void glHint(GLenum target,
 GLenum mode);
 

Parameters

+ 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.

Description

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.

Notes

The interpretation of hints depends on the + implementation. Some implementations ignore + glHint + settings.

Errors

GL_INVALID_ENUM is generated if either + target or mode + is not an accepted value.

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glIsBuffer.xml b/es1/glIsBuffer.xml new file mode 100644 index 00000000..e7745750 --- /dev/null +++ b/es1/glIsBuffer.xml @@ -0,0 +1,31 @@ + + +glIsBuffer

Name

glIsBuffer — determine if a name corresponds to a buffer object

C Specification

GLboolean glIsBuffer(GLuint buffer);
 

Parameters

+ buffer +

+ Specifies a value that may be the name of a buffer object. +

Description

+ 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.

Errors

+ None. +

See Also

+ glBindBuffer, + glBufferData, + glBufferSubData, + glDeleteBuffers, + glGenBuffers +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glIsEnabled.xml b/es1/glIsEnabled.xml new file mode 100644 index 00000000..c0df2fa2 --- /dev/null +++ b/es1/glIsEnabled.xml @@ -0,0 +1,98 @@ + + + +glIsEnabled

Name

glIsEnabled — test whether a capability is enabled

C Specification

GLboolean glIsEnabled(GLenum cap);
 

Parameters

+ cap +

+ Specifies a symbolic constant indicating a GL capability. +

Description

+ 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_PLANEi + +   + 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_LIGHTi + +   + 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 +

Notes

+ If an error is generated, + glIsEnabled returns 0. +

Errors

+ GL_INVALID_ENUM is generated if + cap is not an accepted value. +

See Also

+ glEnable, + glEnableClientState +

Copyright

+ 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/. +

diff --git a/es1/glIsTexture.xml b/es1/glIsTexture.xml new file mode 100644 index 00000000..dd5a3dc7 --- /dev/null +++ b/es1/glIsTexture.xml @@ -0,0 +1,31 @@ + + +glIsTexture

Name

glIsTexture — determine if a name corresponds to a texture

C Specification

GLboolean glIsTexture(GLuint texture);
 

Parameters

+ texture +

+ Specifies a value that may be the name of a texture. +

Description

+ 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.

Errors

+ None. +

See Also

+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glGenTextures, + glTexImage2D, + glTexParameter +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glLight.xml b/es1/glLight.xml new file mode 100644 index 00000000..3484b984 --- /dev/null +++ b/es1/glLight.xml @@ -0,0 +1,224 @@ + + + +glLight

Name

glLight — set light source parameters

C Specification

void glLightf(GLenum light,
 GLenum pname,
 GLfloat param);
 
void glLightx(GLenum light,
 GLenum pname,
 GLfixed param);
 

Parameters

+ 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_LIGHTi + where + + 0 + <= + i + < + GL_MAX_LIGHTS + . +

+ 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.

C Specification

void glLightfv(GLenum light,
 GLenum pname,
 const GLfloat * params);
 
void glLightxv(GLenum light,
 GLenum pname,
 const GLfixed * params);
 

Parameters

+ 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_LIGHTi + where + + 0 + <= + i + < + GL_MAX_LIGHTS + . +

+ 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.

Description

glLight + sets the values of individual light source parameters. + light + names the light and is a symbolic name of the form + GL_LIGHTi, + where + + 0 + <= + i + < + GL_MAX_LIGHTS + . + 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_LIGHTi. +

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 + w + component of the position is 0, + the light is treated as a directional source. + Diffuse and specular lighting calculations take the light's direction, + but not its actual position, + into account, + and attenuation is disabled. + Otherwise, + diffuse and specular lighting calculations are based on the actual location + of the light in eye coordinates, + and attenuation is enabled. + The initial position is (0, 0, 1, 0); + thus, the initial light source is directional, + parallel to, and in the direction of the + + + + - + z + + + axis. +

+ 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.

Notes

It is always the case that + + GL_LIGHTi = + GL_LIGHT0+i + . +

Errors

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.

See Also

+ glEnable, + glLightModel, + glMaterial +

Copyright

+ 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/. +

diff --git a/es1/glLightModel.xml b/es1/glLightModel.xml new file mode 100644 index 00000000..3bb121f5 --- /dev/null +++ b/es1/glLightModel.xml @@ -0,0 +1,70 @@ + + +glLightModel

Name

glLightModel — set the lighting model parameters

C Specification

void glLightModelf(GLenum pname,
 GLfloat param);
 
void glLightModelx(GLenum pname,
 GLfixed param);
 

Parameters

+ 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.

C Specification

void glLightModelfv(GLenum pname,
 const GLfloat * params);
 
void glLightModelxv(GLenum pname,
 const GLfixed * params);
 

Parameters

+ 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.

Description

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.

Errors

GL_INVALID_ENUM is generated if + pname is not an accepted value.

See Also

+ glLight, + glMaterial +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glLineWidth.xml b/es1/glLineWidth.xml new file mode 100644 index 00000000..b31c0d68 --- /dev/null +++ b/es1/glLineWidth.xml @@ -0,0 +1,70 @@ + + +glLineWidth

Name

glLineWidth — specify the width of rasterized lines

C Specification

void glLineWidth(GLfloat width);
 
void glLineWidthx(GLfixed width);
 

Parameters

+ width +

Specifies the width of rasterized lines. The + initial value is 1.

Description

+ 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 + + + | + Δx + | + + >= + + | + Δy + | + + , + 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.

Notes

Nonantialiased line width may be clamped to an + implementation-dependent maximum. Call + glGet + with GL_ALIASED_LINE_WIDTH_RANGE + to determine the maximum width.

Errors

GL_INVALID_VALUE is generated if + width is less than or equal to 0.

Associated Gets

+ glGet + with argument GL_ALIASED_LINE_WIDTH_RANGE

+ glGet + with argument GL_SMOOTH_LINE_WIDTH_RANGE

See Also

+ glEnable, + glGet +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glLoadIdentity.xml b/es1/glLoadIdentity.xml new file mode 100644 index 00000000..90a88b3d --- /dev/null +++ b/es1/glLoadIdentity.xml @@ -0,0 +1,58 @@ + + +glLoadIdentity

Name

glLoadIdentity — replace the current matrix with the identity + matrix

C Specification

void glLoadIdentity(void); 
 

Description

+ glLoadIdentity + replaces the current matrix with the identity matrix. It is + semantically equivalent to calling + glLoadMatrix + with the identity matrix

+ + ( + + + 1 + 0 + 0 + 0 + + + 0 + 1 + 0 + 0 + + + 0 + 0 + 1 + 0 + + + 0 + 0 + 0 + 1 + + + ) + +

but in some cases it is more efficient.

Associated Gets

+ glGet with argument GL_MATRIX_MODE +

+ glGet with argument GL_MODELVIEW_MATRIX +

+ glGet with argument GL_PROJECTION_MATRIX +

+ glGet with argument GL_TEXTURE_MATRIX +

See Also

+ glLoadMatrix, + glMatrixMode, + glMultMatrix, + glPushMatrix +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glLoadMatrix.xml b/es1/glLoadMatrix.xml new file mode 100644 index 00000000..b7a28de4 --- /dev/null +++ b/es1/glLoadMatrix.xml @@ -0,0 +1,106 @@ + + +glLoadMatrix

Name

glLoadMatrix — replace the current matrix with the specified + matrix

C Specification

void glLoadMatrixf(const GLfloat * m);
 
void glLoadMatrixx(const GLfixed * m);
 

Parameters

+ m +

Specifies a pointer to 16 consecutive values, which + are used as the elements of a + + 4x4 + + column-major matrix.

Description

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 + + v= + + v[0] + v[1] + v[2] + v[3] + + + is the set of object coordinates of a vertex, and + m points to an array of 16 + fixed-point or single-precision floating-point values + + + m[0], + m[1], + ... + m[15] + + , + + then the modelview transformation + + Mv + + does the following:

+ Mv= + ( + + + m[0] + m[4] + m[8] + m[12] + + + m[1] + m[5] + m[9] + m[13] + + + m[2] + m[6] + m[10] + m[14] + + + m[3] + m[7] + m[11] + m[15] + + + ) + x + ( + + v[0] + v[1] + v[2] + v[3] + + ) +

Where + ``x'' + denotes matrix multiplication.

Projection and texture transformations are similarly + defined.

Notes

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.

Associated Gets

+ glGet with argument GL_MATRIX_MODE +

+ glGet with argument GL_MODELVIEW_MATRIX +

+ glGet with argument GL_PROJECTION_MATRIX +

+ glGet with argument GL_TEXTURE_MATRIX +

See Also

+ glLoadIdentity, + glMatrixMode, + glMultMatrix, + glPushMatrix +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glLogicOp.xml b/es1/glLogicOp.xml new file mode 100644 index 00000000..611f03d0 --- /dev/null +++ b/es1/glLogicOp.xml @@ -0,0 +1,99 @@ + + +glLogicOp

Name

glLogicOp — specify a logical pixel operation

C Specification

void glLogicOp(GLenum opcode);
 

Parameters

+ 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.

Description

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. +

OpcodeResulting Operation
GL_CLEAR0
GL_SET1
GL_COPYs
GL_COPY_INVERTED + + ~s + +
GL_NOOPd
GL_INVERT + + ~d + +
GL_AND + + s&d + +
GL_NAND + + ~s&d + +
GL_OR + + s|d + +
GL_NOR + + ~s|d + +
GL_XOR + + s^d + +
GL_EQUIV + + ~s^d + +
GL_AND_REVERSE + + s&~d + +
GL_AND_INVERTED + + ~s&d + +
GL_OR_REVERSE + + s|~d + +
GL_OR_INVERTED + + ~s|d + +

+ 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.

Errors

GL_INVALID_ENUM is generated if + opcode is not an accepted value.

See Also

+ glAlphaFunc, + glBlendFunc, + glEnable, + glStencilOp +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glMaterial.xml b/es1/glMaterial.xml new file mode 100644 index 00000000..347c5883 --- /dev/null +++ b/es1/glMaterial.xml @@ -0,0 +1,130 @@ + + +glMaterial

Name

glMaterial — specify material parameters for the lighting model

C Specification

void glMaterialf(GLenum face,
 GLenum pname,
 GLfloat param);
 
void glMaterialx(GLenum face,
 GLenum pname,
 GLfixed param);
 

Parameters

+ 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.

C Specification

void glMaterialfv(GLenum face,
 GLenum pname,
 const GLfloat * params);
 
void glMaterialxv(GLenum face,
 GLenum pname,
 const GLfixed * params);
 

Parameters

+ 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.

Description

+ 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.

Notes

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.

Errors

+ 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. +

Associated Gets

+ glGetMaterial +

See Also

+ glEnable, + glLight, + glLightModel +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glMatrixMode.xml b/es1/glMatrixMode.xml new file mode 100644 index 00000000..db8c63db --- /dev/null +++ b/es1/glMatrixMode.xml @@ -0,0 +1,43 @@ + + + +glMatrixMode

Name

glMatrixMode — specify which matrix is the current matrix

C Specification

void glMatrixMode(GLenum mode);
 

Parameters

+ 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. +

Description

+ 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.

Errors

GL_INVALID_ENUM is generated if + mode is not an accepted value.

Associated Gets

+ glGet with argument GL_MATRIX_MODE +

See Also

+ + glLoadMatrix, + + + glMultMatrix, + glPushMatrix + +

Copyright

+ 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/. +

diff --git a/es1/glMultMatrix.xml b/es1/glMultMatrix.xml new file mode 100644 index 00000000..375414ca --- /dev/null +++ b/es1/glMultMatrix.xml @@ -0,0 +1,192 @@ + + +glMultMatrix

Name

glMultMatrix — multiply the current matrix with the specified + matrix

C Specification

void glMultMatrixf(const GLfloat * m);
 
void glMultMatrixx(const GLfixed * m);
 

Parameters

+ m +

Points to 16 consecutive values that are used as + the elements of a + + 4x4 + + column-major matrix.

Description

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.

Examples

If the current matrix is C, + and the coordinates to be transformed are, + + v= + + v[0] + v[1] + v[2] + v[3] + + , + then the current transformation is + + Cxv + , or +

+ ( + + + c[0] + c[4] + c[8] + c[12] + + + c[1] + c[5] + c[9] + c[13] + + + c[2] + c[6] + c[10] + c[14] + + + c[3] + c[7] + c[11] + c[15] + + + ) + x + ( + + v[0] + v[1] + v[2] + v[3] + + ) +

Calling + glMultMatrix + with an argument of + + + m= + m[0], + m[1], + ... + m[15] + + + replaces the current transformation with + + CxM + xv + , or

+ ( + + + c[0] + c[4] + c[8] + c[12] + + + c[1] + c[5] + c[9] + c[13] + + + c[2] + c[6] + c[10] + c[14] + + + c[3] + c[7] + c[11] + c[15] + + + ) + x + ( + + + m[0] + m[4] + m[8] + m[12] + + + m[1] + m[5] + m[9] + m[13] + + + m[2] + m[6] + m[10] + m[14] + + + m[3] + m[7] + m[11] + m[15] + + + ) + x + ( + + v[0] + v[1] + v[2] + v[3] + + ) +

Where + ``x'' + denotes matrix multiplication, and + v + is represented as a + + 4x1 + + matrix.

Notes

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 + + 4x4 + + arrays are represented in row-major order. The transformations + just described represent these matrices in column-major order. + The order of the multiplication is important. For example, if + the current transformation is a rotation, and + 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.

Associated Gets

+ glGet with argument GL_MATRIX_MODE +

+ glGet with argument GL_MODELVIEW_MATRIX +

+ glGet with argument GL_PROJECTION_MATRIX +

+ glGet with argument GL_TEXTURE_MATRIX +

See Also

+ glLoadIdentity, + glLoadMatrix, + glMatrixMode, + glPushMatrix +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glMultiTexCoord.xml b/es1/glMultiTexCoord.xml new file mode 100644 index 00000000..658c4fae --- /dev/null +++ b/es1/glMultiTexCoord.xml @@ -0,0 +1,72 @@ + + + +glMultiTexCoord

Name

glMultiTexCoord — set the current texture coordinates

C Specification

void glMultiTexCoord4f(GLenum target,
 GLfloat s,
 GLfloat t,
 GLfloat r,
 GLfloat q);
 
void glMultiTexCoord4x(GLenum target,
 GLfixed s,
 GLfixed t,
 GLfixed r,
 GLfixed q);
 

Parameters

+ 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_TEXTUREi, + where i ranges from 0 to 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.

Description

+ 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 + + + + s + t + r + q + + + are + + + + 0 + 0 + 0 + 1 + + .

Notes

It is always the case that + + GL_TEXTUREi = + GL_TEXTURE0+i + .

Associated Gets

+ glGet with argument GL_CURRENT_TEXTURE_COORDS with appropriate + texture unit selected. +

+ glGet + with argument GL_MAX_TEXTURE_UNITS +

See Also

+ glActiveTexture, + glClientActiveTexture, + glColor, + glGet, + glNormal, + glTexCoordPointer +

Copyright

+ 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/. +

diff --git a/es1/glNormal.xml b/es1/glNormal.xml new file mode 100644 index 00000000..3695018c --- /dev/null +++ b/es1/glNormal.xml @@ -0,0 +1,45 @@ + + +glNormal

Name

glNormal — set the current normal vector

C Specification

void glNormal3f(GLfloat nx,
 GLfloat ny,
 GLfloat nz);
 
void glNormal3x(GLfixed nx,
 GLfixed ny,
 GLfixed nz);
 

Parameters

+ nx, + ny, + nz +

Specify the + x, + y, and + z coordinates of the + new current normal. The initial value is (0, 0, 1).

Description

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.

Associated Gets

+ glGet with argument GL_CURRENT_NORMAL +

+ glIsEnabled with argument GL_NORMALIZE +

+ glIsEnabled with argument GL_RESCALE_NORMAL +

See Also

+ glColor, + glEnable, + glMultiTexCoord, + glNormalPointer +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glNormalPointer.xml b/es1/glNormalPointer.xml new file mode 100644 index 00000000..f45d4951 --- /dev/null +++ b/es1/glNormalPointer.xml @@ -0,0 +1,70 @@ + + +glNormalPointer

Name

glNormalPointer — define an array of normals

C Specification

void glNormalPointer(GLenum type,
 GLsizei stride,
 const GLvoid * pointer);
 

Parameters

+ 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.

Description

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.

Notes

glNormalPointer + is typically implemented on the client side.

Errors

GL_INVALID_ENUM is generated if + type is not an accepted value.

GL_INVALID_VALUE is generated if + stride is negative.

See Also

+ glColorPointer, + glDrawArrays, + glDrawElements, + glEnable, + glTexCoordPointer, + glVertexPointer +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glOrtho.xml b/es1/glOrtho.xml new file mode 100644 index 00000000..2d2c5a8b --- /dev/null +++ b/es1/glOrtho.xml @@ -0,0 +1,136 @@ + + +glOrtho

Name

glOrtho — multiply the current matrix with an orthographic + matrix

C Specification

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);
 

Parameters

+ 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.

Description

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:

+ + ( + + + + + 2 + right-left + + + 0 + 0 + tx + + + 0 + + + 2 + top-bottom + + + 0 + ty + + + 0 + 0 + + + -2 + far-near + + + tz + + + 0 + 0 + 0 + 1 + + + ) + +

where

+ + tx + + = + + - + + right+left + right-left + + + + ty + + = + + - + + top+bottom + top-bottom + + + + tz + + = + + - + + far+near + far-near + + +

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.

Errors

+ GL_INVALID_VALUE is generated if + left = right, or + bottom = top, or + near = far. +

See Also

+ glFrustum, + glMatrixMode, + glMultMatrix, + glPushMatrix, + glViewport +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glPixelStorei.xml b/es1/glPixelStorei.xml new file mode 100644 index 00000000..fecc7312 --- /dev/null +++ b/es1/glPixelStorei.xml @@ -0,0 +1,66 @@ + + +glPixelStorei

Name

glPixelStorei — set pixel storage modes

C Specification

void glPixelStorei(GLenum pname,
 GLint param);
 

Parameters

+ 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.

Description

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.

Notes

Pixel storage modes are client states.

+ glCompressedTexImage2D + and + glCompressedTexSubImage2D + are not affected by glPixelStorei. +

Errors

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.

Associated Gets

+ glGet with argument + GL_PACK_ALIGNMENT or GL_UNPACK_ALIGNMENT +

See Also

+ glReadPixels, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glTexImage2D, + glTexSubImage2D +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glPointParameter.xml b/es1/glPointParameter.xml new file mode 100644 index 00000000..3b3d0781 --- /dev/null +++ b/es1/glPointParameter.xml @@ -0,0 +1,106 @@ + + + +glPointParameter

Name

glPointParameter — specify parameters for point rasterization

C Specification

void glPointParameterf(GLenum pname,
 GLfloat param);
 
void glPointParameterx(GLenum pname,
 GLfixed param);
 

Parameters

+ 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. +

C Specification

void glPointParameterfv(GLenum pname,
 const GLfloat * params);
 
void glPointParameterxv(GLenum pname,
 const GLfixed * params);
 

Parameters

+ 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. +

Description

+ 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. +

Notes

+ If the point size lower bound is greater than the upper bound, + then the point size after clamping is undefined. +

Errors

+ 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. +

Associated Gets

+ 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

See Also

+ glEnable, + glGet, + glLight, + glLightModel +

Copyright

+ 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/. +

diff --git a/es1/glPointSize.xml b/es1/glPointSize.xml new file mode 100644 index 00000000..712abf36 --- /dev/null +++ b/es1/glPointSize.xml @@ -0,0 +1,118 @@ + + +glPointSize

Name

glPointSize — specify the diameter of rasterized points

C Specification

void glPointSize(GLfloat size);
 
void glPointSizex(GLfixed size);
 

Parameters

+ size +

Specifies the diameter of rasterized points. The + initial value is 1.

Description

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 + + xy + + of the pixel fragment that represents the point is computed + as

+ + + [ + xw + ] + + + 12 + + + [ + yw + ] + + + 12 + + +

where w + subscripts indicate window coordinates. All pixels that lie + within the square grid of the rounded size centered at + + xy + + make up the fragment. If the size is even, the center point + is

+ + + [ + xw + + + 12 + ] + + + [ + yw + + + 12 + ] + + +

and the rasterized fragment's centers are the + half-integer window coordinates within the square of the + rounded size centered at + + xy + . + All pixel fragments produced in rasterizing a nonantialiased + point are assigned the same associated data, that of the vertex + corresponding to the point.

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 + + + xw + yw + + . + The coverage value for each fragment is the window + coordinate area of the intersection of the circular region with + the corresponding pixel square. This value is saved and used in + the final rasterization step. The data associated with each + fragment is the data associated with the point being + rasterized.

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.

Notes

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.

Errors

+ GL_INVALID_VALUE is generated if + size is less than or equal to 0.

Associated Gets

+ glGet + with argument GL_ALIASED_POINT_SIZE_RANGE

+ glGet + with argument GL_SMOOTH_POINT_SIZE_RANGE

See Also

+ glEnable, + glGet +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glPointSizePointerOES.xml b/es1/glPointSizePointerOES.xml new file mode 100644 index 00000000..4e803046 --- /dev/null +++ b/es1/glPointSizePointerOES.xml @@ -0,0 +1,92 @@ + + +glPointSizePointerOES

Name

glPointSizePointerOES — define an array of point sizes

C Specification

void glPointSizePointerOES(GLenum type,
 GLsizei stride,
 const GLvoid * pointer);
 

Parameters

+ 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. +

Description

+ 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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if + type is is not an accepted value. +

+ GL_INVALID_VALUE is generated if + stride is negative. +

See Also

+ glDrawArrays, + glDrawElements, + glPointParameter, + glPointSize, +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glPolygonOffset.xml b/es1/glPolygonOffset.xml new file mode 100644 index 00000000..0f1babb2 --- /dev/null +++ b/es1/glPolygonOffset.xml @@ -0,0 +1,41 @@ + + +glPolygonOffset

Name

glPolygonOffset — set the scale and units used to calculate depth + values

C Specification

void glPolygonOffset(GLfloat factor,
 GLfloat units);
 
void glPolygonOffsetx(GLfixed factor,
 GLfixed units);
 

Parameters

+ 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.

Description

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 + * + factor + + + r + * + units + , + where 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.

See Also

+ glDepthFunc, + glEnable +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glPopMatrix.xml b/es1/glPopMatrix.xml new file mode 100644 index 00000000..aba245b3 --- /dev/null +++ b/es1/glPopMatrix.xml @@ -0,0 +1,4 @@ + + + +glPopMatrix diff --git a/es1/glPushMatrix.xml b/es1/glPushMatrix.xml new file mode 100644 index 00000000..9dc09dda --- /dev/null +++ b/es1/glPushMatrix.xml @@ -0,0 +1,59 @@ + + +glPushMatrix

Name

glPushMatrix, glPopMatrix — push and pop the current matrix stack

C Specification

void glPushMatrix(void); 
 
void glPopMatrix(void); 
 

Description

+ 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.

Notes

+ Each texture unit has its own texture matrix stack. Use + glActiveTexture + to select the desired texture matrix stack. +

Errors

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.

Associated Gets

+ 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 +

See Also

+ glActiveTexture, + glFrustum, + glGet, + glLoadIdentity, + glLoadMatrix, + glMatrixMode, + glMultMatrix, + glOrtho, + glRotate, + glScale, + glTranslate, + glViewport +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glReadPixels.xml b/es1/glReadPixels.xml new file mode 100644 index 00000000..aa058a0d --- /dev/null +++ b/es1/glReadPixels.xml @@ -0,0 +1,133 @@ + + + +glReadPixels

Name

glReadPixels — read a block of pixels from the color buffer

C Specification

void glReadPixels(GLint x,
 GLint y,
 GLsizei width,
 GLsizei height,
 GLenum format,
 GLenum type,
 GLvoid * pixels);
 

Parameters

+ 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.

Description

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 + + + x+i + y+j + + + for + + 0<=i<width + + and + + 0<=j<height + . + This pixel is said to be the ith pixel + in the jth 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 + + 2n-1 + , + where 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 + ith pixel in the + jth row is placed in location + + j*width+i + . + 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.

Notes

+ 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.

Errors

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. +

Associated Gets

+ glGet + with argument GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES

+ glGet + with argument GL_IMPLEMENTATION_COLOR_READ_TYPE_OES

+ glGet with argument GL_PACK_ALIGNMENT +

See Also

+ glPixelStorei +

Copyright

+ 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/. +

diff --git a/es1/glRotate.xml b/es1/glRotate.xml new file mode 100644 index 00000000..baf68d4c --- /dev/null +++ b/es1/glRotate.xml @@ -0,0 +1,131 @@ + + +glRotate

Name

glRotate — multiply the current matrix by a rotation matrix

C Specification

void glRotatef(GLfloat angle,
 GLfloat x,
 GLfloat y,
 GLfloat z);
 
void glRotatex(GLfixed angle,
 GLfixed x,
 GLfixed y,
 GLfixed z);
 

Parameters

+ angle +

Specifies the angle of rotation, in degrees.

+ x, + y, + z +

Specify the + x, + y, and + z + coordinates of a vector, respectively.

Description

glRotate produces a rotation of + angle degrees around the vector + + xyz + . + The current matrix (see + glMatrixMode) + is multiplied by a rotation matrix with the product replacing + the current matrix, as if + glMultMatrix + were called with the following matrix as its argument:

+ + ( + + + + x2 + (1-c) + +c + + + xy + (1-c) + -zs + + + xz + (1-c) + +ys + + 0 + + + + xy + (1-c) + +zs + + + y2 + (1-c) + +c + + + yz + (1-c) + -xs + + 0 + + + + xz + (1-c) + -ys + + + yz + (1-c) + +xs + + + z2 + (1-c) + +c + + 0 + + + 0 + 0 + 0 + 1 + + + ) + +

Where + + c=cosangle + , + + s=sinangle + , + and + + ||xyz|| + =1 + , + (if not, the GL will normalize this vector).

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.

Notes

This rotation follows the right-hand rule, so if the vector + + xyz + + points toward the user, the rotation will be counterclockwise.

Associated Gets

+ glGet with argument GL_MATRIX_MODE +

+ glGet with argument GL_MODELVIEW_MATRIX +

+ glGet with argument GL_PROJECTION_MATRIX +

+ glGet with argument GL_TEXTURE_MATRIX +

See Also

+ glMatrixMode, + glMultMatrix, + glPushMatrix, + glScale, + glTranslate +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glSampleCoverage.xml b/es1/glSampleCoverage.xml new file mode 100644 index 00000000..5bd95471 --- /dev/null +++ b/es1/glSampleCoverage.xml @@ -0,0 +1,73 @@ + + +glSampleCoverage

Name

glSampleCoverage — specify mask to modify multisampled pixel fragments

C Specification

void glSampleCoverage(GLclampf value,
 GLboolean invert);
 
void glSampleCoveragex(GLclampx value,
 GLboolean invert);
 

Parameters

+ 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. +

Description

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.

Associated Gets

+ 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 +

See Also

+ glEnable +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glScale.xml b/es1/glScale.xml new file mode 100644 index 00000000..9fb1e5a4 --- /dev/null +++ b/es1/glScale.xml @@ -0,0 +1,83 @@ + + +glScale

Name

glScale — multiply the current matrix by a general scaling + matrix

C Specification

void glScalef(GLfloat x,
 GLfloat y,
 GLfloat z);
 
void glScalex(GLfixed x,
 GLfixed y,
 GLfixed z);
 

Parameters

+ x, + y, + z +

Specify scale factors along the + x, + y, and + z axes, respectively.

Description

+ 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:

+ + ( + + + x + 0 + 0 + 0 + + + 0 + y + 0 + 0 + + + 0 + 0 + z + 0 + + + 0 + 0 + 0 + 1 + + + ) + +

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.

Notes

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.

Associated Gets

+ glGet with argument GL_MATRIX_MODE +

+ glGet with argument GL_MODELVIEW_MATRIX +

+ glGet with argument GL_PROJECTION_MATRIX +

+ glGet with argument GL_TEXTURE_MATRIX +

See Also

+ glEnable, + glMatrixMode, + glMultMatrix, + glPushMatrix, + glRotate, + glTranslate +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glScissor.xml b/es1/glScissor.xml new file mode 100644 index 00000000..c20202a0 --- /dev/null +++ b/es1/glScissor.xml @@ -0,0 +1,40 @@ + + +glScissor

Name

glScissor — define the scissor box

C Specification

void glScissor(GLint x,
 GLint y,
 GLsizei width,
 GLsizei height);
 

Parameters

+ 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.

Description

+ 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.

Errors

GL_INVALID_VALUE is generated if either + width or height + is negative.

See Also

+ glEnable, + glViewport +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glShadeModel.xml b/es1/glShadeModel.xml new file mode 100644 index 00000000..c2d1a6ea --- /dev/null +++ b/es1/glShadeModel.xml @@ -0,0 +1,95 @@ + + +glShadeModel

Name

glShadeModel — select flat or smooth shading

C Specification

void glShadeModel(GLenum mode);
 

Parameters

+ mode +

Specifies a symbolic value representing a shading + technique. Accepted values are GL_FLAT and + GL_SMOOTH. The initial value is + GL_SMOOTH.

Description

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 + i + the + computed color of vertex + + + + i + + + 1 + + , + its second vertex. + Counting similarly from 1, + the GL gives each flat-shaded polygon the computed color of the vertex listed + in the following table. + This is the last vertex to specify the polygon. +

+

+ Primitive Type of Polygon + i + + Vertex +
+ Triangle strip + + + + + i + + + 2 + + +
+ Triangle fan + + + + + i + + + 2 + + +
+ Independent triangle + + + + + 3 + + i + + +

Flat and smooth shading are specified by + glShadeModel with + mode set to + GL_FLAT and + GL_SMOOTH, respectively.

Errors

GL_INVALID_ENUM is generated if + mode is any value other than + GL_FLAT or GL_SMOOTH.

See Also

+ glColor, + glColorPointer, + glLight, + glLightModel, + glMaterial +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glStencilFunc.xml b/es1/glStencilFunc.xml new file mode 100644 index 00000000..ade3edf3 --- /dev/null +++ b/es1/glStencilFunc.xml @@ -0,0 +1,201 @@ + + +glStencilFunc

Name

glStencilFunc — set function and reference value for stencil + testing

C Specification

void glStencilFunc(GLenum func,
 GLint ref,
 GLuint mask);
 

Parameters

+ 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 + + [ + 0 + , + 2n-1 + ] + , + where 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.

Description

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 + + [ + 0 + , + 2n-1 + ] + , where 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 + + [ + 0 + , + 2n-1 + ] + , where 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 + + + 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.

Notes

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.

Errors

GL_INVALID_ENUM is generated if + func is not one of the eight accepted values.

Associated Gets

+ glGet + with argument GL_STENCIL_BITS +

See Also

+ glAlphaFunc, + glBlendFunc, + glDepthFunc, + glEnable, + glGet, + glLogicOp, + glStencilOp +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glStencilMask.xml b/es1/glStencilMask.xml new file mode 100644 index 00000000..7808cea6 --- /dev/null +++ b/es1/glStencilMask.xml @@ -0,0 +1,34 @@ + + + +glStencilMask

Name

glStencilMask — control the writing of individual bits in the + stencil planes

C Specification

void glStencilMask(GLuint mask);
 

Parameters

+ mask +

Specifies a bit mask to enable and disable writing + of individual bits in the stencil planes. The initial value + is all 1's.

Description

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.

Associated Gets

+ glGet + with argument GL_STENCIL_WRITEMASK or + GL_STENCIL_BITS +

See Also

+ glClear, + glColorMask, + glDepthMask, + glGet, + glStencilFunc, + glStencilOp +

Copyright

+ 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/. +

diff --git a/es1/glStencilOp.xml b/es1/glStencilOp.xml new file mode 100644 index 00000000..72e81512 --- /dev/null +++ b/es1/glStencilOp.xml @@ -0,0 +1,105 @@ + + +glStencilOp

Name

glStencilOp — set stencil test actions

C Specification

void glStencilOp(GLenum fail,
 GLenum zfail,
 GLenum zpass);
 

Parameters

+ 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.

Description

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 + + 2n-1 + , + where 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.

Notes

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.

Errors

GL_INVALID_ENUM is generated if + fail, + zfail, or + zpass + is any value other than the six defined constant values.

Associated Gets

+ glGet + with argument GL_STENCIL_BITS +

See Also

+ glAlphaFunc, + glBlendFunc, + glDepthFunc, + glEnable, + glGet, + glLogicOp, + glStencilFunc +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glTexCoordPointer.xml b/es1/glTexCoordPointer.xml new file mode 100644 index 00000000..c0dcbaca --- /dev/null +++ b/es1/glTexCoordPointer.xml @@ -0,0 +1,85 @@ + + +glTexCoordPointer

Name

glTexCoordPointer — define an array of texture coordinates

C Specification

void glTexCoordPointer(GLint size,
 GLenum type,
 GLsizei stride,
 const GLvoid * pointer);
 

Parameters

+ 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.

Description

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.

Notes

+ 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.

Errors

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.

See Also

+ glClientActiveTexture, + glColorPointer, + glDrawArrays, + glDrawElements, + glEnable, + glMultiTexCoord, + glNormalPointer, + glVertexPointer +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glTexEnv.xml b/es1/glTexEnv.xml new file mode 100644 index 00000000..b4fb1119 --- /dev/null +++ b/es1/glTexEnv.xml @@ -0,0 +1,1846 @@ + + + +glTexEnv

Name

glTexEnv — set texture environment parameters

C Specification

void glTexEnvf(GLenum target,
 GLenum pname,
 GLfloat param);
 
void glTexEnvi(GLenum target,
 GLenum pname,
 GLint param);
 
void glTexEnvx(GLenum target,
 GLenum pname,
 GLfixed param);
 

Parameters

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. +

C Specification

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);
 

Parameters

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. +

Description

+ 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 + R + t, + G + t, + B + t, + A + t, + L + t + to texture source components. + C + s + and + A + s + are used by the texture functions described below. +

+

+ Texture Base Internal Format + + C + s + + A + s +
+ GL_ALPHA + + (0, 0, 0) + + A + t +
+ GL_LUMINANCE + + ( + L + t, + L + t, + L + t + ) + + 1 +
+ GL_LUMINANCE_ALPHA + + ( + L + t, + L + t, + L + t + ) + + A + t +
+ GL_RGB + + ( + R + t, + G + t, + B + t + ) + + 1 +
+ GL_RGBA + + ( + R + t, + G + t, + B + t + ) + + A + t +

+ 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. + C + is a triple of color values (RGB) and + A + is the associated alpha value. + RGBA values extracted from a texture image are in the range [0,1]. + The subscript + p + refers to the color computed from the previous texture stage (or the incoming fragment if processing texture stage 0), + the subscript + s + to the texture source color, + the subscript + c + to the texture environment color, + and the subscript + v + indicates a value produced by the texture function. +

+

+ Texture Base Internal Format + + Value + + GL_REPLACE Function + + GL_MODULATE Function + + GL_DECAL Function + + GL_BLEND Function + + GL_ADD Function +
+ GL_ALPHA + + + + + C + v + + = + + + + + + + C + p + + + + + + + + C + p + + + + + undefined + + + + + C + p + + + + + + + + C + p + + + +
+ + + + + A + v + + = + + + + + + + A + s + + + + + + + + + A + p + + + A + s + + + + + + + + + + A + v + + = + + A + p + + + A + s + + + + + + + + + + A + p + + + A + s + + + + +
+ GL_LUMINANCE + + + + + C + v + + = + + + + + + + C + s + + + + + + + + + C + p + + + C + s + + + + + + undefined + + + + + + C + p + + + + + 1 + - + C + s + + + + + + C + c + + + C + s + + + + + + + + + + C + p + + + + C + s + + + + +
+ (or 1) + + + + + A + v + + = + + + + + + + A + p + + + + + + + + A + p + + + + + + + + + A + p + + + + + + + + A + p + + + +
+ GL_LUMINANCE_ALPHA + + + + + C + v + + = + + + + + + + C + s + + + + + + + + + C + p + + + C + s + + + + + + undefined + + + + + + C + p + + + + + 1 + - + C + s + + + + + + C + c + + + C + s + + + + + + + + + + C + p + + + + C + s + + + + +
+ (or 2) + + + + + A + v + + = + + + + + + + A + s + + + + + + + + + A + p + + + A + s + + + + + + + + + + + A + p + + + A + s + + + + + + + + + + A + p + + + A + s + + + + +
+ GL_RGB + + + + + C + v + + = + + + + + + + C + s + + + + + + + + + C + p + + + C + s + + + + + + + + + C + s + + + + + + + + + C + p + + + + + 1 + - + C + s + + + + + + C + c + + + C + s + + + + + + + + + + C + p + + + + C + s + + + + +
+ (or 3) + + + + + A + v + + = + + + + + + + A + p + + + + + + + + A + p + + + + + + + + A + p + + + + + + + + A + p + + + + + + + + A + p + + + +
+ GL_RGBA + + + + + C + v + + = + + + + + + + C + s + + + + + + + + + C + p + + + C + s + + + + + + + + + + C + p + + + + + 1 + - + A + s + + + + + + C + s + + + A + s + + + + + + + + + + C + p + + + + + 1 + - + C + s + + + + + + C + c + + + C + s + + + + + + + + + + C + p + + + + C + s + + + + +
+ (or 4) + + + + + A + v + + = + + + + + + + A + s + + + + + + + + + A + p + + + A + s + + + + + + + + + A + p + + + + + + + + + A + p + + + A + s + + + + + + + + + + A + p + + + A + s + + + + +

+ 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 + Arg0, + GL_SRC1_c is + represented by + Arg1, + and GL_SRC2_c is represented by + Arg2. +

+ 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 + + Arg0 +
+ GL_MODULATE + + + + + Arg0 + × + Arg1 + + +
+ GL_ADD + + + + + Arg0 + + + Arg1 + + +
+ GL_ADD_SIGNED + + + + + Arg0 + + + Arg1 + - + 0.5 + + +
+ GL_INTERPOLATE + + + + + + Arg0 + × + Arg2 + + + + + Arg1 + × + + + 1 + - + Arg2 + + + + + +
+ GL_SUBTRACT + + + + + Arg0 + - + Arg1 + + +
+ GL_DOT3_RGB + or + GL_DOT3_RGBA + + + + + 4 + × + + + + + + + + Arg0 + r + + + - + 0.5 + + + × + + + + Arg1 + r + + + - + 0.5 + + + + + + + + + + + + Arg0 + g + + + - + 0.5 + + + × + + + + Arg1 + g + + + - + 0.5 + + + + + + + + + + + + Arg0 + b + + + - + 0.5 + + + × + + + + Arg1 + b + + + - + 0.5 + + + + + + + + +

+ 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 + + Arg0 +
+ GL_MODULATE + + + + + Arg0 + × + Arg1 + + +
+ GL_ADD + + + + + Arg0 + + + Arg1 + + +
+ GL_ADD_SIGNED + + + + + Arg0 + + + Arg1 + - + 0.5 + + +
+ GL_INTERPOLATE + + + + + + Arg0 + × + Arg2 + + + + + Arg1 + × + + + 1 + - + Arg2 + + + + + +
+ GL_SUBTRACT + + + + + Arg0 + - + Arg1 + + +

+ In the following tables, the value + + + C + s + + + represents the color sampled + from the currently bound texture, + + + C + c + + + represents the constant + texture-environment color, + + + C + f + + + represents the primary color of the + incoming fragment, and + + + C + p + + + represents the color computed from the + previous texture stage or + + + C + f + + + if processing texture stage 0. Likewise, + + + A + s + + , + + + A + c + + , + + + A + f + + , + and + + + A + p + + + represent the respective + alpha values. +

+ The following table describes the values assigned to + Arg0, + Arg1, + and + Arg2 + based upon the RGB sources and operands: +

+

+ GL_SRCn_RGB + + GL_OPERANDn_RGB + + Argument Value +
+ GL_TEXTURE + + GL_SRC_COLOR + + + + + C + s + + + +
+ + GL_ONE_MINUS_SRC_COLOR + + + + + 1 + - + + C + s + + + + +
+ + GL_SRC_ALPHA + + + + + A + s + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + s + + + + +
+ GL_TEXTUREn + + GL_SRC_COLOR + + + + + C + s + + + +
+ + GL_ONE_MINUS_SRC_COLOR + + + + + 1 + - + + C + s + + + + +
+ + GL_SRC_ALPHA + + + + + A + s + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + s + + + + +
+ GL_CONSTANT + + GL_SRC_COLOR + + + + + C + c + + + +
+ + GL_ONE_MINUS_SRC_COLOR + + + + + 1 + - + + C + c + + + + +
+ + GL_SRC_ALPHA + + + + + A + c + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + c + + + + +
+ GL_PRIMARY_COLOR + + GL_SRC_COLOR + + + + + C + f + + + +
+ + GL_ONE_MINUS_SRC_COLOR + + + + + 1 + - + + C + f + + + + +
+ + GL_SRC_ALPHA + + + + + A + f + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + f + + + + +
+ GL_PREVIOUS + + GL_SRC_COLOR + + + + + C + p + + + +
+ + GL_ONE_MINUS_SRC_COLOR + + + + + 1 + - + + C + p + + + + +
+ + GL_SRC_ALPHA + + + + + A + p + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + p + + + + +

+ For GL_TEXTUREn sources, + + + C + s + + + and + + + A + s + + + represent the color + and alpha, respectively, produced from texture stage + n. +

+ The follow table describes the values assigned to + Arg0, + Arg1, + and + Arg2 + based upon the alpha sources and operands: +

+

+ GL_SRCn_ALPHA + + GL_OPERANDn_ALPHA + + Argument Value +
+ GL_TEXTURE + + GL_SRC_ALPHA + + + + + A + s + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + s + + + + +
+ GL_TEXTUREn + + GL_SRC_ALPHA + + + + + A + s + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + s + + + + +
+ GL_CONSTANT + + GL_SRC_ALPHA + + + + + A + c + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + c + + + + +
+ GL_PRIMARY_COLOR + + GL_SRC_ALPHA + + + + + A + f + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + f + + + + +
+ GL_PREVIOUS + + GL_SRC_ALPHA + + + + + A + p + + + +
+ + GL_ONE_MINUS_SRC_ALPHA + + + + + 1 + - + + A + p + + + + +

+ 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 + + + + 0 + 1 + + . +

+ 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. + + + C + c + + + takes these four values. +

+ 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. +

Notes

+ 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. +

Errors

+ 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. +

Associated Gets

+ glGetTexEnv +

See Also

+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glTexImage2D, + glTexParameter, + glTexSubImage2D +

Copyright

+ 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/. +

diff --git a/es1/glTexImage2D.xml b/es1/glTexImage2D.xml new file mode 100644 index 00000000..2e020cd4 --- /dev/null +++ b/es1/glTexImage2D.xml @@ -0,0 +1,185 @@ + + + +glTexImage2D

Name

glTexImage2D — specify a two-dimensional texture image

C Specification

void glTexImage2D(GLenum target,
 GLint level,
 GLint internalformat,
 GLsizei width,
 GLsizei height,
 GLint border,
 GLenum format,
 GLenum type,
 const GLvoid * pixels);
 

Parameters

+ 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 + nth 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 + + 2n + + for some integer n. + All implementations support texture images that are at + least 64 texels wide.

+ height +

Specifies the height of the texture image. Must be + + 2m + + for some integer 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.

Description

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.

Notes

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. +

Errors

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 + + log2max + , where + 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 + + 2k + + for some integer 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.

Associated Gets

+ glGet + with argument GL_MAX_TEXTURE_SIZE

See Also

+ glActiveTexture, + glBindTexture, + glCopyTexImage2D, + glCopyTexSubImage2D, + glGet, + glMatrixMode, + glPixelStorei, + glTexEnv, + glTexSubImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es1/glTexParameter.xml b/es1/glTexParameter.xml new file mode 100644 index 00000000..df77c6d6 --- /dev/null +++ b/es1/glTexParameter.xml @@ -0,0 +1,373 @@ + + + +glTexParameter

Name

glTexParameter — set texture parameters

C Specification

void glTexParameterf(GLenum target,
 GLenum pname,
 GLfloat param);
 
void glTexParameteri(GLenum target,
 GLenum pname,
 GLint param);
 
void glTexParameterx(GLenum target,
 GLenum pname,
 GLfixed param);
 

Parameters

+ 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.

C Specification

void glTexParameterfv(GLenum target,
 GLenum pname,
 GLfloat * params);
 
void glTexParameteriv(GLenum target,
 GLenum pname,
 GLint * params);
 
void glTexParameterxv(GLenum target,
 GLenum pname,
 GLfixed * params);
 

Parameters

+ 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.

Description

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 + + s + + t + + coordinate system. A texture is a one- or + two-dimensional image and a set of parameters that determine how samples + are derived from the image.

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 + + 2 + + n + + + x + + + 2 + + m + + , there are + max + + + n + + m + + + + + + 1 + mipmaps. The first mipmap is the original + texture, with dimensions + + 2 + + n + + + x + + + 2 + + m + + . Each subsequent mipmap has dimensions + + + 2 + + + k + + - + + 1 + + + + x + + + 2 + + + l + + - + + 1 + + + , where + + 2 + + k + + + x + + + 2 + + l + + are the dimensions of the previous mipmap, until + either + k + + = + + 0 + or + l + + = + + 0 + . At that point, subsequent mipmaps have + dimension + 1 + + x + + + 2 + + + l + + - + + 1 + + + or + + 2 + + + k + + - + + 1 + + + + x + + 1 + until the final mipmap, which has dimension + + 1 + + x + + 1 + . To define the mipmaps, call glTexImage2D or glCopyTexImage2D with the level argument + indicating the order of the mipmaps. Level 0 is the original + texture. Level + max + + + n + + m + + is the final + 1 + + x + + 1 + mipmap.

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 + [ + + + 1 + + + 2 + + N + + + + , + + 1 + + - + + + 1 + + + 2 + + N + + + + ] + , where 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 + + level + + base + + array of a mipmap will also compute a complete + set of mipmap arrays derived from the modified + + level + + base + + array. Array levels + level + + base + +1 through + p are replaced with the derived arrays, regardless + of their previous contents. All other mipmap arrays, including the + + + level + + base + + array, are left unchanged by this + computation.

The initial value of GL_GENERATE_MIPMAP + is GL_FALSE.

Notes

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.

Errors

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.

See Also

glActiveTexture, glBindTexture, glCopyTexImage2D, glCopyTexSubImage2D, glEnable, glPixelStorei, glTexEnv, glTexImage2D, glTexSubImage2D

Copyright

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/.

diff --git a/es1/glTexSubImage2D.xml b/es1/glTexSubImage2D.xml new file mode 100644 index 00000000..84e48e88 --- /dev/null +++ b/es1/glTexSubImage2D.xml @@ -0,0 +1,133 @@ + + + +glTexSubImage2D

Name

glTexSubImage2D — specify a two-dimensional texture subimage

C Specification

void glTexSubImage2D(GLenum target,
 GLint level,
 GLint xoffset,
 GLint yoffset,
 GLsizei width,
 GLsizei height,
 GLenum format,
 GLenum type,
 const GLvoid * pixels);
 

Parameters

+ 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 + 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 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.

Description

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 + + xoffset+width-1 + , + inclusive, and y indices yoffset and + + yoffset+height-1 + , + inclusive. This region may not include any texels outside the + range of 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.

Notes

+ 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. +

Errors

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 + + log2max + , where + max is the returned value of + GL_MAX_TEXTURE_SIZE.

GL_INVALID_VALUE is generated if + + xoffset<0 + , + + xoffset+width> + w + , + + yoffset<0 + , or + + yoffset+height> + h + , where + 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.

Associated Gets

+ glGet + with argument GL_MAX_TEXTURE_SIZE

See Also

+ glActiveTexture, + glBindTexture, + glCompressedTexSubImage2D, + glCopyTexSubImage2D, + glGet, + glPixelStorei, + glTexEnv, + glTexImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es1/glTranslate.xml b/es1/glTranslate.xml new file mode 100644 index 00000000..8233e239 --- /dev/null +++ b/es1/glTranslate.xml @@ -0,0 +1,75 @@ + + +glTranslate

Name

glTranslate — multiply the current matrix by a translation matrix

C Specification

void glTranslatef(GLfloat x,
 GLfloat y,
 GLfloat z);
 
void glTranslatex(GLfixed x,
 GLfixed y,
 GLfixed z);
 

Parameters

+ x, + y, + z +

Specify the + x, y, and + z coordinates of a translation vector.

Description

glTranslate produces a translation by + + xyz + . + The current matrix (see + glMatrixMode) + is multiplied by this translation matrix, with the product + replacing the current matrix, as if + glMultMatrix + were called with the following matrix for its argument:

+ + ( + + + 1 + 0 + 0 + x + + + 0 + 1 + 0 + y + + + 0 + 0 + 1 + z + + + 0 + 0 + 0 + 1 + + + ) + +

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.

Associated Gets

+ glGet with argument GL_MATRIX_MODE +

+ glGet with argument GL_MODELVIEW_MATRIX +

+ glGet with argument GL_PROJECTION_MATRIX +

+ glGet with argument GL_TEXTURE_MATRIX +

See Also

+ glMatrixMode, + glMultMatrix, + glPushMatrix, + glRotate, + glScale +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glVertexPointer.xml b/es1/glVertexPointer.xml new file mode 100644 index 00000000..0301dc65 --- /dev/null +++ b/es1/glVertexPointer.xml @@ -0,0 +1,79 @@ + + +glVertexPointer

Name

glVertexPointer — define an array of vertex coordinates

C Specification

void glVertexPointer(GLint size,
 GLenum type,
 GLsizei stride,
 const GLvoid * pointer);
 

Parameters

+ 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.

Description

+ 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.

Notes

+ glVertexPointer + is typically implemented on the client side.

Errors

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.

See Also

+ glColorPointer, + glDrawArrays, + glDrawElements, + glEnable, + glNormalPointer, + glTexCoordPointer +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es1/glViewport.xml b/es1/glViewport.xml new file mode 100644 index 00000000..a044c5fb --- /dev/null +++ b/es1/glViewport.xml @@ -0,0 +1,82 @@ + + +glViewport

Name

glViewport — set the viewport

C Specification

void glViewport(GLint x,
 GLint y,
 GLsizei width,
 GLsizei height);
 

Parameters

+ 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.

Description

+ glViewport + + specifies the affine transformation of + x and + y + from normalized device coordinates to window coordinates. Let + + xnd + ynd + + be normalized device coordinates. Then the window coordinates + + xw + yw + + are computed as follows:

+ + xw + + = + + ( + xnd + + + 1 + ) + + width + 2 + + + + x + + + yw + + = + + ( + ynd + + + 1 + ) + + height + 2 + + + + y + +

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.

Errors

GL_INVALID_VALUE is generated if either + width or + height is negative.

Associated Gets

+ glGet + with argument GL_MAX_VIEWPORT_DIMS +

See Also

+ glDepthRange, + glGet +

Copyright

+ 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/. +

\ No newline at end of file diff --git a/es2/glActiveTexture.xml b/es2/glActiveTexture.xml new file mode 100644 index 00000000..d8115b95 --- /dev/null +++ b/es2/glActiveTexture.xml @@ -0,0 +1,30 @@ + + + + +glActiveTexture

Name

glActiveTexture — select active texture unit

C Specification

void glActiveTexture(GLenum texture);
 

Parameters

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_TEXTUREi, + where + i ranges from 0 to (GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1). + The initial value is GL_TEXTURE0. +

Description

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if texture is not one of + GL_TEXTUREi, + where i ranges from 0 to (GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1). +

Associated Gets

+ glGet with argument GL_ACTIVE_TEXTURE or GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS +

See Also

+ glTexParameter +

Copyright

+ 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/. +

diff --git a/es2/glAttachShader.xml b/es2/glAttachShader.xml new file mode 100644 index 00000000..54308cd6 --- /dev/null +++ b/es2/glAttachShader.xml @@ -0,0 +1,46 @@ + + + + +glAttachShader

Name

glAttachShader — attach a shader object to a program object

C Specification

void glAttachShader(GLuint program,
 GLuint shader);
 

Parameters

program

Specifies the program object to which a shader + object will be attached.

shader

Specifies the shader object that is to be attached.

Description

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.

Errors

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.

Associated Gets

glGetAttachedShaders + with the handle of a valid program object

glIsProgram

glIsShader

See Also

glCompileShader, + glDetachShader, + glLinkProgram, + glShaderSource, + glShaderBinary

Copyright

+ 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/. +

diff --git a/es2/glBindAttribLocation.xml b/es2/glBindAttribLocation.xml new file mode 100644 index 00000000..367021ad --- /dev/null +++ b/es2/glBindAttribLocation.xml @@ -0,0 +1,102 @@ + + + + +glBindAttribLocation

Name

glBindAttribLocation — associate a generic vertex attribute index with a named attribute variable

C Specification

void glBindAttribLocation(GLuint program,
 GLuint index,
 const GLchar *name);
 

Parameters

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.

Description

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.

Notes

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.

Errors

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.

Associated Gets

glGet + with argument GL_MAX_VERTEX_ATTRIBS

glGetActiveAttrib + with argument program

glGetAttribLocation + with arguments program and + name

glIsProgram

See Also

glDisableVertexAttribArray, + glEnableVertexAttribArray, + glUseProgram, + glVertexAttrib, + glVertexAttribPointer

Copyright

+ 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/. +

diff --git a/es2/glBindBuffer.xml b/es2/glBindBuffer.xml new file mode 100644 index 00000000..66beb79b --- /dev/null +++ b/es2/glBindBuffer.xml @@ -0,0 +1,76 @@ + + + + +glBindBuffer

Name

glBindBuffer — bind a named buffer object

C Specification

void glBindBuffer(GLenum target,
 GLuint buffer);
 

Parameters

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. +

Description

+ 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_BINDINGs. 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. +

Errors

+ GL_INVALID_ENUM is generated if target is not one of the allowable + values. +

Associated Gets

+ glGet with argument GL_ARRAY_BUFFER_BINDING +

+ glGet with argument GL_ELEMENT_ARRAY_BUFFER_BINDING +

See Also

+ glDeleteBuffers, + glGenBuffers, + glGet, + glIsBuffer +

Copyright

+ 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/. +

diff --git a/es2/glBindFramebuffer.xml b/es2/glBindFramebuffer.xml new file mode 100644 index 00000000..6d0c281f --- /dev/null +++ b/es2/glBindFramebuffer.xml @@ -0,0 +1,96 @@ + + + + +glBindFramebuffer

Name

glBindFramebuffer — bind a named framebuffer object

C Specification

void glBindFramebuffer(GLenum target,
 GLuint framebuffer);
 

Parameters

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. +

Description

+ 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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER. +

Associated Gets

+ glGet with argument GL_FRAMEBUFFER_BINDING +

See Also

+ glDeleteFramebuffers, + glFramebufferRenderbuffer, + glFramebufferTexture2D, + glGenFramebuffers, + glGet, + glGetFramebufferAttachmentParameteriv, + glIsFramebuffer +

Copyright

+ 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/. +

diff --git a/es2/glBindRenderbuffer.xml b/es2/glBindRenderbuffer.xml new file mode 100644 index 00000000..8d7593cf --- /dev/null +++ b/es2/glBindRenderbuffer.xml @@ -0,0 +1,63 @@ + + + + +glBindRenderbuffer

Name

glBindRenderbuffer — bind a named renderbuffer object

C Specification

void glBindRenderbuffer(GLenum target,
 GLuint renderbuffer);
 

Parameters

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. +

Description

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER. +

Associated Gets

+ glGet with argument GL_RENDERBUFFER_BINDING +

See Also

+ glDeleteRenderbuffers, + glFramebufferRenderbuffer, + glGenRenderbuffers, + glGet, + glGetRenderbufferParameteriv, + glIsRenderbuffer, + glRenderbufferStorage +

Copyright

+ 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/. +

diff --git a/es2/glBindTexture.xml b/es2/glBindTexture.xml new file mode 100644 index 00000000..fdbfcd1d --- /dev/null +++ b/es2/glBindTexture.xml @@ -0,0 +1,71 @@ + + + + +glBindTexture

Name

glBindTexture — bind a named texture to a texturing target

C Specification

void glBindTexture(GLenum target,
 GLuint texture);
 

Parameters

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. +

Description

+ 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. +

Errors

+ 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. +

Associated Gets

+ glGet with argument GL_TEXTURE_BINDING_2D or GL_TEXTURE_BINDING_CUBE_MAP +

See Also

+ glDeleteTextures, + glGenTextures, + glGet, + glGetTexParameter, + glIsTexture, + glTexImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es2/glBlendColor.xml b/es2/glBlendColor.xml new file mode 100644 index 00000000..e3fb8723 --- /dev/null +++ b/es2/glBlendColor.xml @@ -0,0 +1,31 @@ + + + + +glBlendColor

Name

glBlendColor — set the blend color

C Specification

void glBlendColor(GLclampf red,
 GLclampf green,
 GLclampf blue,
 GLclampf alpha);
 

Parameters

red, green, blue, alpha

+ specify the components of GL_BLEND_COLOR +

Description

+ The GL_BLEND_COLOR may be used to calculate the source and destination + blending factors. The color components are clamped to the range + + + + 0 + 1 + + + before being stored. See glBlendFunc for a complete description of the + blending operations. + Initially the GL_BLEND_COLOR is set to (0, 0, 0, 0). +

Associated Gets

+ glGet with an argument of GL_BLEND_COLOR +

See Also

+ glBlendEquation, + glBlendFunc, + glGetString +

Copyright

+ 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/. +

diff --git a/es2/glBlendEquation.xml b/es2/glBlendEquation.xml new file mode 100644 index 00000000..e1667616 --- /dev/null +++ b/es2/glBlendEquation.xml @@ -0,0 +1,464 @@ + + + + +glBlendEquation

Name

glBlendEquation — specify the equation used for both the RGB blend equation and the Alpha blend equation

C Specification

void glBlendEquation(GLenum mode);
 

Parameters

mode

+ specifies how source and destination colors are combined. + It must be GL_FUNC_ADD, GL_FUNC_SUBTRACT, or + GL_FUNC_REVERSE_SUBTRACT. +

Description

+ 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 + + + + R + s + + G + s + + B + s + + A + s + + + + and + + + + R + d + + G + d + + B + d + + A + d + + + , + respectively. + The result color is referred to as + + + + R + r + + G + r + + B + r + + A + r + + + . + The source and destination blend factors are denoted + + + + s + R + + s + G + + s + B + + s + A + + + + and + + + + d + R + + d + G + + d + B + + d + A + + + , + respectively. + For these equations all color components are understood to have values + in the range + + + + 0 + 1 + + . + +

+ Mode + + RGB Components + + Alpha Component +
+ GL_FUNC_ADD + +
+ + + Rr + = + + R + s + + + s + R + + + + R + d + + + d + R + + + +
+
+ + + Gr + = + + G + s + + + s + G + + + + G + d + + + d + G + + + +
+
+ + + Br + = + + B + s + + + s + B + + + + B + d + + + d + B + + + +
+
+
+ + + Ar + = + + A + s + + + s + A + + + + A + d + + + d + A + + + +
+
+ GL_FUNC_SUBTRACT + +
+ + + Rr + = + + R + s + + + s + R + + - + R + d + + + d + R + + + +
+
+ + + Gr + = + + G + s + + + s + G + + - + G + d + + + d + G + + + +
+
+ + + Br + = + + B + s + + + s + B + + - + B + d + + + d + B + + + +
+
+
+ + + Ar + = + + A + s + + + s + A + + - + A + d + + + d + A + + + +
+
+ GL_FUNC_REVERSE_SUBTRACT + +
+ + + Rr + = + + R + d + + + d + R + + - + R + s + + + s + R + + + +
+
+ + + Gr + = + + G + d + + + d + G + + - + G + s + + + s + G + + + +
+
+ + + Br + = + + B + d + + + d + B + + - + B + s + + + s + B + + + +
+
+
+ + + Ar + = + + A + d + + + d + A + + - + A + s + + + s + A + + + +
+

+

+ The results of these equations are clamped to the range + + + + 0 + 1 + + . +

+ 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. +

+

Errors

+ GL_INVALID_ENUM is generated if mode is not one of + GL_FUNC_ADD, GL_FUNC_SUBTRACT, or GL_FUNC_REVERSE_SUBTRACT. +

Associated Gets

+ glGet with an argument of GL_BLEND_EQUATION_RGB +

+ glGet with an argument of GL_BLEND_EQUATION_ALPHA +

See Also

+ glGetString, + glBlendColor, + glBlendEquationSeparate, + glBlendFunc + glBlendFuncSeparate +

Copyright

+ 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/. +

diff --git a/es2/glBlendEquationSeparate.xml b/es2/glBlendEquationSeparate.xml new file mode 100644 index 00000000..d5081c16 --- /dev/null +++ b/es2/glBlendEquationSeparate.xml @@ -0,0 +1,468 @@ + + + + +glBlendEquationSeparate

Name

glBlendEquationSeparate — set the RGB blend equation and the alpha blend equation separately

C Specification

void glBlendEquationSeparate(GLenum modeRGB,
 GLenum modeAlpha);
 

Parameters

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. +

Description

+ 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 + + + + R + s + + G + s + + B + s + + A + s + + + + and + + + + R + d + + G + d + + B + d + + A + d + + + , + respectively. + The result color is referred to as + + + + R + r + + G + r + + B + r + + A + r + + + . + The source and destination blend factors are denoted + + + + s + R + + s + G + + s + B + + s + A + + + + and + + + + d + R + + d + G + + d + B + + d + A + + + , + respectively. + For these equations all color components are understood to have values + in the range + + + + 0 + 1 + + . + +

+ Mode + + RGB Components + + Alpha Component +
+ GL_FUNC_ADD + +
+ + + Rr + = + + R + s + + + s + R + + + + R + d + + + d + R + + + +
+
+ + + Gr + = + + G + s + + + s + G + + + + G + d + + + d + G + + + +
+
+ + + Br + = + + B + s + + + s + B + + + + B + d + + + d + B + + + +
+
+
+ + + Ar + = + + A + s + + + s + A + + + + A + d + + + d + A + + + +
+
+ GL_FUNC_SUBTRACT + +
+ + + Rr + = + + R + s + + + s + R + + - + R + d + + + d + R + + + +
+
+ + + Gr + = + + G + s + + + s + G + + - + G + d + + + d + G + + + +
+
+ + + Br + = + + B + s + + + s + B + + - + B + d + + + d + B + + + +
+
+
+ + + Ar + = + + A + s + + + s + A + + - + A + d + + + d + A + + + +
+
+ GL_FUNC_REVERSE_SUBTRACT + +
+ + + Rr + = + + R + d + + + d + R + + - + R + s + + + s + R + + + +
+
+ + + Gr + = + + G + d + + + d + G + + - + G + s + + + s + G + + + +
+
+ + + Br + = + + B + d + + + d + B + + - + B + s + + + s + B + + + +
+
+
+ + + Ar + = + + A + d + + + d + A + + - + A + s + + + s + A + + + +
+

+

+ The results of these equations are clamped to the range + + + + 0 + 1 + + . +

+ 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. +

+

Errors

+ 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. +

Associated Gets

+ glGet with an argument of GL_BLEND_EQUATION_RGB +

+ glGet with an argument of GL_BLEND_EQUATION_ALPHA +

See Also

+ glGetString, + glBlendColor, + glBlendEquation, + glBlendFunc, + glBlendFuncSeparate +

Copyright

+ 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/. +

diff --git a/es2/glBlendFunc.xml b/es2/glBlendFunc.xml new file mode 100644 index 00000000..afbef0be --- /dev/null +++ b/es2/glBlendFunc.xml @@ -0,0 +1,844 @@ + + + + +glBlendFunc

Name

glBlendFunc — specify pixel arithmetic

C Specification

void glBlendFunc(GLenum sfactor,
 GLenum dfactor);
 

Parameters

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. +

Description

+ 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 + + + + R + s + + G + s + + B + s + + A + s + + + + and + + + + R + d + + G + d + + B + d + + A + d + + + . + The color specified by glBlendColor is referred to as + + + + R + c + + G + c + + B + c + + A + c + + + . + They are understood to have integer values between 0 and + + + + k + R + + k + G + + k + B + + k + A + + + , + where +

+

+ + + + k + c + + = + + 2 + + m + c + + + + - + 1 + + + +

+

+ and + + + + m + R + + m + G + + m + B + + m + A + + + + is the number of red, + green, + blue, + and alpha bitplanes. +

+ Source and destination scale factors are referred to as + + + + s + R + + s + G + + s + B + + s + A + + + + and + + + + d + R + + d + G + + d + B + + d + A + + + . + The scale factors described in the table, + denoted + + + + f + R + + f + G + + f + B + + f + A + + + , + represent either source or destination factors. + All scale factors have range + + + + 0 + 1 + + . +

+

+ Parameter + + + + + f + R + + f + G + + f + B + + f + A + + + +
+ GL_ZERO + + + + + 0 + 0 + 0 + 0 + + +
+ GL_ONE + + + + + 1 + 1 + 1 + 1 + + +
+ GL_SRC_COLOR + + + + + + R + s + + k + R + + + + G + s + + k + G + + + + B + s + + k + B + + + + A + s + + k + A + + + + +
+ GL_ONE_MINUS_SRC_COLOR + + + + + + 1 + 1 + 1 + 1 + + - + + + R + s + + k + R + + + + G + s + + k + G + + + + B + s + + k + B + + + + A + s + + k + A + + + + + +
+ GL_DST_COLOR + + + + + + R + d + + k + R + + + + G + d + + k + G + + + + B + d + + k + B + + + + A + d + + k + A + + + + +
+ GL_ONE_MINUS_DST_COLOR + + + + + + 1 + 1 + 1 + 1 + + - + + + R + d + + k + R + + + + G + d + + k + G + + + + B + d + + k + B + + + + A + d + + k + A + + + + + +
+ GL_SRC_ALPHA + + + + + + A + s + + k + A + + + + A + s + + k + A + + + + A + s + + k + A + + + + A + s + + k + A + + + + +
+ GL_ONE_MINUS_SRC_ALPHA + + + + + + 1 + 1 + 1 + 1 + + - + + + A + s + + k + A + + + + A + s + + k + A + + + + A + s + + k + A + + + + A + s + + k + A + + + + + +
+ GL_DST_ALPHA + + + + + + A + d + + k + A + + + + A + d + + k + A + + + + A + d + + k + A + + + + A + d + + k + A + + + + +
+ GL_ONE_MINUS_DST_ALPHA + + + + + + 1 + 1 + 1 + 1 + + - + + + A + d + + k + A + + + + A + d + + k + A + + + + A + d + + k + A + + + + A + d + + k + A + + + + + +
+ GL_CONSTANT_COLOR + + + + + R + c + + G + c + + B + c + + A + c + + + +
+ GL_ONE_MINUS_CONSTANT_COLOR + + + + + + 1 + 1 + 1 + 1 + + - + + R + c + + G + c + + B + c + + A + c + + + + +
+ GL_CONSTANT_ALPHA + + + + + A + c + + A + c + + A + c + + A + c + + + +
+ GL_ONE_MINUS_CONSTANT_ALPHA + + + + + + 1 + 1 + 1 + 1 + + - + + A + c + + A + c + + A + c + + A + c + + + + +
+ GL_SRC_ALPHA_SATURATE + + + + + i + i + i + 1 + + +

+ In the table, +

+

+ + + + i + = + + + min + + + A + s + + + k + A + + - + A + d + + + + + k + A + + + + +

+

+ 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. +

Notes

+ Incoming (source) alpha is correctly thought of as a material opacity, + ranging from 1.0 + ( + + K + A + + ), + representing complete opacity, + to 0.0 (0), representing complete + transparency. +

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if either sfactor or dfactor is not an + accepted value. +

Associated Gets

+ 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 +

+

See Also

+ glBlendColor, + glBlendEquation, + glBlendEquationSeparate, + glBlendFuncSeparate, + glClear, + glEnable, + glStencilFunc +

Copyright

+ 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/. +

diff --git a/es2/glBlendFuncSeparate.xml b/es2/glBlendFuncSeparate.xml new file mode 100644 index 00000000..8dd427ae --- /dev/null +++ b/es2/glBlendFuncSeparate.xml @@ -0,0 +1,893 @@ + + + + +glBlendFuncSeparate

Name

glBlendFuncSeparate — specify pixel arithmetic for RGB and alpha components separately

C Specification

void glBlendFuncSeparate(GLenum srcRGB,
 GLenum dstRGB,
 GLenum srcAlpha,
 GLenum dstAlpha);
 

Parameters

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. +

Description

+ 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 + + + + R + s + + G + s + + B + s + + A + s + + + + and + + + + R + d + + G + d + + B + d + + A + d + + + . + The color specified by glBlendColor is referred to as + + + + R + c + + G + c + + B + c + + A + c + + + . + They are understood to have integer values between 0 and + + + + k + R + + k + G + + k + B + + k + A + + + , + where +

+

+ + + + k + c + + = + + 2 + + m + c + + + + - + 1 + + + +

+

+ and + + + + m + R + + m + G + + m + B + + m + A + + + + is the number of red, + green, + blue, + and alpha bitplanes. +

+ Source and destination scale factors are referred to as + + + + s + R + + s + G + + s + B + + s + A + + + + and + + + + d + R + + d + G + + d + B + + d + A + + + . + All scale factors have range + + + + 0 + 1 + + . +

+

+ Parameter + + RGB Factor + + Alpha Factor +
+ GL_ZERO + + + + + 0 + 0 + 0 + + + + + + 0 + +
+ GL_ONE + + + + + 1 + 1 + 1 + + + + + + 1 + +
+ GL_SRC_COLOR + + + + + + R + s + + k + R + + + + G + s + + k + G + + + + B + s + + k + B + + + + + + + + + A + s + + k + A + + + +
+ GL_ONE_MINUS_SRC_COLOR + + + + + + 1 + 1 + 1 + 1 + + - + + + R + s + + k + R + + + + G + s + + k + G + + + + B + s + + k + B + + + + + + + + + + 1 + - + + A + s + + k + A + + + + +
+ GL_DST_COLOR + + + + + + R + d + + k + R + + + + G + d + + k + G + + + + B + d + + k + B + + + + + + + + + A + d + + k + A + + + +
+ GL_ONE_MINUS_DST_COLOR + + + + + + 1 + 1 + 1 + + - + + + R + d + + k + R + + + + G + d + + k + G + + + + B + d + + k + B + + + + + + + + + + 1 + - + + A + d + + k + A + + + + +
+ GL_SRC_ALPHA + + + + + + A + s + + k + A + + + + A + s + + k + A + + + + A + s + + k + A + + + + + + + + + A + s + + k + A + + + +
+ GL_ONE_MINUS_SRC_ALPHA + + + + + + 1 + 1 + 1 + + - + + + A + s + + k + A + + + + A + s + + k + A + + + + A + s + + k + A + + + + + + + + + + 1 + - + + A + s + + k + A + + + + +
+ GL_DST_ALPHA + + + + + + A + d + + k + A + + + + A + d + + k + A + + + + A + d + + k + A + + + + + + + + + A + d + + k + A + + + +
+ GL_ONE_MINUS_DST_ALPHA + + + + + + 1 + 1 + 1 + + - + + + A + d + + k + A + + + + A + d + + k + A + + + + A + d + + k + A + + + + + + + + + + 1 + - + + A + d + + k + A + + + + +
+ GL_CONSTANT_COLOR + + + + + R + c + + G + c + + B + c + + + + + + + A + c + + +
+ GL_ONE_MINUS_CONSTANT_COLOR + + + + + + 1 + 1 + 1 + + - + + R + c + + G + c + + B + c + + + + + + + + + 1 + - + A + c + + + +
+ GL_CONSTANT_ALPHA + + + + + A + c + + A + c + + A + c + + + + + + + A + c + + +
+ GL_ONE_MINUS_CONSTANT_ALPHA + + + + + + 1 + 1 + 1 + + - + + A + c + + A + c + + A + c + + + + + + + + + 1 + - + A + c + + + +
+ GL_SRC_ALPHA_SATURATE + + + + + i + i + i + + + + + + 1 + +

+ In the table, +

+

+ + + + i + = + + min + + + A + s + + + 1 + - + + A + d + + + + + + + +

+

+ 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. +

Notes

+ Incoming (source) alpha is correctly thought of as a material opacity, + ranging from 1.0 + ( + + K + A + + ), + representing complete opacity, + to 0.0 (0), representing complete + transparency. +

Errors

+ GL_INVALID_ENUM is generated if + srcRGB, dstRGB, + srcAlpha, or dstAlpha + is not an accepted value. +

Associated Gets

+ 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 +

+

See Also

+ glBlendColor, + glBlendEquation, + glBlendEquationSeparate, + glBlendFunc, + glClear, + glEnable, + glStencilFunc +

Copyright

+ 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/. +

diff --git a/es2/glBufferData.xml b/es2/glBufferData.xml new file mode 100644 index 00000000..79ef5d53 --- /dev/null +++ b/es2/glBufferData.xml @@ -0,0 +1,72 @@ + + + + +glBufferData

Name

glBufferData — create and initialize a buffer object's data store

C Specification

void glBufferData(GLenum target,
 GLsizeiptr size,
 const GLvoid * data,
 GLenum usage);
 

Parameters

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. +

Description

+ 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: +

STREAM

+ The data store contents will be modified once and used at most a few times. +

STATIC

+ The data store contents will be modified once and used many times. +

DYNAMIC

+ The data store contents will be modified repeatedly and used many times. +

+ The nature of access must be: +

DRAW

+ The data store contents are modified by the application, and used as the source for GL drawing and + image specification commands. +

Notes

+ 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 N be a + multiple of N. +

Errors

+ 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. +

Associated Gets

+ glGetBufferParameteriv with argument GL_BUFFER_SIZE or GL_BUFFER_USAGE +

See Also

+ glBindBuffer, + glBufferSubData +

Copyright

+ 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/. +

diff --git a/es2/glBufferSubData.xml b/es2/glBufferSubData.xml new file mode 100644 index 00000000..f32607f9 --- /dev/null +++ b/es2/glBufferSubData.xml @@ -0,0 +1,53 @@ + + + + +glBufferSubData

Name

glBufferSubData — update a subset of a buffer object's data store

C Specification

void glBufferSubData(GLenum target,
 GLintptr offset,
 GLsizeiptr size,
 const GLvoid * data);
 

Parameters

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. +

Description

+ 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. +

Notes

+ 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 N be a + multiple of N. +

Errors

+ 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. +

See Also

+ glBindBuffer, + glBufferData +

Copyright

+ 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/. +

diff --git a/es2/glCheckFramebufferStatus.xml b/es2/glCheckFramebufferStatus.xml new file mode 100644 index 00000000..959009a7 --- /dev/null +++ b/es2/glCheckFramebufferStatus.xml @@ -0,0 +1,86 @@ + + + + +glCheckFramebufferStatus

Name

glCheckFramebufferStatus — return the framebuffer completeness status of a framebuffer object

C Specification

GLenum glCheckFramebufferStatus(GLenum target);
 

Parameters

target

+ Specifies the target framebuffer object. + The symbolic constant must be GL_FRAMEBUFFER. +

Description

+ 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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER. +

See Also

+ glBindRenderbuffer, + glCopyTexImage2D, + glCopyTexSubImage2D, + glDrawArrays, + glDrawElements, + glReadPixels, + glRenderbufferStorage +

Copyright

+ 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/. +

diff --git a/es2/glClear.xml b/es2/glClear.xml new file mode 100644 index 00000000..7bad4332 --- /dev/null +++ b/es2/glClear.xml @@ -0,0 +1,64 @@ + + + + +glClear

Name

glClear — clear buffers to preset values

C Specification

void glClear(GLbitfield mask);
 

Parameters

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. +

Description

+ 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. +

Notes

+ If a buffer is not present, + then a glClear directed at that buffer has no effect. +

Errors

+ GL_INVALID_VALUE is generated if any bit other than the three defined + bits is set in mask. +

Associated Gets

+ glGet with argument GL_DEPTH_CLEAR_VALUE +

+ glGet with argument GL_COLOR_CLEAR_VALUE +

+ glGet with argument GL_STENCIL_CLEAR_VALUE +

See Also

+ glClearColor, + glClearDepthf, + glClearStencil, + glColorMask, + glDepthMask, + glScissor, + glStencilMask +

Copyright

+ 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/. +

diff --git a/es2/glClearColor.xml b/es2/glClearColor.xml new file mode 100644 index 00000000..9ba824e7 --- /dev/null +++ b/es2/glClearColor.xml @@ -0,0 +1,31 @@ + + + + +glClearColor

Name

glClearColor — specify clear values for the color buffers

C Specification

void glClearColor(GLclampf red,
 GLclampf green,
 GLclampf blue,
 GLclampf alpha);
 

Parameters

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. +

Description

+ 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 + + + + 0 + 1 + + . +

Associated Gets

+ glGet with argument GL_COLOR_CLEAR_VALUE +

See Also

+ glClear +

Copyright

+ 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/. +

diff --git a/es2/glClearDepthf.xml b/es2/glClearDepthf.xml new file mode 100644 index 00000000..0cc368cb --- /dev/null +++ b/es2/glClearDepthf.xml @@ -0,0 +1,27 @@ + + + + +glClearDepthf

Name

glClearDepthf — specify the clear value for the depth buffer

C Specification

void glClearDepthf(GLclampf depth);
 

Parameters

depth

+ Specifies the depth value used when the depth buffer is cleared. The + initial value is 1. +

Description

+ glClearDepthf specifies the depth value used by glClear to clear the depth buffer. + Values specified by glClearDepthf are clamped to the range + + + + 0 + 1 + + . +

Associated Gets

+ glGet with argument GL_DEPTH_CLEAR_VALUE +

See Also

+ glClear +

Copyright

+ 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/. +

diff --git a/es2/glClearStencil.xml b/es2/glClearStencil.xml new file mode 100644 index 00000000..18a151fa --- /dev/null +++ b/es2/glClearStencil.xml @@ -0,0 +1,41 @@ + + + + +glClearStencil

Name

glClearStencil — specify the clear value for the stencil buffer

C Specification

void glClearStencil(GLint s);
 

Parameters

s

+ Specifies the index used when the stencil buffer is cleared. + The initial value is 0. +

Description

+ glClearStencil specifies the index used by glClear to clear the stencil buffer. + s is masked with + + + + 2 + m + + - + 1 + + , + where + m + is the number of bits in the stencil buffer. +

Associated Gets

+ glGet with argument GL_STENCIL_CLEAR_VALUE +

+ glGet with argument GL_STENCIL_BITS +

See Also

+ glClear, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +

Copyright

+ 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/. +

diff --git a/es2/glColorMask.xml b/es2/glColorMask.xml new file mode 100644 index 00000000..6aca0c1e --- /dev/null +++ b/es2/glColorMask.xml @@ -0,0 +1,33 @@ + + + + +glColorMask

Name

glColorMask — enable and disable writing of frame buffer color components

C Specification

void glColorMask(GLboolean red,
 GLboolean green,
 GLboolean blue,
 GLboolean alpha);
 

Parameters

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. +

Description

+ 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. +

Associated Gets

+ glGet with argument GL_COLOR_WRITEMASK +

See Also

+ glClear, + glDepthMask, + glStencilMask +

Copyright

+ 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/. +

diff --git a/es2/glCompileShader.xml b/es2/glCompileShader.xml new file mode 100644 index 00000000..7728a871 --- /dev/null +++ b/es2/glCompileShader.xml @@ -0,0 +1,46 @@ + + + + +glCompileShader

Name

glCompileShader — compile a shader object

C Specification

void glCompileShader(GLuint shader);
 

Parameters

shader

Specifies the shader object to be + compiled.

Description

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.

Notes

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.

Errors

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.

Associated Gets

glGet + with argument GL_SHADER_COMPILER

glGetShaderInfoLog + with argument shader

glGetShaderiv + with arguments shader and + GL_COMPILE_STATUS

glIsShader

See Also

glCreateShader, + glLinkProgram, + glReleaseShaderCompiler, + glShaderSource, + glGetShaderPrecisionFormat

Copyright

+ 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/. +

diff --git a/es2/glCompressedTexImage2D.xml b/es2/glCompressedTexImage2D.xml new file mode 100644 index 00000000..2355a553 --- /dev/null +++ b/es2/glCompressedTexImage2D.xml @@ -0,0 +1,134 @@ + + + + +glCompressedTexImage2D

Name

glCompressedTexImage2D — specify a two-dimensional texture image in a compressed format

C Specification

void glCompressedTexImage2D(GLenum target,
 GLint level,
 GLenum internalformat,
 GLsizei width,
 GLsizei height,
 GLint border,
 GLsizei imageSize,
 const GLvoid * data);
 

Parameters

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. +

Description

+ 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. +

Notes

+ 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. +

Errors

+ 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 + + + + log + 2 + + + max + + , + where + max + is the returned value of 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. +

Associated Gets

+ 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 +

See Also

+ glActiveTexture, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glTexImage2D, + glTexSubImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es2/glCompressedTexSubImage2D.xml b/es2/glCompressedTexSubImage2D.xml new file mode 100644 index 00000000..b4835f9f --- /dev/null +++ b/es2/glCompressedTexSubImage2D.xml @@ -0,0 +1,204 @@ + + + + +glCompressedTexSubImage2D

Name

glCompressedTexSubImage2D — specify a two-dimensional texture subimage in a compressed format

C Specification

void glCompressedTexSubImage2D(GLenum target,
 GLint level,
 GLint xoffset,
 GLint yoffset,
 GLsizei width,
 GLsizei height,
 GLenum format,
 GLsizei imageSize,
 const GLvoid * data);
 

Parameters

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. +

Description

+ 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 + + + + xoffset + + + width + - + 1 + + , + and the y indices yoffset and + + + + yoffset + + + height + - + 1 + + , + inclusive. + This region may not include any texels + outside the range of the texture array as it was originally specified. It + is not an error to specify a subtexture with width of 0, but such a + specification has no effect. +

+ format must be the same extension-specified + compressed-texture format previously specified by + glCompressedTexImage2D. +

Notes

+ glCompressedTexSubImage2D + specifies a two-dimensional or cube-map texture for the current texture unit, + specified with glActiveTexture. +

Errors

+ 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 + + + + log + 2 + + + max + + , + where + max + is the returned value of 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 + + + + xoffset + < + 0 + + , + + + + + + xoffset + + + width + + + > + w + + , + + + + yoffset + < + 0 + + , + or + + + + + + yoffset + + + height + + + > + h + + , + where + w + is the width and + h + is the height + of the texture image being modified. +

+ 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. +

Associated Gets

+ 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 +

See Also

+ glActiveTexture, + glCompressedTexImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glTexImage2D, + glTexSubImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es2/glCopyTexImage2D.xml b/es2/glCopyTexImage2D.xml new file mode 100644 index 00000000..937894e8 --- /dev/null +++ b/es2/glCopyTexImage2D.xml @@ -0,0 +1,171 @@ + + + + +glCopyTexImage2D

Name

glCopyTexImage2D — copy pixels into a 2D texture image

C Specification

void glCopyTexImage2D(GLenum target,
 GLint level,
 GLenum internalformat,
 GLint x,
 GLint y,
 GLsizei width,
 GLsizei height,
 GLint border);
 

Parameters

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. +

Description

+ 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 + + + + 0 + 1 + + + and then conversion to the texture's internal format for storage in the texel + array. +

+ 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 + x + and + y + screen coordinates correspond to + lower + s + and + t + texture coordinates. +

+ 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. +

Notes

+ 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. +

Errors

+ 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 + + + + log + 2 + + + max + + , + where + max + is the returned value of 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). +

Associated Gets

+ glGet + with argument GL_MAX_TEXTURE_SIZE or + GL_MAX_CUBE_MAP_TEXTURE_SIZE +

See Also

+ glActiveTexture, + glCheckFramebufferStatus, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glCopyTexSubImage2D, + glTexImage2D, + glTexParameter, + glTexSubImage2D +

Copyright

+ 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/. +

diff --git a/es2/glCopyTexSubImage2D.xml b/es2/glCopyTexSubImage2D.xml new file mode 100644 index 00000000..31bfae3c --- /dev/null +++ b/es2/glCopyTexSubImage2D.xml @@ -0,0 +1,219 @@ + + + + +glCopyTexSubImage2D

Name

glCopyTexSubImage2D — copy a two-dimensional texture subimage

C Specification

void glCopyTexSubImage2D(GLenum target,
 GLint level,
 GLint xoffset,
 GLint yoffset,
 GLint x,
 GLint y,
 GLsizei width,
 GLsizei height);
 

+

Parameters

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. +

Description

+ 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 + + + + x + y + + + and with + width width and height height replaces the portion of the + texture array with x indices xoffset through + + + + xoffset + + + width + - + 1 + + , + inclusive, and y indices yoffset through + + + + yoffset + + + height + - + 1 + + , + inclusive, at the mipmap level specified by 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 + + + + 0 + 1 + + + and then conversion to the texture's internal format for storage in the texel + array. +

+ 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. +

Notes

+ glCopyTexSubImage2D + specifies the two-dimensional or cube-map texture for the current texture unit, + specified with glActiveTexture. +

Errors

+ 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 + > + + log + 2 + + + + max + + + + , + where + max + is the returned value of GL_MAX_TEXTURE_SIZE. +

+ GL_INVALID_VALUE is generated if + + + + xoffset + < + 0 + + , + + + + + + xoffset + + + width + + + > + w + + , + + + + yoffset + < + 0 + + , + or + + + + + + yoffset + + + height + + + > + h + + , + where + w + is the width and + h + is the 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 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). +

Associated Gets

+ glGet + with argument GL_MAX_TEXTURE_SIZE or + GL_MAX_CUBE_MAP_TEXTURE_SIZE +

See Also

+ glActiveTexture, + glCheckFramebufferStatus, + glCopyTexImage2D, + glTexImage2D, + glTexParameter, + glTexSubImage2D +

Copyright

+ 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/. +

diff --git a/es2/glCreateProgram.xml b/es2/glCreateProgram.xml new file mode 100644 index 00000000..de10c467 --- /dev/null +++ b/es2/glCreateProgram.xml @@ -0,0 +1,61 @@ + + + + +glCreateProgram

Name

glCreateProgram — create a program object

C Specification

GLuint glCreateProgram(void);
 

Description

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.

Notes

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.

Errors

This function returns 0 if an error occurs creating the program object.

Associated Gets

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

glIsProgram

See Also

glAttachShader, + glBindAttribLocation, + glCreateShader, + glDeleteProgram, + glDetachShader, + glLinkProgram, + glUniform, + glUseProgram, + glValidateProgram

Copyright

+ 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/. +

diff --git a/es2/glCreateShader.xml b/es2/glCreateShader.xml new file mode 100644 index 00000000..0ff06aa0 --- /dev/null +++ b/es2/glCreateShader.xml @@ -0,0 +1,43 @@ + + + + +glCreateShader

Name

glCreateShader — create a shader object

C Specification

GLuint glCreateShader(GLenum shaderType);
 

Parameters

shaderType

Specifies the type of shader to be created. + Must be either GL_VERTEX_SHADER + or GL_FRAGMENT_SHADER.

Description

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.

Notes

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.

Errors

This function returns 0 if an error occurs creating the + shader object.

GL_INVALID_ENUM is generated if + shaderType is not an accepted value.

Associated Gets

glGetShaderiv + with a valid shader object and the parameter to be queried

glGetShaderInfoLog + with a valid shader object

glGetShaderSource + with a valid shader object

glIsShader

See Also

glAttachShader, + glCompileShader, + glDeleteShader, + glDetachShader, + glShaderSource, + glShaderBinary +

Copyright

+ 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/. +

diff --git a/es2/glCullFace.xml b/es2/glCullFace.xml new file mode 100644 index 00000000..eef4ee82 --- /dev/null +++ b/es2/glCullFace.xml @@ -0,0 +1,38 @@ + + + + +glCullFace

Name

glCullFace — specify whether front- or back-facing polygons can be culled

C Specification

void glCullFace(GLenum mode);
 

Parameters

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. +

Description

+ 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. +

Notes

+ If mode is GL_FRONT_AND_BACK, no polygons are drawn, but other + primitives such as points and lines are drawn. +

Errors

+ GL_INVALID_ENUM is generated if mode is not an accepted value. +

Associated Gets

+ glIsEnabled with argument GL_CULL_FACE +

+ glGet with argument GL_CULL_FACE_MODE +

See Also

+ glEnable, + glFrontFace +

Copyright

+ 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/. +

diff --git a/es2/glDeleteBuffers.xml b/es2/glDeleteBuffers.xml new file mode 100644 index 00000000..89782334 --- /dev/null +++ b/es2/glDeleteBuffers.xml @@ -0,0 +1,31 @@ + + + + +glDeleteBuffers

Name

glDeleteBuffers — delete named buffer objects

C Specification

void glDeleteBuffers(GLsizei n,
 const GLuint * buffers);
 

Parameters

n

+ Specifies the number of buffer objects to be deleted. +

buffers

+ Specifies an array of buffer objects to be deleted. +

Description

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if n is negative. +

Associated Gets

+ glIsBuffer +

See Also

+ glBindBuffer, + glGenBuffers, + glIsBuffer +

Copyright

+ 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/. +

diff --git a/es2/glDeleteFramebuffers.xml b/es2/glDeleteFramebuffers.xml new file mode 100644 index 00000000..90609275 --- /dev/null +++ b/es2/glDeleteFramebuffers.xml @@ -0,0 +1,31 @@ + + + + +glDeleteFramebuffers

Name

glDeleteFramebuffers — delete named framebuffer objects

C Specification

void glDeleteFramebuffers(GLsizei n,
 const GLuint * framebuffers);
 

Parameters

n

+ Specifies the number of framebuffer objects to be deleted. +

framebuffers

+ Specifies an array of framebuffer objects to be deleted. +

Description

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if n is negative. +

Associated Gets

+ glIsFramebuffer +

See Also

+ glBindFramebuffer, + glGenFramebuffers, + glIsFramebuffer +

Copyright

+ 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/. +

diff --git a/es2/glDeleteProgram.xml b/es2/glDeleteProgram.xml new file mode 100644 index 00000000..e2b933f5 --- /dev/null +++ b/es2/glDeleteProgram.xml @@ -0,0 +1,36 @@ + + + + +glDeleteProgram

Name

glDeleteProgram — delete a program object

C Specification

void glDeleteProgram(GLuint program);
 

Parameters

program

Specifies the program object to be + deleted.

Description

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.

Errors

GL_INVALID_VALUE is generated if + program is not a value generated by + OpenGL.

Associated Gets

glGet + with argument GL_CURRENT_PROGRAM

glGetProgramiv + with arguments program and + GL_DELETE_STATUS

glIsProgram

See Also

glCreateShader, + glDetachShader, + glUseProgram +

Copyright

+ 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/. +

diff --git a/es2/glDeleteRenderbuffers.xml b/es2/glDeleteRenderbuffers.xml new file mode 100644 index 00000000..40002d55 --- /dev/null +++ b/es2/glDeleteRenderbuffers.xml @@ -0,0 +1,37 @@ + + + + +glDeleteRenderbuffers

Name

glDeleteRenderbuffers — delete named renderbuffer objects

C Specification

void glDeleteRenderbuffers(GLsizei n,
 const GLuint * renderbuffers);
 

Parameters

n

+ Specifies the number of renderbuffer objects to be deleted. +

renderbuffers

+ Specifies an array of renderbuffer objects to be deleted. +

Description

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if n is negative. +

Associated Gets

+ glIsRenderbuffer +

See Also

+ glBindRenderbuffer, + glGenRenderbuffers, + glIsRenderbuffer +

Copyright

+ 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/. +

diff --git a/es2/glDeleteShader.xml b/es2/glDeleteShader.xml new file mode 100644 index 00000000..026352c2 --- /dev/null +++ b/es2/glDeleteShader.xml @@ -0,0 +1,32 @@ + + + + +glDeleteShader

Name

glDeleteShader — delete a shader object

C Specification

void glDeleteShader(GLuint shader);
 

Parameters

shader

Specifies the shader object to be deleted.

Description

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.

Errors

GL_INVALID_VALUE is generated if + shader is not a value generated by + OpenGL.

Associated Gets

glGetAttachedShaders + with the program object to be queried

glGetShaderiv + with arguments shader and + GL_DELETE_STATUS

glIsShader

See Also

glCreateProgram, + glCreateShader, + glDetachShader, + glUseProgram

Copyright

+ 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/. +

diff --git a/es2/glDeleteTextures.xml b/es2/glDeleteTextures.xml new file mode 100644 index 00000000..c0770580 --- /dev/null +++ b/es2/glDeleteTextures.xml @@ -0,0 +1,31 @@ + + + + +glDeleteTextures

Name

glDeleteTextures — delete named textures

C Specification

void glDeleteTextures(GLsizei n,
 const GLuint * textures);
 

Parameters

n

+ Specifies the number of textures to be deleted. +

textures

+ Specifies an array of textures to be deleted. +

Description

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if n is negative. +

Associated Gets

+ glIsTexture +

See Also

+ glBindTexture, + glGenTextures, + glIsTexture +

Copyright

+ 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/. +

diff --git a/es2/glDepthFunc.xml b/es2/glDepthFunc.xml new file mode 100644 index 00000000..7da109b8 --- /dev/null +++ b/es2/glDepthFunc.xml @@ -0,0 +1,65 @@ + + + + +glDepthFunc

Name

glDepthFunc — specify the value used for depth buffer comparisons

C Specification

void glDepthFunc(GLenum func);
 

Parameters

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. +

Description

+ 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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if func is not an accepted value. +

Associated Gets

+ glGet with argument GL_DEPTH_FUNC +

+ glIsEnabled with argument GL_DEPTH_TEST +

See Also

+ glDepthRangef, + glEnable, + glPolygonOffset +

Copyright

+ 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/. +

diff --git a/es2/glDepthMask.xml b/es2/glDepthMask.xml new file mode 100644 index 00000000..86f00bee --- /dev/null +++ b/es2/glDepthMask.xml @@ -0,0 +1,29 @@ + + + + +glDepthMask

Name

glDepthMask — enable or disable writing into the depth buffer

C Specification

void glDepthMask(GLboolean flag);
 

Parameters

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. +

Description

+ 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. +

Associated Gets

+ glGet with argument GL_DEPTH_WRITEMASK +

See Also

+ glColorMask, + glDepthFunc, + glDepthRangef, + glStencilMask +

Copyright

+ 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/. +

diff --git a/es2/glDepthRangef.xml b/es2/glDepthRangef.xml new file mode 100644 index 00000000..ff2b5e67 --- /dev/null +++ b/es2/glDepthRangef.xml @@ -0,0 +1,65 @@ + + + + +glDepthRangef

Name

glDepthRangef — specify mapping of depth values from normalized device coordinates to window coordinates

C Specification

void glDepthRangef(GLclampf nearVal,
 GLclampf farVal);
 

Parameters

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. +

Description

+ After clipping and division by w, + depth coordinates range from + + + -1 + + to 1, + corresponding to the near and far clipping planes. + 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. +

Notes

+ It is not necessary that nearVal be less than farVal. + Reverse mappings such as + + + + nearVal + = + 1 + + , + and + + + + farVal + = + 0 + + + are acceptable. +

Associated Gets

+ glGet with argument GL_DEPTH_RANGE +

See Also

+ glDepthFunc, + glPolygonOffset, + glViewport +

Copyright

+ 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/. +

diff --git a/es2/glDetachShader.xml b/es2/glDetachShader.xml new file mode 100644 index 00000000..5c802878 --- /dev/null +++ b/es2/glDetachShader.xml @@ -0,0 +1,29 @@ + + + + +glDetachShader

Name

glDetachShader — detach a shader object from a program object

C Specification

void glDetachShader(GLuint program,
 GLuint shader);
 

Parameters

program

Specifies the program object from which to + detach the shader object.

shader

Specifies the shader object to be + detached.

Description

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.

Errors

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.

Associated Gets

glGetAttachedShaders + with the handle of a valid program object

glGetShaderiv + with arguments shader and + GL_DELETE_STATUS

glIsProgram

glIsShader

See Also

glAttachShader

Copyright

+ 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/. +

diff --git a/es2/glDisable.xml b/es2/glDisable.xml new file mode 100644 index 00000000..b4d33296 --- /dev/null +++ b/es2/glDisable.xml @@ -0,0 +1,4 @@ + + + +glDisable diff --git a/es2/glDisableVertexAttribArray.xml b/es2/glDisableVertexAttribArray.xml new file mode 100644 index 00000000..eccab0f4 --- /dev/null +++ b/es2/glDisableVertexAttribArray.xml @@ -0,0 +1,4 @@ + + + +glDisableVertexAttribArray.xml diff --git a/es2/glDrawArrays.xml b/es2/glDrawArrays.xml new file mode 100644 index 00000000..07941560 --- /dev/null +++ b/es2/glDrawArrays.xml @@ -0,0 +1,64 @@ + + + + +glDrawArrays

Name

glDrawArrays — render primitives from array data

C Specification

void glDrawArrays(GLenum mode,
 GLint first,
 GLsizei count);
 

Parameters

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. +

Description

+ 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. +

Notes

+ If the current program object, as set by + glUseProgram, + is invalid, rendering results are undefined. However, no error is generated + for this case. +

Errors

+ 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). +

See Also

+ glCheckFramebufferStatus, + glDisableVertexAttribArray, + glDrawElements, + glEnableVertexAttribArray, + glUseProgram, + glVertexAttribPointer +

Copyright

+ 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/. +

diff --git a/es2/glDrawElements.xml b/es2/glDrawElements.xml new file mode 100644 index 00000000..ce263e1a --- /dev/null +++ b/es2/glDrawElements.xml @@ -0,0 +1,70 @@ + + + + +glDrawElements

Name

glDrawElements — render primitives from array data

C Specification

void glDrawElements(GLenum mode,
 GLsizei count,
 GLenum type,
 const GLvoid * indices);
 

Parameters

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. +

Description

+ 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. +

Notes

+ If the current program object, as set by + glUseProgram, + is invalid, rendering results are undefined. However, no error is generated + for this case. +

Errors

+ 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). +

See Also

+ glCheckFramebufferStatus, + glDisableVertexAttribArray, + glDrawArrays, + glEnableVertexAttribArray, + glUseProgram, + glVertexAttribPointer +

Copyright

+ 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/. +

diff --git a/es2/glEnable.xml b/es2/glEnable.xml new file mode 100644 index 00000000..911081f4 --- /dev/null +++ b/es2/glEnable.xml @@ -0,0 +1,86 @@ + + + + +glEnable

Name

glEnable — enable or disable server-side GL capabilities

C Specification

void glEnable(GLenum cap);
 

Parameters

cap

+ Specifies a symbolic constant indicating a GL capability. +

C Specification

void glDisable(GLenum cap);
 

Parameters

cap

+ Specifies a symbolic constant indicating a GL capability. +

Description

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if cap is not one of the values + listed previously. +

Associated Gets

+ glIsEnabled +

+ glGet +

See Also

+ glActiveTexture, + glBlendFunc, + glCullFace, + glDepthFunc, + glDepthRangef, + glGet, + glIsEnabled, + glLineWidth, + glPolygonOffset, + glScissor, + glStencilFunc, + glStencilOp, + glTexImage2D +

Copyright

+ 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/. +

diff --git a/es2/glEnableVertexAttribArray.xml b/es2/glEnableVertexAttribArray.xml new file mode 100644 index 00000000..4bd9870b --- /dev/null +++ b/es2/glEnableVertexAttribArray.xml @@ -0,0 +1,35 @@ + + + + +glEnableVertexAttribArray

Name

glEnableVertexAttribArray — enable or disable a generic vertex attribute array

C Specification

void glEnableVertexAttribArray(GLuint index);
 
void glDisableVertexAttribArray(GLuint index);
 

Parameters

index

Specifies the index of the generic vertex + attribute to be enabled or disabled.

Description

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.

Errors

GL_INVALID_VALUE is generated if + index is greater than or equal to + GL_MAX_VERTEX_ATTRIBS.

Associated Gets

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

See Also

glBindAttribLocation, + glDrawArrays, + glDrawElements, + glVertexAttrib, + glVertexAttribPointer

Copyright

+ 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/. +

diff --git a/es2/glFinish.xml b/es2/glFinish.xml new file mode 100644 index 00000000..ffa2eaca --- /dev/null +++ b/es2/glFinish.xml @@ -0,0 +1,20 @@ + + + + +glFinish

Name

glFinish — block until all GL execution is complete

C Specification

void glFinish( void);
 

Description

+ 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. +

Notes

+ glFinish requires a round trip to the server. +

See Also

+ glFlush +

Copyright

+ 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/. +

diff --git a/es2/glFlush.xml b/es2/glFlush.xml new file mode 100644 index 00000000..e23fb0be --- /dev/null +++ b/es2/glFlush.xml @@ -0,0 +1,33 @@ + + + + +glFlush

Name

glFlush — force execution of GL commands in finite time

C Specification

void glFlush( void);
 

Description

+ 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. +

Notes

+ glFlush can return at any time. + It does not wait until the execution of all previously + issued GL commands is complete. +

See Also

+ glFinish +

Copyright

+ 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/. +

diff --git a/es2/glFramebufferRenderbuffer.xml b/es2/glFramebufferRenderbuffer.xml new file mode 100644 index 00000000..4b9bbec6 --- /dev/null +++ b/es2/glFramebufferRenderbuffer.xml @@ -0,0 +1,64 @@ + + + + +glFramebufferRenderbuffer

Name

glFramebufferRenderbuffer — attach a renderbuffer object to a framebuffer object

C Specification

void glFramebufferRenderbuffer(GLenum target,
 GLenum attachment,
 GLenum renderbuffertarget,
 GLuint renderbuffer);
 

Parameters

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.

Description

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.

Notes

+ 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. +

Errors

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.

Associated Gets

glGetFramebufferAttachmentParameteriv

See Also

glBindFramebuffer, + glBindRenderbuffer, + glCheckFramebufferStatus, + glDeleteFramebuffers, + glDeleteRenderbuffers, + glFramebufferTexture2D, + glGetFramebufferAttachmentParameteriv, + glRenderbufferStorage

Copyright

+ 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/. +

diff --git a/es2/glFramebufferTexture2D.xml b/es2/glFramebufferTexture2D.xml new file mode 100644 index 00000000..1b579ac9 --- /dev/null +++ b/es2/glFramebufferTexture2D.xml @@ -0,0 +1,92 @@ + + + + +glFramebufferTexture2D

Name

glFramebufferTexture2D — attach a texture image to a framebuffer object

C Specification

void glFramebufferTexture2D(GLenum target,
 GLenum attachment,
 GLenum textarget,
 GLuint texture,
 GLint level);
 

Parameters

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.

Description

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.

Notes

+ 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. +

Errors

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.

Associated Gets

glGetFramebufferAttachmentParameteriv

See Also

glBindFramebuffer, + glBindTexture, + glCheckFramebufferStatus, + glDeleteFramebuffers, + glDeleteTextures, + glFramebufferRenderbuffer, + glGenerateMipmap, + glGetFramebufferAttachmentParameteriv, + glTexImage2D

Copyright

+ 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/. +

diff --git a/es2/glFrontFace.xml b/es2/glFrontFace.xml new file mode 100644 index 00000000..9c4ef091 --- /dev/null +++ b/es2/glFrontFace.xml @@ -0,0 +1,46 @@ + + + + +glFrontFace

Name

glFrontFace — define front- and back-facing polygons

C Specification

void glFrontFace(GLenum mode);
 

Parameters

mode

+ Specifies the orientation of front-facing polygons. + GL_CW and GL_CCW are accepted. + The initial value is GL_CCW. +

Description

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if mode is not an accepted value. +

Associated Gets

+ glGet with argument GL_FRONT_FACE +

See Also

+ glCullFace +

Copyright

+ 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/. +

diff --git a/es2/glGenBuffers.xml b/es2/glGenBuffers.xml new file mode 100644 index 00000000..f385da9c --- /dev/null +++ b/es2/glGenBuffers.xml @@ -0,0 +1,34 @@ + + + + +glGenBuffers

Name

glGenBuffers — generate buffer object names

C Specification

void glGenBuffers(GLsizei n,
 GLuint * buffers);
 

Parameters

n

+ Specifies the number of buffer object names to be generated. +

buffers

+ Specifies an array in which the generated buffer object names are stored. +

Description

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if n is negative. +

Associated Gets

+ glIsBuffer +

See Also

+ glBindBuffer, + glDeleteBuffers, + glGet +

Copyright

+ 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/. +

diff --git a/es2/glGenFramebuffers.xml b/es2/glGenFramebuffers.xml new file mode 100644 index 00000000..91b335fc --- /dev/null +++ b/es2/glGenFramebuffers.xml @@ -0,0 +1,34 @@ + + + + +glGenFramebuffers

Name

glGenFramebuffers — generate framebuffer object names

C Specification

void glGenFramebuffers(GLsizei n,
 GLuint * framebuffers);
 

Parameters

n

+ Specifies the number of framebuffer object names to be generated. +

framebuffers

+ Specifies an array in which the generated framebuffer object names are stored. +

Description

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if n is negative. +

Associated Gets

+ glIsFramebuffer +

See Also

+ glBindFramebuffer, + glDeleteFramebuffers, + glIsFramebuffer +

Copyright

+ 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/. +

diff --git a/es2/glGenRenderbuffers.xml b/es2/glGenRenderbuffers.xml new file mode 100644 index 00000000..7f9193b6 --- /dev/null +++ b/es2/glGenRenderbuffers.xml @@ -0,0 +1,34 @@ + + + + +glGenRenderbuffers

Name

glGenRenderbuffers — generate renderbuffer object names

C Specification

void glGenRenderbuffers(GLsizei n,
 GLuint * renderbuffers);
 

Parameters

n

+ Specifies the number of renderbuffer object names to be generated. +

renderbuffers

+ Specifies an array in which the generated renderbuffer object names are stored. +

Description

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if n is negative. +

Associated Gets

+ glIsRenderbuffer +

See Also

+ glBindRenderbuffer, + glDeleteRenderbuffers, + glIsRenderbuffer +

Copyright

+ 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/. +

diff --git a/es2/glGenTextures.xml b/es2/glGenTextures.xml new file mode 100644 index 00000000..364a22a7 --- /dev/null +++ b/es2/glGenTextures.xml @@ -0,0 +1,39 @@ + + + + +glGenTextures

Name

glGenTextures — generate texture names

C Specification

void glGenTextures(GLsizei n,
 GLuint * textures);
 

Parameters

n

+ Specifies the number of texture names to be generated. +

textures

+ Specifies an array in which the generated texture names are stored. +

Description

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if n is negative. +

Associated Gets

+ glIsTexture +

See Also

+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glGet, + glGetTexParameter, + glTexImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es2/glGenerateMipmap.xml b/es2/glGenerateMipmap.xml new file mode 100644 index 00000000..644ce3b0 --- /dev/null +++ b/es2/glGenerateMipmap.xml @@ -0,0 +1,34 @@ + + + + +glGenerateMipmap

Name

glGenerateMipmap — generate a complete set of mipmaps for a texture object

C Specification

void glGenerateMipmap(GLenum target);
 

Parameters

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.

Description

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.

Errors

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.

See Also

glBindTexture, + glFramebufferTexture2D, + glHint, + glTexImage2D, + glTexParameter

Copyright

+ 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/. +

diff --git a/es2/glGet.xml b/es2/glGet.xml new file mode 100644 index 00000000..28717c53 --- /dev/null +++ b/es2/glGet.xml @@ -0,0 +1,556 @@ + + + + +glGet

Name

glGet — return the value or values of a selected parameter

C Specification

void glGetBooleanv(GLenum pname,
 GLboolean * params);
 

C Specification

void glGetFloatv(GLenum pname,
 GLfloat * params);
 

C Specification

void glGetIntegerv(GLenum pname,
 GLint * params);
 

Parameters

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. +

Description

+ 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 + + + -1.0 + + to the most negative representable integer value. + If 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 + + + -1.0 + + 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_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 + + + -1.0 + + 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 + + + -1.0 + + 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_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 + x + and + y + window coordinates of the scissor box, + followed by its width and height. + Initially the + x + and + y + 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. 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 + x + and + y + window coordinates of the viewport, + followed by its width and height. + Initially the + x + and + y + 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. +

Errors

+ GL_INVALID_ENUM is generated if pname + is not one of the values listed previously. +

See Also

+ glGetActiveAttrib, + glGetActiveUniform, + glGetAttachedShaders, + glGetAttribLocation, + glGetBufferParameteriv, + glGetError, + glGetFramebufferAttachmentParameteriv, + glGetProgramiv, + glGetProgramInfoLog, + glGetRenderbufferParameteriv, + glGetShaderiv, + glGetShaderInfoLog, + glGetShaderSource, + glGetString, + glGetTexParameter, + glGetUniform, + glGetUniformLocation, + glGetVertexAttrib, + glGetVertexAttribPointerv, + glIsEnabled +

Copyright

+ 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/. +

diff --git a/es2/glGetActiveAttrib.xml b/es2/glGetActiveAttrib.xml new file mode 100644 index 00000000..57eedc93 --- /dev/null +++ b/es2/glGetActiveAttrib.xml @@ -0,0 +1,91 @@ + + + + +glGetActiveAttrib

Name

glGetActiveAttrib — return information about an active attribute variable

C Specification

void glGetActiveAttrib(GLuint program,
 GLuint index,
 GLsizei bufSize,
 GLsizei *length,
 GLint *size,
 GLenum *type,
 GLchar *name);
 

Parameters

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.

Description

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.

Errors

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.

Associated Gets

glGet + with argument GL_MAX_VERTEX_ATTRIBS.

glGetProgramiv + with argument GL_ACTIVE_ATTRIBUTES or + GL_ACTIVE_ATTRIBUTE_MAX_LENGTH.

glIsProgram

See Also

glBindAttribLocation, + glGetActiveUniform, + glLinkProgram, + glVertexAttrib, + glVertexAttribPointer

Copyright

+ 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/. +

diff --git a/es2/glGetActiveUniform.xml b/es2/glGetActiveUniform.xml new file mode 100644 index 00000000..507cf2b5 --- /dev/null +++ b/es2/glGetActiveUniform.xml @@ -0,0 +1,135 @@ + + + + +glGetActiveUniform

Name

glGetActiveUniform — return information about an active uniform variable

C Specification

void glGetActiveUniform(GLuint program,
 GLuint index,
 GLsizei bufSize,
 GLsizei *length,
 GLint *size,
 GLenum *type,
 GLchar *name);
 

Parameters

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.

Description

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.

Errors

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.

Associated Gets

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.

glIsProgram

See Also

glGetActiveAttrib, + glGetUniform, + glGetUniformLocation, + glLinkProgram, + glUniform, + glUseProgram

Copyright

+ 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/. +

diff --git a/es2/glGetAttachedShaders.xml b/es2/glGetAttachedShaders.xml new file mode 100644 index 00000000..4bd1df88 --- /dev/null +++ b/es2/glGetAttachedShaders.xml @@ -0,0 +1,40 @@ + + + + +glGetAttachedShaders

Name

glGetAttachedShaders — return the handles of the shader objects attached to a program object

C Specification

void glGetAttachedShaders(GLuint program,
 GLsizei maxCount,
 GLsizei *count,
 GLuint *shaders);
 

Parameters

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.

Description

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.

Errors

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.

Associated Gets

glGetProgramiv + with argument GL_ATTACHED_SHADERS

glIsProgram

See Also

glAttachShader, + glDetachShader

. +

Copyright

+ 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/. +

diff --git a/es2/glGetAttribLocation.xml b/es2/glGetAttribLocation.xml new file mode 100644 index 00000000..c429c06c --- /dev/null +++ b/es2/glGetAttribLocation.xml @@ -0,0 +1,47 @@ + + + + +glGetAttribLocation

Name

glGetAttribLocation — return the location of an attribute variable

C Specification

GLint glGetAttribLocation(GLuint program,
 const GLchar *name);
 

Parameters

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.

Description

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.

Errors

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.

Associated Gets

glGetActiveAttrib + with argument program and the index of an + active attribute

glIsProgram

See Also

glBindAttribLocation, + glLinkProgram, + glVertexAttrib, + glVertexAttribPointer

Copyright

+ 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/. +

diff --git a/es2/glGetBufferParameteriv.xml b/es2/glGetBufferParameteriv.xml new file mode 100644 index 00000000..2ab28436 --- /dev/null +++ b/es2/glGetBufferParameteriv.xml @@ -0,0 +1,41 @@ + + + + +glGetBufferParameteriv

Name

glGetBufferParameteriv — return parameters of a buffer object

C Specification

void glGetBufferParameteriv(GLenum target,
 GLenum value,
 GLint * data);
 

Parameters

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. +

Description

+ 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. +

Notes

+ If an error is generated, + no change is made to the contents of data. +

Errors

+ 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. +

See Also

+ glBindBuffer, + glBufferData +

Copyright

+ 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/. +

diff --git a/es2/glGetError.xml b/es2/glGetError.xml new file mode 100644 index 00000000..240fa539 --- /dev/null +++ b/es2/glGetError.xml @@ -0,0 +1,75 @@ + + + + +glGetError

Name

glGetError — return error information

C Specification

GLenum glGetError( void);
 

Description

+ 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. +

See Also

+ glCheckFramebufferStatus +

Copyright

+ 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/. +

diff --git a/es2/glGetFramebufferAttachmentParameteriv.xml b/es2/glGetFramebufferAttachmentParameteriv.xml new file mode 100644 index 00000000..cb25a13d --- /dev/null +++ b/es2/glGetFramebufferAttachmentParameteriv.xml @@ -0,0 +1,90 @@ + + + + +glGetFramebufferAttachmentParameteriv

Name

glGetFramebufferAttachmentParameteriv — return attachment parameters of a framebuffer object

C Specification

void glGetFramebufferAttachmentParameteriv(GLenum target,
 GLenum attachment,
 GLenum pname,
 GLint * params);
 

Parameters

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. +

Description

+ 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. +

Notes

+ If an error is generated, + no change is made to the contents of params. +

Errors

+ 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. +

See Also

+ glBindFramebuffer, + glFramebufferRenderbuffer, + glFramebufferTexture2D +

Copyright

+ 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/. +

diff --git a/es2/glGetProgramInfoLog.xml b/es2/glGetProgramInfoLog.xml new file mode 100644 index 00000000..a5fb4edd --- /dev/null +++ b/es2/glGetProgramInfoLog.xml @@ -0,0 +1,50 @@ + + + + +glGetProgramInfoLog

Name

glGetProgramInfoLog — return the information log for a program object

C Specification

void glGetProgramInfoLog(GLuint program,
 GLsizei maxLength,
 GLsizei *length,
 GLchar *infoLog);
 

Parameters

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.

Description

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.

Notes

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.

Errors

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.

Associated Gets

glGetProgramiv + with argument GL_INFO_LOG_LENGTH

glIsProgram

See Also

glCompileShader, + glGetShaderInfoLog, + glLinkProgram, + glValidateProgram

Copyright

+ 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/. +

diff --git a/es2/glGetProgramiv.xml b/es2/glGetProgramiv.xml new file mode 100644 index 00000000..ab0264c3 --- /dev/null +++ b/es2/glGetProgramiv.xml @@ -0,0 +1,78 @@ + + + + +glGetProgramiv

Name

glGetProgramiv — return a parameter from a program object

C Specification

void glGetProgramiv(GLuint program,
 GLenum pname,
 GLint *params);
 

Parameters

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.

Description

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.

Notes

If an error is generated, no change is made to the + contents of params.

Errors

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.

Associated Gets

glGetActiveAttrib + with argument program

glGetActiveUniform + with argument program

glGetAttachedShaders + with argument program

glGetProgramInfoLog + with argument program

glIsProgram +

See Also

glAttachShader, + glCreateProgram, + glDeleteProgram, + glGetShaderiv, + glLinkProgram, + glValidateProgram

Copyright

+ 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/. +

diff --git a/es2/glGetRenderbufferParameteriv.xml b/es2/glGetRenderbufferParameteriv.xml new file mode 100644 index 00000000..f491f521 --- /dev/null +++ b/es2/glGetRenderbufferParameteriv.xml @@ -0,0 +1,101 @@ + + + + +glGetRenderbufferParameteriv

Name

glGetRenderbufferParameteriv — return parameters of a renderbuffer object

C Specification

void glGetRenderbufferParameteriv(GLenum target,
 GLenum pname,
 GLint * params);
 

Parameters

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. +

Description

+ 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. +

Notes

+ 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. +

Errors

+ 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. +

See Also

+ glBindRenderBuffer, + glRenderbufferStorage +

Copyright

+ 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/. +

diff --git a/es2/glGetShaderInfoLog.xml b/es2/glGetShaderInfoLog.xml new file mode 100644 index 00000000..f7aab556 --- /dev/null +++ b/es2/glGetShaderInfoLog.xml @@ -0,0 +1,47 @@ + + + + +glGetShaderInfoLog

Name

glGetShaderInfoLog — return the information log for a shader object

C Specification

void glGetShaderInfoLog(GLuint shader,
 GLsizei maxLength,
 GLsizei *length,
 GLchar *infoLog);
 

Parameters

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.

Description

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.

Notes

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.

Errors

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.

Associated Gets

glGetShaderiv + with argument GL_INFO_LOG_LENGTH

glIsShader

See Also

glCompileShader, + glGetProgramInfoLog, + glLinkProgram, + glValidateProgram

Copyright

+ 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/. +

diff --git a/es2/glGetShaderPrecisionFormat.xml b/es2/glGetShaderPrecisionFormat.xml new file mode 100644 index 00000000..fd53e63d --- /dev/null +++ b/es2/glGetShaderPrecisionFormat.xml @@ -0,0 +1,144 @@ + + + + +glGetShaderPrecisionFormat

Name

glGetShaderPrecisionFormat — return the range and precision for different shader numeric formats

C Specification

void glGetShaderPrecisionFormat(GLenum shaderType,
 GLenum precisionType,
 GLint *range,
 GLint *precision);
 

Parameters

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 + + + + log + 2 + + + + of the minimum and maximum representable magnitudes of the format + are returned.

precision

Specifies a pointer to the location in which the + + + + log + 2 + + + + of the precision of the format is returned.

Description

glGetShaderPrecisionFormat + returns range and precision limits for floating-point and integer shader variable formats with low, + medium, and high precision qualifiers. + When minRep + and maxRep + are the minimum and maximum representable values of the format, + + + + floor + + + + log + 2 + + + + + + + minRep + + + + + + + + + and + + + + floor + + + + log + 2 + + + + + + + maxRep + + + + + + + + + are returned in + range as the first and second elements, respectively.

If the smallest representable value greater than 1 is + + + + + 1 + + + + + + + then + + + + floor + + + + - + log + 2 + + + + + + + + + + + + is returned in precision. + An integer format will have an ∊ of 1, and thus will return 0. + Floating-point formats will return values greater than 0.

Notes

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.

Errors

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.

Associated Gets

glGet + with argument GL_SHADER_COMPILER

See Also

glCompileShader, + glShaderSource

Copyright

+ 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/. +

diff --git a/es2/glGetShaderSource.xml b/es2/glGetShaderSource.xml new file mode 100644 index 00000000..797553e4 --- /dev/null +++ b/es2/glGetShaderSource.xml @@ -0,0 +1,40 @@ + + + + +glGetShaderSource

Name

glGetShaderSource — return the source code string from a shader object

C Specification

void glGetShaderSource(GLuint shader,
 GLsizei bufSize,
 GLsizei *length,
 GLchar *source);
 

Parameters

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.

Description

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.

Errors

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.

Associated Gets

glGetShaderiv + with argument + GL_SHADER_SOURCE_LENGTH

glIsShader

See Also

glCreateShader, + glShaderSource

Copyright

+ 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/. +

diff --git a/es2/glGetShaderiv.xml b/es2/glGetShaderiv.xml new file mode 100644 index 00000000..f10cdf23 --- /dev/null +++ b/es2/glGetShaderiv.xml @@ -0,0 +1,77 @@ + + + + +glGetShaderiv

Name

glGetShaderiv — return a parameter from a shader object

C Specification

void glGetShaderiv(GLuint shader,
 GLenum pname,
 GLint *params);
 

Parameters

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.

Description

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.

Notes

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.

Errors

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.

Associated Gets

glGet + with argument GL_SHADER_COMPILER

glGetShaderInfoLog + with argument shader

glGetShaderSource + with argument shader

glIsShader

See Also

glCompileShader, + glCreateShader, + glDeleteShader, + glGetProgramiv, + glShaderSource, + glShaderBinary

Copyright

+ 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/. +

diff --git a/es2/glGetString.xml b/es2/glGetString.xml new file mode 100644 index 00000000..c131c755 --- /dev/null +++ b/es2/glGetString.xml @@ -0,0 +1,58 @@ + + + + +glGetString

Name

glGetString — return a string describing the current GL connection

C Specification

const GLubyte* glGetString(GLenum name);
 

Parameters

name

+ Specifies a symbolic constant, one of + GL_VENDOR, GL_RENDERER, GL_VERSION, GL_SHADING_LANGUAGE_VERSION, or GL_EXTENSIONS. +

Description

+ 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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if name is not an accepted value. +

Copyright

+ 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/. +

diff --git a/es2/glGetTexParameter.xml b/es2/glGetTexParameter.xml new file mode 100644 index 00000000..f5d8025d --- /dev/null +++ b/es2/glGetTexParameter.xml @@ -0,0 +1,55 @@ + + + + +glGetTexParameter

Name

glGetTexParameter — return texture parameter values

C Specification

void glGetTexParameterfv(GLenum target,
 GLenum pname,
 GLfloat * params);
 
void glGetTexParameteriv(GLenum target,
 GLenum pname,
 GLint * params);
 

Parameters

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. +

Description

+ 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 + s, + a symbolic constant. The initial value is GL_REPEAT. +

GL_TEXTURE_WRAP_T

+ Returns the single-valued wrapping function for texture coordinate + t, + a symbolic constant. The initial value is GL_REPEAT. +

Notes

+ If an error is generated, + no change is made to the contents of params. +

Errors

+ GL_INVALID_ENUM is generated if target or pname is not an + accepted value. +

See Also

+ glTexParameter +

Copyright

+ 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/. +

diff --git a/es2/glGetUniform.xml b/es2/glGetUniform.xml new file mode 100644 index 00000000..bdd82567 --- /dev/null +++ b/es2/glGetUniform.xml @@ -0,0 +1,56 @@ + + + + +glGetUniform

Name

glGetUniform — return the value of a uniform variable

C Specification

void glGetUniformfv(GLuint program,
 GLint location,
 GLfloat *params);
 
void glGetUniformiv(GLuint program,
 GLint location,
 GLint *params);
 

Parameters

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.

Description

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.

Notes

If an error is generated, no change is made to the + contents of params.

Errors

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.

Associated Gets

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

glIsProgram

See Also

glCreateProgram, + glLinkProgram, + glUniform

Copyright

+ 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/. +

diff --git a/es2/glGetUniformLocation.xml b/es2/glGetUniformLocation.xml new file mode 100644 index 00000000..331ca007 --- /dev/null +++ b/es2/glGetUniformLocation.xml @@ -0,0 +1,61 @@ + + + + +glGetUniformLocation

Name

glGetUniformLocation — return the location of a uniform variable

C Specification

GLint glGetUniformLocation(GLuint program,
 const GLchar *name);
 

Parameters

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.

Description

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.

Errors

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.

Associated Gets

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

glIsProgram

See Also

glLinkProgram, + glUniform

Copyright

+ 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/. +

diff --git a/es2/glGetVertexAttrib.xml b/es2/glGetVertexAttrib.xml new file mode 100644 index 00000000..51c2a02a --- /dev/null +++ b/es2/glGetVertexAttrib.xml @@ -0,0 +1,73 @@ + + + + +glGetVertexAttrib

Name

glGetVertexAttrib — return a generic vertex attribute parameter

C Specification

void glGetVertexAttribfv(GLuint index,
 GLenum pname,
 GLfloat *params);
 
void glGetVertexAttribiv(GLuint index,
 GLenum pname,
 GLint *params);
 

Parameters

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.

Description

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.

Notes

If an error is generated, no change is made to the + contents of params.

Errors

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.

Associated Gets

glGet + with argument GL_MAX_VERTEX_ATTRIBS

glGetVertexAttribPointerv + with arguments index and + GL_VERTEX_ATTRIB_ARRAY_POINTER

See Also

glBindAttribLocation, + glBindBuffer, + glDisableVertexAttribArray, + glEnableVertexAttribArray, + glVertexAttrib, + glVertexAttribPointer

Copyright

+ 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/. +

diff --git a/es2/glGetVertexAttribPointerv.xml b/es2/glGetVertexAttribPointerv.xml new file mode 100644 index 00000000..5494641b --- /dev/null +++ b/es2/glGetVertexAttribPointerv.xml @@ -0,0 +1,27 @@ + + + + +glGetVertexAttribPointerv

Name

glGetVertexAttribPointerv — return the address of the specified generic vertex attribute pointer

C Specification

void glGetVertexAttribPointerv(GLuint index,
 GLenum pname,
 GLvoid **pointer);
 

Parameters

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.

Description

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. +

Notes

The pointer returned is client-side state.

The initial value for each pointer is 0.

Errors

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.

Associated Gets

glGet + with argument GL_MAX_VERTEX_ATTRIBS

See Also

glGetVertexAttrib, + glVertexAttribPointer

Copyright

+ 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/. +

diff --git a/es2/glHint.xml b/es2/glHint.xml new file mode 100644 index 00000000..cfc9b747 --- /dev/null +++ b/es2/glHint.xml @@ -0,0 +1,51 @@ + + + + +glHint

Name

glHint — specify implementation-specific hints

C Specification

void glHint(GLenum target,
 GLenum mode);
 

Parameters

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. +

Description

+ 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. +

Notes

+ The interpretation of hints depends on the implementation. + Some implementations ignore glHint settings. +

Errors

+ GL_INVALID_ENUM is generated if either target or mode is not + an accepted value. +

See Also

glGenerateMipmap

Copyright

+ 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/. +

diff --git a/es2/glIsBuffer.xml b/es2/glIsBuffer.xml new file mode 100644 index 00000000..ad95e12f --- /dev/null +++ b/es2/glIsBuffer.xml @@ -0,0 +1,24 @@ + + + + +glIsBuffer

Name

glIsBuffer — determine if a name corresponds to a buffer object

C Specification

GLboolean glIsBuffer(GLuint buffer);
 

Parameters

buffer

+ Specifies a value that may be the name of a buffer object. +

Description

+ 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. +

See Also

+ glBindBuffer, + glDeleteBuffers, + glGenBuffers, + glGet +

Copyright

+ 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/. +

diff --git a/es2/glIsEnabled.xml b/es2/glIsEnabled.xml new file mode 100644 index 00000000..81f91dff --- /dev/null +++ b/es2/glIsEnabled.xml @@ -0,0 +1,69 @@ + + + + +glIsEnabled

Name

glIsEnabled — test whether a capability is enabled

C Specification

GLboolean glIsEnabled(GLenum cap);
 

Parameters

cap

+ Specifies a symbolic constant indicating a GL capability. +

Description

+ 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 +

+

Notes

+ If an error is generated, + glIsEnabled returns 0. +

Errors

+ GL_INVALID_ENUM is generated if cap is not an accepted value. +

See Also

+ glEnable, + glGet +

Copyright

+ 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/. +

diff --git a/es2/glIsFramebuffer.xml b/es2/glIsFramebuffer.xml new file mode 100644 index 00000000..a13cbddd --- /dev/null +++ b/es2/glIsFramebuffer.xml @@ -0,0 +1,23 @@ + + + + +glIsFramebuffer

Name

glIsFramebuffer — determine if a name corresponds to a framebuffer object

C Specification

GLboolean glIsFramebuffer(GLuint framebuffer);
 

Parameters

framebuffer

+ Specifies a value that may be the name of a framebuffer object. +

Description

+ 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. +

See Also

+ glBindFramebuffer, + glDeleteFramebuffers, + glGenFramebuffers +

Copyright

+ 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/. +

diff --git a/es2/glIsProgram.xml b/es2/glIsProgram.xml new file mode 100644 index 00000000..09c20355 --- /dev/null +++ b/es2/glIsProgram.xml @@ -0,0 +1,22 @@ + + + + +glIsProgram

Name

glIsProgram — determine if a name corresponds to a program object

C Specification

GLboolean glIsProgram(GLuint program);
 

Parameters

program

Specifies a potential program object.

Description

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.

Notes

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.

See Also

glCreateProgram, + glDeleteProgram, + glUseProgram

Copyright

+ 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/. +

diff --git a/es2/glIsRenderbuffer.xml b/es2/glIsRenderbuffer.xml new file mode 100644 index 00000000..6b2ad9d1 --- /dev/null +++ b/es2/glIsRenderbuffer.xml @@ -0,0 +1,23 @@ + + + + +glIsRenderbuffer

Name

glIsRenderbuffer — determine if a name corresponds to a renderbuffer object

C Specification

GLboolean glIsRenderbuffer(GLuint renderbuffer);
 

Parameters

renderbuffer

+ Specifies a value that may be the name of a renderbuffer object. +

Description

+ 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. +

See Also

+ glBindRenderbuffer, + glDeleteRenderbuffers, + glGenRenderbuffers +

Copyright

+ 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/. +

diff --git a/es2/glIsShader.xml b/es2/glIsShader.xml new file mode 100644 index 00000000..5f41a2eb --- /dev/null +++ b/es2/glIsShader.xml @@ -0,0 +1,22 @@ + + + + +glIsShader

Name

glIsShader — determine if a name corresponds to a shader object

C Specification

GLboolean glIsShader(GLuint shader);
 

Parameters

shader

Specifies a potential shader object.

Description

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.

Notes

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.

See Also

glCreateShader, + glDeleteShader

Copyright

+ 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/. +

diff --git a/es2/glIsTexture.xml b/es2/glIsTexture.xml new file mode 100644 index 00000000..f8f69380 --- /dev/null +++ b/es2/glIsTexture.xml @@ -0,0 +1,28 @@ + + + + +glIsTexture

Name

glIsTexture — determine if a name corresponds to a texture

C Specification

GLboolean glIsTexture(GLuint texture);
 

Parameters

texture

+ Specifies a value that may be the name of a texture. +

Description

+ 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. +

See Also

+ glBindTexture, + glCopyTexImage2D, + glDeleteTextures, + glGenTextures, + glGet, + glGetTexParameter, + glTexImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es2/glLineWidth.xml b/es2/glLineWidth.xml new file mode 100644 index 00000000..91a047f0 --- /dev/null +++ b/es2/glLineWidth.xml @@ -0,0 +1,63 @@ + + + + +glLineWidth

Name

glLineWidth — specify the width of rasterized lines

C Specification

void glLineWidth(GLfloat width);
 

Parameters

width

+ Specifies the width of rasterized lines. + The initial value is 1. +

Description

+ 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 + + + + + + Δ + x + + + >= + + + Δ + y + + + + , + 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. +

+ 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. +

Notes

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if width is less than or equal to 0. +

Associated Gets

+ glGet with argument GL_LINE_WIDTH +

+ glGet with argument GL_ALIASED_LINE_WIDTH_RANGE +

See Also

+ glEnable +

Copyright

+ 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/. +

diff --git a/es2/glLinkProgram.xml b/es2/glLinkProgram.xml new file mode 100644 index 00000000..7ec96f86 --- /dev/null +++ b/es2/glLinkProgram.xml @@ -0,0 +1,107 @@ + + + + +glLinkProgram

Name

glLinkProgram — link a program object

C Specification

void glLinkProgram(GLuint program);
 

Parameters

program

Specifies the handle of the program object to be linked.

Description

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.

Notes

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.

Errors

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.

Associated Gets

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

glIsProgram

See Also

glAttachShader, + glBindAttribLocation, + glCompileShader, + glShaderBinary, + glCreateProgram, + glDeleteProgram, + glDetachShader, + glUniform, + glUseProgram, + glValidateProgram

Copyright

+ 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/. +

diff --git a/es2/glPixelStorei.xml b/es2/glPixelStorei.xml new file mode 100644 index 00000000..58eaf412 --- /dev/null +++ b/es2/glPixelStorei.xml @@ -0,0 +1,87 @@ + + + + +glPixelStorei

Name

glPixelStorei — set pixel storage modes

C Specification

void glPixelStorei(GLenum pname,
 GLint param);
 

Parameters

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. +

Description

+ 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. +

Errors

+ 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. +

Associated Gets

+ glGet with argument + GL_PACK_ALIGNMENT or GL_UNPACK_ALIGNMENT +

See Also

+ glReadPixels, + glTexImage2D, + glTexSubImage2D +

Copyright

+ 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/. +

diff --git a/es2/glPolygonOffset.xml b/es2/glPolygonOffset.xml new file mode 100644 index 00000000..34da0926 --- /dev/null +++ b/es2/glPolygonOffset.xml @@ -0,0 +1,63 @@ + + + + +glPolygonOffset

Name

glPolygonOffset — set the scale and units used to calculate depth values

C Specification

void glPolygonOffset(GLfloat factor,
 GLfloat units);
 

Parameters

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. +

Description

+ 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 + + + + + factor + × + DZ + + + + + r + × + units + + + , + where + + + DZ + + 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 rendering hidden-line images, for applying decals + to surfaces, and for rendering solids with highlighted edges. +

Associated Gets

+ glIsEnabled with argument + GL_POLYGON_OFFSET_FILL. +

+ glGet with argument GL_POLYGON_OFFSET_FACTOR or + GL_POLYGON_OFFSET_UNITS. +

See Also

+ glDepthFunc, + glEnable, + glGet, + glIsEnabled +

Copyright

+ 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/. +

diff --git a/es2/glReadPixels.xml b/es2/glReadPixels.xml new file mode 100644 index 00000000..27af9cde --- /dev/null +++ b/es2/glReadPixels.xml @@ -0,0 +1,218 @@ + + + + +glReadPixels

Name

glReadPixels — read a block of pixels from the frame buffer

C Specification

void glReadPixels(GLint x,
 GLint y,
 GLsizei width,
 GLsizei height,
 GLenum format,
 GLenum type,
 GLvoid * data);
 

Parameters

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. +

Description

+ 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 + + + + + x + + + i + + + y + + + j + + + + for + + + + 0 + <= + i + < + width + + + and + + + + 0 + <= + j + < + height + + . + This pixel is said to be the + ith + pixel in the + jth + row. + Pixels are returned in row order from the lowest to the highest row, + left to right in each row. +

+ 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 + + + + 0 + 1 + + . +

+ Finally, the components + are converted to the proper format, + as specified by type. + When type is GL_UNSIGNED_BYTE, + each component is multiplied by + + + + 2 + 8 + + - + 1 + + . + When 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 + + + + 2 + N + + - + 1 + + , + where N + is the number of bits in the bitfield. +

+ Return values are placed in memory as follows. + If format is + GL_ALPHA, + a single value is returned and the data for the + ith + pixel in the + jth + row + is placed in location + + + + + j + + + width + + + i + + . + 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. +

Notes

+ 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. +

Errors

+ 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). +

Associated Gets

+ glGet with argument + GL_IMPLEMENTATION_COLOR_READ_FORMAT + or GL_IMPLEMENTATION_COLOR_READ_TYPE +

+ glGet with argument GL_PACK_ALIGNMENT +

See Also

+ glCheckFramebufferStatus, + glPixelStorei +

Copyright

+ 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/. +

diff --git a/es2/glReleaseShaderCompiler.xml b/es2/glReleaseShaderCompiler.xml new file mode 100644 index 00000000..c541decf --- /dev/null +++ b/es2/glReleaseShaderCompiler.xml @@ -0,0 +1,29 @@ + + + + +glReleaseShaderCompiler

Name

glReleaseShaderCompiler — release resources allocated by the shader compiler

C Specification

void glReleaseShaderCompiler( void);
 

Description

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.

Notes

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.

Errors

GL_INVALID_OPERATION is generated if + a shader compiler is not supported.

Associated Gets

glGet + with argument GL_SHADER_COMPILER

See Also

glCompileShader, + glShaderSource

Copyright

+ 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/. +

diff --git a/es2/glRenderbufferStorage.xml b/es2/glRenderbufferStorage.xml new file mode 100644 index 00000000..8aceab9f --- /dev/null +++ b/es2/glRenderbufferStorage.xml @@ -0,0 +1,39 @@ + + + + +glRenderbufferStorage

Name

glRenderbufferStorage — create and initialize a renderbuffer object's data store

C Specification

void glRenderbufferStorage(GLenum target,
 GLenum internalformat,
 GLsizei width,
 GLsizei height);
 

Parameters

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.

Description

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.

Errors

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.

Associated Gets

glGetRenderbufferParameteriv

See Also

glBindRenderbuffer, + glDeleteRenderbuffers, + glFramebufferRenderbuffer, + glGenRenderbuffers, + glGetRenderbufferParameteriv, + glIsRenderbuffer

Copyright

+ 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/. +

diff --git a/es2/glSampleCoverage.xml b/es2/glSampleCoverage.xml new file mode 100644 index 00000000..28a9dff5 --- /dev/null +++ b/es2/glSampleCoverage.xml @@ -0,0 +1,55 @@ + + + + +glSampleCoverage

Name

glSampleCoverage — specify multisample coverage parameters

C Specification

void glSampleCoverage(GLclampf value,
 GLboolean invert);
 

Parameters

value

+ Specify a single floating-point sample coverage value. The value is + clamped to the range + + + + 0 + 1 + + . + 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. +

Description

+ 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. +

Associated Gets

+ 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 +

See Also

+ glEnable +

Copyright

+ 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/. +

diff --git a/es2/glScissor.xml b/es2/glScissor.xml new file mode 100644 index 00000000..64349af5 --- /dev/null +++ b/es2/glScissor.xml @@ -0,0 +1,48 @@ + + + + +glScissor

Name

glScissor — define the scissor box

C Specification

void glScissor(GLint x,
 GLint y,
 GLsizei width,
 GLsizei height);
 

Parameters

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. +

Description

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if either width or height is negative. +

Associated Gets

+ glGet with argument GL_SCISSOR_BOX +

+ glIsEnabled with argument GL_SCISSOR_TEST +

See Also

+ glEnable, + glViewport +

Copyright

+ 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/. +

diff --git a/es2/glShaderBinary.xml b/es2/glShaderBinary.xml new file mode 100644 index 00000000..4b125d95 --- /dev/null +++ b/es2/glShaderBinary.xml @@ -0,0 +1,59 @@ + + + + +glShaderBinary

Name

glShaderBinary — load a precompiled shader binary

C Specification

void glShaderBinary(GLsizei n,
 const GLuint *shaders,
 GLenum binaryformat,
 const void *binary,
 GLsizei length);
 

Parameters

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.

Description

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.

Notes

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.

Errors

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.

Associated Gets

glGet + with arguments GL_NUM_SHADER_BINARY_FORMATS + and GL_SHADER_BINARY_FORMATS

glIsShader

See Also

glCreateShader, + glDeleteShader, + glLinkProgram

Copyright

+ 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/. +

diff --git a/es2/glShaderSource.xml b/es2/glShaderSource.xml new file mode 100644 index 00000000..9fa41b53 --- /dev/null +++ b/es2/glShaderSource.xml @@ -0,0 +1,57 @@ + + + + +glShaderSource

Name

glShaderSource — replace the source code in a shader object

C Specification

void glShaderSource(GLuint shader,
 GLsizei count,
 const GLchar * const *string,
 const GLint *length);
 

Parameters

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.

Description

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.

Notes

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.

Errors

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.

Associated Gets

glGet + with argument GL_SHADER_COMPILER

glGetShaderiv + with arguments shader and + GL_SHADER_SOURCE_LENGTH

glGetShaderSource + with argument shader

glIsShader

See Also

glCompileShader, + glGetShaderPrecisionFormat, + glCreateShader, + glDeleteShader

Copyright

+ 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/. +

diff --git a/es2/glStencilFunc.xml b/es2/glStencilFunc.xml new file mode 100644 index 00000000..844db3f7 --- /dev/null +++ b/es2/glStencilFunc.xml @@ -0,0 +1,170 @@ + + + + +glStencilFunc

Name

glStencilFunc — set front and back function and reference value for stencil testing

C Specification

void glStencilFunc(GLenum func,
 GLint ref,
 GLuint mask);
 

Parameters

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 + + + + 0 + + 2 + n + + - + 1 + + + , + where + 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. +

Description

+ 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 + + + + 0 + + 2 + n + + - + 1 + + + , + where + 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 + + + + 0 + + 2 + n + + - + 1 + + + , + where + 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 ( 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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if func is not one of the eight + accepted values. +

Associated Gets

+ 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 +

See Also

+ glBlendFunc, + glDepthFunc, + glEnable, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +

Copyright

+ 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/. +

diff --git a/es2/glStencilFuncSeparate.xml b/es2/glStencilFuncSeparate.xml new file mode 100644 index 00000000..0ab4ead2 --- /dev/null +++ b/es2/glStencilFuncSeparate.xml @@ -0,0 +1,177 @@ + + + + +glStencilFuncSeparate

Name

glStencilFuncSeparate — set front and/or back function and reference value for stencil testing

C Specification

void glStencilFuncSeparate(GLenum face,
 GLenum func,
 GLint ref,
 GLuint mask);
 

Parameters

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 + + + + 0 + + 2 + n + + - + 1 + + + , + where + 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. +

Description

+ 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 + + + + 0 + + 2 + n + + - + 1 + + + , + where + 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 + + + + 0 + + 2 + n + + - + 1 + + + , + where + 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 ( 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. +

Notes

+ 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. +

Errors

+ 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. +

Associated Gets

+ 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 +

See Also

+ glBlendFunc, + glDepthFunc, + glEnable, + glStencilFunc, + glStencilMask, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +

Copyright

+ 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/. +

diff --git a/es2/glStencilMask.xml b/es2/glStencilMask.xml new file mode 100644 index 00000000..be5d62c9 --- /dev/null +++ b/es2/glStencilMask.xml @@ -0,0 +1,50 @@ + + + + +glStencilMask

Name

glStencilMask — control the front and back writing of individual bits in the stencil planes

C Specification

void glStencilMask(GLuint mask);
 

Parameters

mask

+ Specifies a bit mask to enable and disable writing of individual bits + in the stencil planes. + Initially, the mask is all 1's. +

Description

+ 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. +

+ 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. +

Notes

+ glStencilMask is the same as + calling glStencilMaskSeparate + with face set to GL_FRONT_AND_BACK. +

Associated Gets

+ glGet with argument + GL_STENCIL_WRITEMASK, GL_STENCIL_BACK_WRITEMASK, + or GL_STENCIL_BITS +

See Also

+ glColorMask, + glDepthMask, + glStencilFunc, + glStencilFuncSeparate, + glStencilMaskSeparate, + glStencilOp, + glStencilOpSeparate +

Copyright

+ 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/. +

diff --git a/es2/glStencilMaskSeparate.xml b/es2/glStencilMaskSeparate.xml new file mode 100644 index 00000000..262a51e6 --- /dev/null +++ b/es2/glStencilMaskSeparate.xml @@ -0,0 +1,57 @@ + + + + +glStencilMaskSeparate

Name

glStencilMaskSeparate — control the front and/or back writing of individual bits in the stencil planes

C Specification

void glStencilMaskSeparate(GLenum face,
 GLuint mask);
 

Parameters

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. +

Description

+ glStencilMaskSeparate 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. +

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if face is + not GL_FRONT, GL_BACK, or + GL_FRONT_AND_BACK. +

Associated Gets

+ glGet with argument + GL_STENCIL_WRITEMASK, GL_STENCIL_BACK_WRITEMASK, + or GL_STENCIL_BITS +

See Also

+ glColorMask, + glDepthMask, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilOp, + glStencilOpSeparate +

Copyright

+ 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/. +

diff --git a/es2/glStencilOp.xml b/es2/glStencilOp.xml new file mode 100644 index 00000000..976801d1 --- /dev/null +++ b/es2/glStencilOp.xml @@ -0,0 +1,148 @@ + + + + +glStencilOp

Name

glStencilOp — set front and back stencil test actions

C Specification

void glStencilOp(GLenum sfail,
 GLenum dpfail,
 GLenum dppass);
 

Parameters

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. +

Description

+ 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 + + + + 2 + n + + - + 1 + + , + where + 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 (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. +

Notes

+ 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. +

Errors

+ GL_INVALID_ENUM is generated if sfail, + dpfail, or dppass is any value other + than the eight defined symbolic constant values. +

Associated Gets

+ 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 +

See Also

+ glBlendFunc, + glDepthFunc, + glEnable, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOpSeparate +

Copyright

+ 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/. +

diff --git a/es2/glStencilOpSeparate.xml b/es2/glStencilOpSeparate.xml new file mode 100644 index 00000000..019b2278 --- /dev/null +++ b/es2/glStencilOpSeparate.xml @@ -0,0 +1,153 @@ + + + + +glStencilOpSeparate

Name

glStencilOpSeparate — set front and/or back stencil test actions

C Specification

void glStencilOpSeparate(GLenum face,
 GLenum sfail,
 GLenum dpfail,
 GLenum dppass);
 

Parameters

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. +

Description

+ 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 + + + + 2 + n + + - + 1 + + , + where + n + is the value returned by querying 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. +

Notes

+ 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. +

Errors

+ 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. +

Associated Gets

+ 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 +

See Also

+ glBlendFunc, + glDepthFunc, + glEnable, + glStencilFunc, + glStencilFuncSeparate, + glStencilMask, + glStencilMaskSeparate, + glStencilOp +

Copyright

+ 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/. +

diff --git a/es2/glTexImage2D.xml b/es2/glTexImage2D.xml new file mode 100644 index 00000000..9fcac345 --- /dev/null +++ b/es2/glTexImage2D.xml @@ -0,0 +1,256 @@ + + + + +glTexImage2D

Name

glTexImage2D — specify a two-dimensional texture image

C Specification

void glTexImage2D(GLenum target,
 GLint level,
 GLint internalformat,
 GLsizei width,
 GLsizei height,
 GLint border,
 GLenum format,
 GLenum type,
 const GLvoid * data);
 

+

Parameters

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. +

Description

+ 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. +

+ + + + width + × + height + + + texels are read from memory, + starting at location 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 + + + + 2 + 8 + + - + 1 + + . + When 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 + + + + 2 + N + + - + 1 + + , + where N + is the number of bits in the bitfield. +

Notes

+ 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. +

Errors

+ 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 + + + + log + 2 + + + + max + + + , + where max is the returned value of + 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. +

Associated Gets

+ glGet + with argument GL_MAX_TEXTURE_SIZE or + GL_MAX_CUBE_MAP_TEXTURE_SIZE +

See Also

+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glPixelStorei, + glTexSubImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es2/glTexParameter.xml b/es2/glTexParameter.xml new file mode 100644 index 00000000..3c9a7318 --- /dev/null +++ b/es2/glTexParameter.xml @@ -0,0 +1,404 @@ + + + + +glTexParameter

Name

glTexParameter — set texture parameters

C Specification

void glTexParameterf(GLenum target,
 GLenum pname,
 GLfloat param);
 
void glTexParameteri(GLenum target,
 GLenum pname,
 GLint param);
 

Parameters

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. +

C Specification

void glTexParameterfv(GLenum target,
 GLenum pname,
 const GLfloat * params);
 
void glTexParameteriv(GLenum target,
 GLenum pname,
 const GLint * params);
 

Parameters

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. +

Description

+ 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 + (s, + t) + coordinate system. + A texture is a two-dimensional or cube-mapped image and a set of parameters + that determine how samples are derived from the image. +

+ 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 + + + + w + × + h + + , + there are + + + + + floor + + + + log + 2 + + + + + max + + + w + h + + + + + + + + + 1 + + + mipmap levels. + The first mipmap level is the original texture, + with dimensions + + + + w + × + h + + . + Each subsequent mipmap level has dimensions + + + + max + + + 1 + + floor + + + + w + 2 + i + + + + + + × + max + + + 1 + + floor + + + + h + 2 + i + + + + + + + , + where + + + i + + is the mipmap level, + until the final mipmap is reached, + which has dimension + + + + 1 + × + 1 + + . +

+ 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 + + + + floor + + + + log + 2 + + + + + max + + + w + h + + + + + + + + is the final + + + + 1 + × + 1 + + + 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_WRAP_S

+ Sets the wrap parameter for texture coordinate + s + to either GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or + GL_REPEAT. GL_CLAMP_TO_EDGE causes + s + coordinates to be clamped to the + range + + + + + + + 1 + 2N + + + + + 1 + - + + + + 1 + 2N + + + + + + , + where + 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. + GL_MIRRORED_REPEAT causes the + s + coordinate to be set to the + fractional part of the texture coordinate if the integer part of + s + is + even; if the integer part of + s + is odd, then the + s + texture coordinate is + set to + + + + 1 + - + + frac + + + s + + + + , + where + + + + frac + + + s + + + + represents the fractional part of + s. + Initially, + GL_TEXTURE_WRAP_S is set to GL_REPEAT. +

+

GL_TEXTURE_WRAP_T

+ Sets the wrap parameter for texture coordinate + t + 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. +

Notes

+ 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. +

Errors

+ 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. +

Associated Gets

+ glGetTexParameter +

See Also

+ glActiveTexture, + glBindTexture, + glCopyTexImage2D, + glCopyTexSubImage2D, + glPixelStorei, + glTexImage2D, + glTexSubImage2D +

Copyright

+ 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/. +

diff --git a/es2/glTexSubImage2D.xml b/es2/glTexSubImage2D.xml new file mode 100644 index 00000000..507da892 --- /dev/null +++ b/es2/glTexSubImage2D.xml @@ -0,0 +1,204 @@ + + + + +glTexSubImage2D

Name

glTexSubImage2D — specify a two-dimensional texture subimage

C Specification

void glTexSubImage2D(GLenum target,
 GLint level,
 GLint xoffset,
 GLint yoffset,
 GLsizei width,
 GLsizei height,
 GLenum format,
 GLenum type,
 const GLvoid * data);
 

+

Parameters

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. +

Description

+ 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 + + + + xoffset + + + width + - + 1 + + , + inclusive, + and y indices yoffset and + + + + yoffset + + + height + - + 1 + + , + inclusive. + This region may not include any texels outside the range of 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. +

Notes

+ 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. +

Errors

+ 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 + + + log + 2 + + + max, + where max is the returned value of GL_MAX_TEXTURE_SIZE. +

+ GL_INVALID_VALUE is generated if + + + + xoffset + < + 0 + + , + + + + + + xoffset + + + width + + + > + w + + , + + + + yoffset + < + 0 + + , + or + + + + + + yoffset + + + height + + + > + h + + , + where + w + is the width and + h + is the 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 + 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. +

Associated Gets

+ glGet + with argument GL_MAX_TEXTURE_SIZE or + GL_MAX_CUBE_MAP_TEXTURE_SIZE +

See Also

+ glActiveTexture, + glCompressedTexImage2D, + glCompressedTexSubImage2D, + glCopyTexImage2D, + glCopyTexSubImage2D, + glPixelStorei, + glTexImage2D, + glTexParameter +

Copyright

+ 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/. +

diff --git a/es2/glUniform.xml b/es2/glUniform.xml new file mode 100644 index 00000000..923d0e04 --- /dev/null +++ b/es2/glUniform.xml @@ -0,0 +1,152 @@ + + + + +glUniform

Name

glUniform — specify the value of a uniform variable for the current program object

C Specification

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);
 

Parameters

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.

C Specification

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);
 

Parameters

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.

C Specification

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);
 

Parameters

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.

Description

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.

Notes

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.

Errors

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.

Associated Gets

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

See Also

glLinkProgram, + glUseProgram

Copyright

+ 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/. +

diff --git a/es2/glUseProgram.xml b/es2/glUseProgram.xml new file mode 100644 index 00000000..8b5c661a --- /dev/null +++ b/es2/glUseProgram.xml @@ -0,0 +1,81 @@ + + + + +glUseProgram

Name

glUseProgram — install a program object as part of current rendering state

C Specification

void glUseProgram(GLuint program);
 

Parameters

program

Specifies the handle of the program object + whose executables are to be used as part of current + rendering state.

Description

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.

Notes

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.

Errors

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.

Associated Gets

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

glIsProgram

See Also

glAttachShader, + glBindAttribLocation, + glCompileShader, + glCreateProgram, + glDeleteProgram, + glDetachShader, + glLinkProgram, + glUniform, + glValidateProgram, + glVertexAttrib

Copyright

+ 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/. +

diff --git a/es2/glValidateProgram.xml b/es2/glValidateProgram.xml new file mode 100644 index 00000000..3723e275 --- /dev/null +++ b/es2/glValidateProgram.xml @@ -0,0 +1,55 @@ + + + + +glValidateProgram

Name

glValidateProgram — validate a program object

C Specification

void glValidateProgram(GLuint program);
 

Parameters

program

Specifies the handle of the program object to + be validated.

Description

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.

Notes

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.

Errors

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.

Associated Gets

glGetProgramiv + with arguments program and + GL_VALIDATE_STATUS

glGetProgramInfoLog + with argument program

glIsProgram

See Also

glLinkProgram, + glUseProgram

Copyright

+ 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/. +

diff --git a/es2/glVertexAttrib.xml b/es2/glVertexAttrib.xml new file mode 100644 index 00000000..ca85c5ff --- /dev/null +++ b/es2/glVertexAttrib.xml @@ -0,0 +1,90 @@ + + + + +glVertexAttrib

Name

glVertexAttrib — specify the value of a generic vertex attribute

C Specification

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);
 

Parameters

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.

C Specification

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);
 

Parameters

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.

Description

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.

Notes

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.

Errors

GL_INVALID_VALUE is generated if + index is greater than or equal to + GL_MAX_VERTEX_ATTRIBS.

Associated Gets

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

See Also

glBindAttribLocation, + glVertexAttribPointer

Copyright

+ 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/. +

diff --git a/es2/glVertexAttribPointer.xml b/es2/glVertexAttribPointer.xml new file mode 100644 index 00000000..592b748f --- /dev/null +++ b/es2/glVertexAttribPointer.xml @@ -0,0 +1,88 @@ + + + + +glVertexAttribPointer

Name

glVertexAttribPointer — define an array of generic vertex attribute data

C Specification

void glVertexAttribPointer(GLuint index,
 GLint size,
 GLenum type,
 GLboolean normalized,
 GLsizei stride,
 const GLvoid * pointer);
 

Parameters

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.

Description

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.

Notes

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.

Errors

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.

Associated Gets

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

See Also

glBindAttribLocation, + glBindBuffer, + glDisableVertexAttribArray, + glDrawArrays, + glDrawElements, + glEnableVertexAttribArray, + glVertexAttrib

Copyright

+ 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/. +

diff --git a/es2/glViewport.xml b/es2/glViewport.xml new file mode 100644 index 00000000..8c38edcb --- /dev/null +++ b/es2/glViewport.xml @@ -0,0 +1,125 @@ + + + + +glViewport

Name

glViewport — set the viewport

C Specification

void glViewport(GLint x,
 GLint y,
 GLsizei width,
 GLsizei height);
 

Parameters

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. +

Description

+ glViewport specifies the affine transformation of + x + and + y + from + normalized device coordinates to window coordinates. + Let + + + + x + nd + + y + nd + + + + be normalized device coordinates. + Then the window coordinates + + + + x + w + + y + w + + + + are computed as follows: +

+

+ + + x + w + + = + + + + x + nd + + + + 1 + + + + + + width + 2 + + + + + x + + +

+

+

+ + + y + w + + = + + + + y + nd + + + + 1 + + + + + + height + 2 + + + + + y + + +

+

+ 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. +

Errors

+ GL_INVALID_VALUE is generated if either width or height is negative. +

Associated Gets

+ glGet with argument GL_VIEWPORT +

+ glGet with argument GL_MAX_VIEWPORT_DIMS +

See Also

+ glDepthRangef +

Copyright

+ 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/. +

diff --git a/es3/abs.xhtml b/es3/abs.xhtml new file mode 100644 index 00000000..9ca042a3 --- /dev/null +++ b/es3/abs.xhtml @@ -0,0 +1,141 @@ + + + + abs - OpenGL ES 3 Reference Pages + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +