If a non-zero named buffer object is bound to the ?GL_ARRAY_BUFFER target (see gl:bindBuffer/2 ) while a secondary color 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 secondary color vertex array client-side state (?GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING ).
When a secondary color array is specified, Size , Type , Stride , and Pointer are saved as client-side state, in addition to the current vertex array buffer object binding.
To enable and disable the secondary color array, call gl:enableClientState/1 and gl:enableClientState/1 with the argument ?GL_SECONDARY_COLOR_ARRAY. If enabled, the secondary color array is used when gl:arrayElement/1 , gl:drawArrays/3 , gl:multiDrawArrays/3 , gl:drawElements/4 , see glMultiDrawElements, or gl:drawRangeElements/6 is called.
See external documentation.
Types
Specify the raster position in window coordinates for pixel operations
The GL maintains a 3D position in window coordinates. This position, called the raster position, is used to position pixel and bitmap write operations. It is maintained with subpixel accuracy. See gl:bitmap/7 , gl:drawPixels/5 , and gl:copyPixels/5 .
gl:windowPos2 specifies the x and y coordinates, while z is implicitly set to 0. gl:windowPos3 specifies all three coordinates. The w coordinate of the current raster position is always set to 1.0.
gl:windowPos directly updates the x and y coordinates of the current raster position with the values specified. That is, the values are neither transformed by the current modelview and projection matrices, nor by the viewport-to-window transform. The z coordinate of the current raster position is updated in the following manner:
z={n f(n+z×(f-n)) if z<= 0 if z>= 1(otherwise))
where n is ?GL_DEPTH_RANGE's near value, and f is ?GL_DEPTH_RANGE's far value. See gl:depthRange/2 .
The specified coordinates are not clip-tested, causing the raster position to always be valid.
The current raster position also includes some associated color data and texture coordinates. If lighting is enabled, then ?GL_CURRENT_RASTER_COLOR (in RGBA mode) or ?GL_CURRENT_RASTER_INDEX (in color index mode) is set to the color produced by the lighting calculation (see gl:lightf/3 , gl:lightModelf/2 , and gl:shadeModel/1 ). If lighting is disabled, current color (in RGBA mode, state variable ?GL_CURRENT_COLOR) or color index (in color index mode, state variable ?GL_CURRENT_INDEX) is used to update the current raster color. ?GL_CURRENT_RASTER_SECONDARY_COLOR (in RGBA mode) is likewise updated.
Likewise, ?GL_CURRENT_RASTER_TEXTURE_COORDS is updated as a function of ?GL_CURRENT_TEXTURE_COORDS , based on the texture matrix and the texture generation functions (see gl:texGend/3 ). The ?GL_CURRENT_RASTER_DISTANCE is set to the ?GL_CURRENT_FOG_COORD.
See external documentation.
Types
Equivalent to windowPos2d(X, Y).
Types
See windowPos2d/2
Types
Equivalent to windowPos2f(X, Y).
Types
See windowPos2d/2
Types
Equivalent to windowPos2i(X, Y).
Types
See windowPos2d/2
Types
Equivalent to windowPos2s(X, Y).
Types
See windowPos2d/2
Types
Equivalent to windowPos3d(X, Y, Z).
Types
See windowPos2d/2
Types
Equivalent to windowPos3f(X, Y, Z).
Types
See windowPos2d/2
Types
Equivalent to windowPos3i(X, Y, Z).
Types
See windowPos2d/2
Types
Equivalent to windowPos3s(X, Y, Z).
Types
Generate query object names
gl:genQueries returns N query object names in Ids . There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genQueries.
Query object names returned by a call to gl:genQueries are not returned by subsequent calls, unless they are first deleted with gl:deleteQueries/1 .
No query objects are associated with the returned query object names until they are first used by calling gl:beginQuery/2 .
See external documentation.
Types
Delete named query objects
gl:deleteQueries deletes N query objects named by the elements of the array Ids . After a query object is deleted, it has no contents, and its name is free for reuse (for example by gl:genQueries/1 ).
gl:deleteQueries silently ignores 0's and names that do not correspond to existing query objects.
See external documentation.
Types
Determine if a name corresponds to a query object
gl:isQuery returns ?GL_TRUE if Id is currently the name of a query object. If Id is zero, or is a non-zero value that is not currently the name of a query object, or if an error occurs, gl:isQuery returns ?GL_FALSE.
A name returned by gl:genQueries/1 , but not yet associated with a query object by calling gl:beginQuery/2 , is not the name of a query object.
See external documentation.
Delimit the boundaries of a query object
gl:beginQuery and gl:beginQuery/2 delimit the boundaries of a query object. Query must be a name previously returned from a call to gl:genQueries/1 . If a query object with name Id does not yet exist it is created with the type determined by Target . Target must be one of ?GL_SAMPLES_PASSED, ?GL_ANY_SAMPLES_PASSED, ?GL_PRIMITIVES_GENERATED , ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or ?GL_TIME_ELAPSED. The behavior of the query object depends on its type and is as follows.
If Target is ?GL_SAMPLES_PASSED, Id must be an unused name, or the name of an existing occlusion query object. When gl:beginQuery is executed, the query object's samples-passed counter is reset to 0. Subsequent rendering will increment the counter for every sample that passes the depth test. If the value of ?GL_SAMPLE_BUFFERS is 0, then the samples-passed count is incremented by 1 for each fragment. If the value of ?GL_SAMPLE_BUFFERS is 1, then the samples-passed count is incremented by the number of samples whose coverage bit is set. However, implementations, at their discression may instead increase the samples-passed count by the value of ?GL_SAMPLES if any sample in the fragment is covered. When gl:endQuery is executed, the samples-passed counter is assigned to the query object's result value. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT.
If Target is ?GL_ANY_SAMPLES_PASSED, Id must be an unused name, or the name of an existing boolean occlusion query object. When gl:beginQuery is executed, the query object's samples-passed flag is reset to ?GL_FALSE. Subsequent rendering causes the flag to be set to ?GL_TRUE if any sample passes the depth test. When gl:endQuery is executed, the samples-passed flag is assigned to the query object's result value. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT.
If Target is ?GL_PRIMITIVES_GENERATED, Id must be an unused name, or the name of an existing primitive query object previously bound to the ?GL_PRIMITIVES_GENERATED query binding. When gl:beginQuery is executed, the query object's primitives-generated counter is reset to 0. Subsequent rendering will increment the counter once for every vertex that is emitted from the geometry shader, or from the vertex shader if no geometry shader is present. When gl:endQuery is executed, the primitives-generated counter is assigned to the query object's result value. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT.
If Target is ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, Id must be an unused name, or the name of an existing primitive query object previously bound to the ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN query binding. When gl:beginQuery is executed, the query object's primitives-written counter is reset to 0. Subsequent rendering will increment the counter once for every vertex that is written into the bound transform feedback buffer(s). If transform feedback mode is not activated between the call to gl:beginQuery and gl:endQuery, the counter will not be incremented. When gl:endQuery is executed, the primitives-written counter is assigned to the query object's result value. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT.
If Target is ?GL_TIME_ELAPSED, Id must be an unused name, or the name of an existing timer query object previously bound to the ?GL_TIME_ELAPSED query binding. When gl:beginQuery is executed, the query object's time counter is reset to 0. When gl:endQuery is executed, the elapsed server time that has passed since the call to gl:beginQuery is written into the query object's time counter. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT .
Querying the ?GL_QUERY_RESULT implicitly flushes the GL pipeline until the rendering delimited by the query object has completed and the result is available. ?GL_QUERY_RESULT_AVAILABLE can be queried to determine if the result is immediately available or if the rendering is not yet complete.
See external documentation.
Types
See beginQuery/2
getQueryiv(Target, Pname) -> integer()
getQueryObjectiv(Id, Pname) -> integer()
Return parameters of a query object
gl:getQueryObject returns in Params a selected parameter of the query object specified by Id .
Pname names a specific query object parameter. Pname can be as follows:
?GL_QUERY_RESULT: Params returns the value of the query object's passed samples counter. The initial value is 0.
?GL_QUERY_RESULT_AVAILABLE: Params returns whether the passed samples counter is immediately available. If a delay would occur waiting for the query result, ?GL_FALSE is returned. Otherwise, ?GL_TRUE is returned, which also indicates that the results of all previous queries are available as well.
See external documentation.
getQueryObjectuiv(Id, Pname) -> integer()
bindBuffer(Target, Buffer) -> ok
Bind a named buffer object
gl:bindBuffer binds a buffer object to the specified buffer binding point. Calling gl:bindBuffer with Target set to one of the accepted symbolic constants and Buffer set to the name of a buffer object binds that buffer object name to the target. If no buffer object with name Buffer exists, one is created with that name. When a buffer object is bound to a target, the previous binding for that target is automatically broken.
Buffer object names are unsigned integers. The value zero is reserved, but there is no default buffer object for each buffer object target. Instead, Buffer set to zero effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target (if supported for that target). Buffer object names and the corresponding buffer object contents are local to the shared object space of the current GL rendering context; two rendering contexts share buffer object names only if they explicitly enable sharing between contexts through the appropriate GL windows interfaces functions.
gl:genBuffers/1 must be used to generate a set of unused buffer object names.
The state of a buffer object immediately after it is first bound is an unmapped zero-sized memory buffer with ?GL_READ_WRITE access and ?GL_STATIC_DRAW usage.
While a non-zero buffer object name is bound, GL operations on the target to which it is bound affect the bound buffer object, and queries of the target to which it is bound return state from the bound buffer object. While buffer object name zero is bound, as in the initial state, attempts to modify or query state on the target to which it is bound generates an ?GL_INVALID_OPERATION error.
When a non-zero buffer object is bound to the ?GL_ARRAY_BUFFER target, the vertex array pointer parameter is interpreted as an offset within the buffer object measured in basic machine units.
When a non-zero buffer object is bound to the ?GL_DRAW_INDIRECT_BUFFER target, parameters for draws issued through gl:drawArraysIndirect/2 and gl:drawElementsIndirect/3 are sourced from that buffer object.
While a non-zero buffer object is bound to the ?GL_ELEMENT_ARRAY_BUFFER target, the indices parameter of gl:drawElements/4 , gl:drawElementsInstanced/5 , gl:drawElementsBaseVertex/5 , gl:drawRangeElements/6 , gl:drawRangeElementsBaseVertex/7 , see glMultiDrawElements , or see glMultiDrawElementsBaseVertex is interpreted as an offset within the buffer object measured in basic machine units.
While a non-zero buffer object is bound to the ?GL_PIXEL_PACK_BUFFER target, the following commands are affected: gl:getCompressedTexImage/3 , gl:getTexImage/5 , and gl:readPixels/7 . The pointer parameter is interpreted as an offset within the buffer object measured in basic machine units.
While a non-zero buffer object is bound to the ?GL_PIXEL_UNPACK_BUFFER target, the following commands are affected: gl:compressedTexImage1D/7 , gl:compressedTexImage2D/8 , gl:compressedTexImage3D/9 , gl:compressedTexSubImage1D/7 , gl:compressedTexSubImage2D/9 , gl:compressedTexSubImage3D/11 , gl:texImage1D/8 , gl:texImage2D/9 , gl:texImage3D/10 , gl:texSubImage1D/7 , gl:texSubImage1D/7 , and gl:texSubImage1D/7 . The pointer parameter is interpreted as an offset within the buffer object measured in basic machine units.
The buffer targets ?GL_COPY_READ_BUFFER and ?GL_COPY_WRITE_BUFFER are provided to allow gl:copyBufferSubData/5 to be used without disturbing the state of other bindings. However, gl:copyBufferSubData/5 may be used with any pair of buffer binding points.
The ?GL_TRANSFORM_FEEDBACK_BUFFER buffer binding point may be passed to gl:bindBuffer , but will not directly affect transform feedback state. Instead, the indexed ?GL_TRANSFORM_FEEDBACK_BUFFER bindings must be used through a call to gl:bindBufferBase/3 or gl:bindBufferRange/5 . This will affect the generic ?GL_TRANSFORM_FEEDABCK_BUFFER binding.
Likewise, the ?GL_UNIFORM_BUFFER and ?GL_ATOMIC_COUNTER_BUFFER buffer binding points may be used, but do not directly affect uniform buffer or atomic counter buffer state, respectively. gl:bindBufferBase/3 or gl:bindBufferRange/5 must be used to bind a buffer to an indexed uniform buffer or atomic counter buffer binding point.
A buffer object binding created with gl:bindBuffer remains active until a different buffer object name is bound to the same target, or until the bound buffer object is deleted with gl:deleteBuffers/1 .
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.
See external documentation.
Types
Delete named buffer objects
gl:deleteBuffers 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 gl:genBuffers/1 ). If a buffer object that is currently bound is deleted, the binding reverts to 0 (the absence of any buffer object).
gl:deleteBuffers silently ignores 0's and names that do not correspond to existing buffer objects.
See external documentation.
Types
Generate buffer object names
gl:genBuffers 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 gl:genBuffers .
Buffer object names returned by a call to gl:genBuffers are not returned by subsequent calls, unless they are first deleted with gl:deleteBuffers/1 .
No buffer objects are associated with the returned buffer object names until they are first bound by calling gl:bindBuffer/2 .
See external documentation.
Types
Determine if a name corresponds to a buffer object
gl:isBuffer 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, gl:isBuffer returns ?GL_FALSE .
A name returned by gl:genBuffers/1 , but not yet associated with a buffer object by calling gl:bindBuffer/2 , is not the name of a buffer object.
See external documentation.
bufferData(Target, Size, Data, Usage) -> ok
Creates and initializes a buffer object's data store
gl:bufferData creates a new data store for the buffer object currently bound to Target . Any pre-existing data store is deleted. The new data store is created with the specified Size in bytes and Usage . If Data is not ?NULL, the data store is initialized with data from this pointer. In its initial state, the new data store is not mapped, it has a ?NULL mapped pointer, and its mapped access is ?GL_READ_WRITE .
Usage is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. Usage can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The frequency of access may be one of these:
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 may be one of these:
DRAW: The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
READ: The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
COPY: The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
See external documentation.
bufferSubData(Target, Offset, Size, Data) -> ok
Updates a subset of a buffer object's data store
gl:bufferSubData 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.
See external documentation.
getBufferSubData(Target, Offset, Size, Data) -> ok
Returns a subset of a buffer object's data store
gl:getBufferSubData returns some or all of the data from the buffer object currently bound to Target . Data starting at byte offset Offset and extending for Size bytes is copied from the data store to the memory pointed to by Data . An error is thrown if the buffer object is currently mapped, or if Offset and Size together define a range beyond the bounds of the buffer object's data store.
See external documentation.
getBufferParameteriv(Target, Pname) -> integer()
Return parameters of a buffer object
gl:getBufferParameteriv returns in Data a selected parameter of the buffer object specified by Target .
Value names a specific buffer object parameter, as follows:
?GL_BUFFER_ACCESS: Params returns the access policy set while mapping the buffer object. The initial value is ?GL_READ_WRITE.
?GL_BUFFER_MAPPED: Params returns a flag indicating whether the buffer object is currently mapped. The initial value is ?GL_FALSE.
?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.
See external documentation.
blendEquationSeparate(ModeRGB, ModeAlpha) -> ok
Set the RGB blend equation and the alpha blend equation separately
The blend equations determines how a new pixel (the ''source'' color) is combined with a pixel already in the framebuffer (the ''destination'' color). These functions specifie one blend equation for the RGB-color components and one blend equation for the alpha component. gl:blendEquationSeparatei specifies the blend equations for a single draw buffer whereas gl:blendEquationSeparate sets the blend equations for all draw buffers.
The blend equations use the source and destination blend factors specified by either gl:blendFunc/2 or gl:blendFuncSeparate/4 . See gl:blendFunc/2 or gl:blendFuncSeparate/4 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].

The ?GL_MIN and ?GL_MAX equations are useful for applications that analyze image data (image thresholding against a constant color, for example). The ?GL_FUNC_ADD equation is useful for antialiasing and transparency, among other things.
Initially, both the RGB blend equation and the alpha blend equation are set to ?GL_FUNC_ADD .
See external documentation.
Types
Specifies a list of color buffers to be drawn into
gl:drawBuffers defines an array of buffers into which outputs from the fragment shader data will be written. If a fragment shader writes a value to one or more user defined output variables, then the value of each variable will be written into the buffer specified at a location within Bufs corresponding to the location assigned to that user defined output. The draw buffer used for user defined outputs assigned to locations greater than or equal to N is implicitly set to ?GL_NONE and any data written to such an output is discarded.
The symbolic constants contained in Bufs may be any of the following:
?GL_NONE: The fragment shader output value is not written into any color buffer.
?GL_FRONT_LEFT: The fragment shader output value is written into the front left color buffer.
?GL_FRONT_RIGHT: The fragment shader output value is written into the front right color buffer.
?GL_BACK_LEFT: The fragment shader output value is written into the back left color buffer.
?GL_BACK_RIGHT: The fragment shader output value is written into the back right color buffer.
?GL_COLOR_ATTACHMENTn: The fragment shader output value is written into the nth color attachment of the current framebuffer. n may range from 0 to the value of ?GL_MAX_COLOR_ATTACHMENTS.
Except for ?GL_NONE, the preceding symbolic constants may not appear more than once in Bufs . The maximum number of draw buffers supported is implementation dependent and can be queried by calling gl:getBooleanv/1 with the argument ?GL_MAX_DRAW_BUFFERS .
See external documentation.
stencilOpSeparate(Face, Sfail, Dpfail, Dppass) -> ok
Set front and/or back stencil test actions
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 gl:enable/1 and gl:enable/1 with argument ?GL_STENCIL_TEST ; to control it, call gl:stencilFunc/3 or gl:stencilFuncSeparate/4 .
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. gl:stencilOp/3 sets both front and back stencil state to the same values, as if gl:stencilOpSeparate/4 were called with Face set to ?GL_FRONT_AND_BACK.
gl:stencilOpSeparate 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 gl:stencilFunc/3 .
?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 gl:stencilOpSeparate specify stencil buffer actions that depend on whether subsequent depth buffer tests succeed ( Dppass ) or fail ( Dpfail ) (see gl:depthFunc/1 ). 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.
See external documentation.
stencilFuncSeparate(Face, Func, Ref, Mask) -> ok
Set front and/or back function and reference value for stencil testing
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 gl:enable/1 and gl:enable/1 with argument ?GL_STENCIL_TEST . To specify actions based on the outcome of the stencil test, call gl:stencilOp/3 or gl:stencilOpSeparate/4 .
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. gl:stencilFunc/3 sets both front and back stencil state to the same values, as if gl:stencilFuncSeparate/4 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 gl:stencilOp/3 ). 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.
See external documentation.
stencilMaskSeparate(Face, Mask) -> ok
Control the front and/or back writing of individual bits in the stencil planes
gl:stencilMaskSeparate 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. gl:stencilMask/1 sets both front and back stencil writemasks to the same values, as if gl:stencilMaskSeparate/2 were called with Face set to ?GL_FRONT_AND_BACK.
See external documentation.
attachShader(Program, Shader) -> ok
Types
Attaches a shader object to a program object
In order to create a complete shader program, there must be a way to specify the list of things that will be linked together. Program objects provide this mechanism. Shaders that are to be linked together in a program object must first be attached to that program object. gl:attachShader attaches the shader object specified by Shader to the program object specified by Program . This indicates that Shader will be included in link operations that will be performed on Program .
All operations that can be performed on a shader object are valid whether or not the shader object is attached to a program object. It is permissible to attach a shader object to a program object before source code has been loaded into the shader object or before the shader object has been compiled. It is permissible to attach multiple shader objects of the same type because each may contain a portion of the complete shader. It is also permissible to attach a shader object to more than one program object. If a shader object is deleted while it is attached to a program object, it will be flagged for deletion, and deletion will not occur until gl:detachShader/2 is called to detach it from all program objects to which it is attached.
See external documentation.
bindAttribLocation(Program, Index, Name) -> ok
Types
Associates a generic vertex attribute index with a named attribute variable
gl:bindAttribLocation 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. If a different program object is made current by calling gl:useProgram/1 , 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 gl:bindAttribLocation. Attribute bindings do not go into effect until gl:linkProgram/1 is called. After a program object has been linked successfully, the index values for generic attributes remain fixed (and their values can be queried) until the next link command occurs.
Any attribute binding that occurs after the program object has been linked will not take effect until the next time the program object is linked.
See external documentation.
Types
Compiles a shader object
gl:compileShader 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 gl:getShaderiv/2 with arguments Shader and ?GL_COMPILE_STATUS.
Compilation of a shader can fail for a number of reasons as specified by the OpenGL 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 gl:getShaderInfoLog/2 .
See external documentation.
Creates a program object
gl:createProgram 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 gl:attachShader/2 , successfully compiling the shader objects with gl:compileShader/1 , and successfully linking the program object with gl:linkProgram/1 . These executables are made part of current state when gl:useProgram/1 is called. Program objects can be deleted by calling gl:deleteProgram/1 . The memory associated with the program object will be deleted when it is no longer part of current rendering state for any context.
See external documentation.
createShader(Type) -> integer()
Types
Creates a shader object
gl:createShader 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. Five types of shader 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_TESS_CONTROL_SHADER is a shader that is intended to run on the programmable tessellation processor in the control stage. A shader of type ?GL_TESS_EVALUATION_SHADER is a shader that is intended to run on the programmable tessellation processor in the evaluation stage. A shader of type ?GL_GEOMETRY_SHADER is a shader that is intended to run on the programmable geometry 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 , ?GL_TESS_CONTROL_SHADER, ?GL_TESS_EVALUATION_SHADER, ?GL_GEOMETRY_SHADER or ?GL_FRAGMENT_SHADER, depending on the value of ShaderType .
See external documentation.
Types
Deletes a program object
gl:deleteProgram 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 gl:createProgram/0 .
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 gl:deleteShader/1 . A value of 0 for Program will be silently ignored.
To determine whether a program object has been flagged for deletion, call gl:getProgramiv/2 with arguments Program and ?GL_DELETE_STATUS.
See external documentation.
Types
Deletes a shader object
gl:deleteShader 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 gl:createShader/1 .
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 gl:getShaderiv/2 with arguments Shader and ?GL_DELETE_STATUS.
See external documentation.
detachShader(Program, Shader) -> ok
Types
Detaches a shader object from a program object to which it is attached
gl:detachShader 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 gl:attachShader/2 .
If Shader has already been flagged for deletion by a call to gl:deleteShader/1 and it is not attached to any other program object, it will be deleted after it has been detached.
See external documentation.
disableVertexAttribArray(Index) -> ok
Types
Enable or disable a generic vertex attribute array
gl:enableVertexAttribArray enables the generic vertex attribute array specified by Index . gl:disableVertexAttribArray 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 gl:drawArrays/3 , gl:drawElements/4 , gl:drawRangeElements/6 , see glMultiDrawElements , or gl:multiDrawArrays/3 .
See external documentation.
enableVertexAttribArray(Index) -> ok
Types
getActiveAttrib(Program, Index, BufSize) -> {Size::integer(), Type::enum(), Name::string()}
Types
Returns information about an active attribute variable for the specified program object
gl:getActiveAttrib returns information about an active attribute variable in the program object specified by Program . The number of active attributes can be obtained by calling gl:getProgramiv/2 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.
A vertex shader may use either built-in attribute variables, user-defined attribute variables, or both. Built-in attribute variables have a prefix of "gl_" and reference conventional OpenGL vertex attribtes (e.g., Gl_Vertex , Gl_Normal , etc., see the OpenGL Shading Language specification for a complete list.) User-defined attribute variables have arbitrary names and obtain their values through numbered generic vertex attributes. An attribute 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 gl:linkProgram/1 , 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 gl:getProgramiv/2 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 .
gl:getActiveAttrib 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 specifies a pointer to a variable into which the attribute variable's data type will be written. The symbolic constants ?GL_FLOAT, ?GL_FLOAT_VEC2, ?GL_FLOAT_VEC3, ?GL_FLOAT_VEC4, ?GL_FLOAT_MAT2, ?GL_FLOAT_MAT3, ?GL_FLOAT_MAT4, ?GL_FLOAT_MAT2x3, ?GL_FLOAT_MAT2x4, ?GL_FLOAT_MAT3x2 , ?GL_FLOAT_MAT3x4, ?GL_FLOAT_MAT4x2, ?GL_FLOAT_MAT4x3, ?GL_INT , ?GL_INT_VEC2, ?GL_INT_VEC3, ?GL_INT_VEC4, ?GL_UNSIGNED_INT_VEC , ?GL_UNSIGNED_INT_VEC2, ?GL_UNSIGNED_INT_VEC3, ?GL_UNSIGNED_INT_VEC4, ?DOUBLE, ?DOUBLE_VEC2, ?DOUBLE_VEC3, ?DOUBLE_VEC4, ?DOUBLE_MAT2 , ?DOUBLE_MAT3, ?DOUBLE_MAT4, ?DOUBLE_MAT2x3, ?DOUBLE_MAT2x4, ?DOUBLE_MAT3x2, ?DOUBLE_MAT3x4, ?DOUBLE_MAT4x2, or ?DOUBLE_MAT4x3 may be returned. The Size argument will return the size of the attribute, in units of the type returned in Type .
The list of active attribute variables may include both built-in attribute variables (which begin with the prefix "gl_") as well as user-defined attribute variable names.
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.
See external documentation.
getActiveUniform(Program, Index, BufSize) -> {Size::integer(), Type::enum(), Name::string()}
Types
Returns information about an active uniform variable for the specified program object
gl:getActiveUniform 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 gl:getProgramiv/2 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_DepthRangeParameters , see the OpenGL Shading Language specification for a complete list.) User-defined uniform variables have arbitrary names and obtain their values from the application through calls to gl:uniform1f/2 . 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 gl:linkProgram/1 , 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 gl:getProgramiv/2 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.
gl:getActiveUniform returns the name of the uniform variable indicated by Index , storing it in the character buffer specified by Name . The string returned will be null terminated. The actual number of characters written into this buffer is returned in Length , and this count does not include the null termination character. If the length of the returned string is not required, a value of ?NULL can be passed in the Length argument.
The Type argument will return a pointer to the uniform variable's data type. The symbolic constants returned for uniform types are shown in the table below.
Returned Symbolic ContantShader Uniform Type?GL_FLOAT?float
?GL_FLOAT_VEC2 ?vec2
?GL_FLOAT_VEC3?vec3
?GL_FLOAT_VEC4?vec4
?GL_DOUBLE ?double
?GL_DOUBLE_VEC2?dvec2
?GL_DOUBLE_VEC3?dvec3
?GL_DOUBLE_VEC4 ?dvec4
?GL_INT?int
?GL_INT_VEC2?ivec2
?GL_INT_VEC3?ivec3
?GL_INT_VEC4?ivec4
?GL_UNSIGNED_INT ?unsigned int
?GL_UNSIGNED_INT_VEC2?uvec2
?GL_UNSIGNED_INT_VEC3?uvec3
?GL_UNSIGNED_INT_VEC4 ?uvec4
?GL_BOOL?bool
?GL_BOOL_VEC2?bvec2
?GL_BOOL_VEC3 ?bvec3
?GL_BOOL_VEC4?bvec4
?GL_FLOAT_MAT2?mat2
?GL_FLOAT_MAT3 ?mat3
?GL_FLOAT_MAT4?mat4
?GL_FLOAT_MAT2x3?mat2x3
?GL_FLOAT_MAT2x4 ?mat2x4
?GL_FLOAT_MAT3x2?mat3x2
?GL_FLOAT_MAT3x4?mat3x4
?GL_FLOAT_MAT4x2 ?mat4x2
?GL_FLOAT_MAT4x3?mat4x3
?GL_DOUBLE_MAT2?dmat2
?GL_DOUBLE_MAT3 ?dmat3
?GL_DOUBLE_MAT4?dmat4
?GL_DOUBLE_MAT2x3?dmat2x3
?GL_DOUBLE_MAT2x4 ?dmat2x4
?GL_DOUBLE_MAT3x2?dmat3x2
?GL_DOUBLE_MAT3x4?dmat3x4
?GL_DOUBLE_MAT4x2 ?dmat4x2
?GL_DOUBLE_MAT4x3?dmat4x3
?GL_SAMPLER_1D?sampler1D
?GL_SAMPLER_2D ?sampler2D
?GL_SAMPLER_3D?sampler3D
?GL_SAMPLER_CUBE?samplerCube
?GL_SAMPLER_1D_SHADOW ?sampler1DShadow
?GL_SAMPLER_2D_SHADOW?sampler2DShadow
?GL_SAMPLER_1D_ARRAY?sampler1DArray
?GL_SAMPLER_2D_ARRAY?sampler2DArray
?GL_SAMPLER_1D_ARRAY_SHADOW ?sampler1DArrayShadow
?GL_SAMPLER_2D_ARRAY_SHADOW ?sampler2DArrayShadow
?GL_SAMPLER_2D_MULTISAMPLE ?sampler2DMS
?GL_SAMPLER_2D_MULTISAMPLE_ARRAY?sampler2DMSArray
?GL_SAMPLER_CUBE_SHADOW?samplerCubeShadow
?GL_SAMPLER_BUFFER?samplerBuffer
?GL_SAMPLER_2D_RECT ?sampler2DRect
?GL_SAMPLER_2D_RECT_SHADOW ?sampler2DRectShadow
?GL_INT_SAMPLER_1D?isampler1D
?GL_INT_SAMPLER_2D?isampler2D
?GL_INT_SAMPLER_3D ?isampler3D
?GL_INT_SAMPLER_CUBE?isamplerCube
?GL_INT_SAMPLER_1D_ARRAY?isampler1DArray
?GL_INT_SAMPLER_2D_ARRAY?isampler2DArray
?GL_INT_SAMPLER_2D_MULTISAMPLE ?isampler2DMS
?GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY ?isampler2DMSArray
?GL_INT_SAMPLER_BUFFER?isamplerBuffer
?GL_INT_SAMPLER_2D_RECT?isampler2DRect
?GL_UNSIGNED_INT_SAMPLER_1D?usampler1D
?GL_UNSIGNED_INT_SAMPLER_2D ?usampler2D
?GL_UNSIGNED_INT_SAMPLER_3D?usampler3D
?GL_UNSIGNED_INT_SAMPLER_CUBE?usamplerCube
?GL_UNSIGNED_INT_SAMPLER_1D_ARRAY?usampler2DArray
?GL_UNSIGNED_INT_SAMPLER_2D_ARRAY?usampler2DArray
?GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE?usampler2DMS
?GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY?usampler2DMSArray
?GL_UNSIGNED_INT_SAMPLER_BUFFER?usamplerBuffer
?GL_UNSIGNED_INT_SAMPLER_2D_RECT?usampler2DRect
?GL_IMAGE_1D?image1D
?GL_IMAGE_2D ?image2D
?GL_IMAGE_3D?image3D
?GL_IMAGE_2D_RECT?image2DRect
?GL_IMAGE_CUBE ?imageCube
?GL_IMAGE_BUFFER?imageBuffer
?GL_IMAGE_1D_ARRAY?image1DArray
?GL_IMAGE_2D_ARRAY?image2DArray
?GL_IMAGE_2D_MULTISAMPLE ?image2DMS
?GL_IMAGE_2D_MULTISAMPLE_ARRAY ?image2DMSArray
?GL_INT_IMAGE_1D?iimage1D
?GL_INT_IMAGE_2D?iimage2D
?GL_INT_IMAGE_3D ?iimage3D
?GL_INT_IMAGE_2D_RECT?iimage2DRect
?GL_INT_IMAGE_CUBE?iimageCube
?GL_INT_IMAGE_BUFFER ?iimageBuffer
?GL_INT_IMAGE_1D_ARRAY?iimage1DArray
?GL_INT_IMAGE_2D_ARRAY?iimage2DArray
?GL_INT_IMAGE_2D_MULTISAMPLE?iimage2DMS
?GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY ?iimage2DMSArray
?GL_UNSIGNED_INT_IMAGE_1D ?uimage1D
?GL_UNSIGNED_INT_IMAGE_2D?uimage2D
?GL_UNSIGNED_INT_IMAGE_3D?uimage3D
?GL_UNSIGNED_INT_IMAGE_2D_RECT?uimage2DRect
?GL_UNSIGNED_INT_IMAGE_CUBE ?uimageCube
?GL_UNSIGNED_INT_IMAGE_BUFFER ?uimageBuffer
?GL_UNSIGNED_INT_IMAGE_1D_ARRAY?uimage1DArray
?GL_UNSIGNED_INT_IMAGE_2D_ARRAY?uimage2DArray
?GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE?uimage2DMS
?GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY?uimage2DMSArray
?GL_UNSIGNED_INT_ATOMIC_COUNTER?atomic_uint
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 gl:getUniformLocation/2 . 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.
See external documentation.
getAttachedShaders(Program, MaxCount) -> [integer()]
Types
Returns the handles of the shader objects attached to a program object
gl:getAttachedShaders 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 gl:getProgramiv/2 ), 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 gl:getProgramiv/2 with the value ?GL_ATTACHED_SHADERS.
See external documentation.
getAttribLocation(Program, Name) -> integer()
Types
Returns the location of an attribute variable
gl:getAttribLocation 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 gl:bindAttribLocation/3 . Attribute bindings do not go into effect until gl:linkProgram/1 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. gl:getAttribLocation returns the binding that actually went into effect the last time gl:linkProgram/1 was called for the specified program object. Attribute bindings that have been specified since the last link operation are not returned by gl:getAttribLocation.
See external documentation.
getProgramiv(Program, Pname) -> integer()
Returns a parameter from a program object
gl:getProgram 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_ATOMIC_COUNTER_BUFFERS: Params returns the number of active attribute atomic counter buffers used by Program .
?GL_ACTIVE_ATTRIBUTES: Params returns the number of active attribute variables for Program .
?GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: Params returns the length of the longest active attribute name for Program , including the null termination character (i.e., the size of the character buffer required to store the longest attribute name). If no active attributes exist, 0 is returned.
?GL_ACTIVE_UNIFORMS: Params returns the number of active uniform variables for Program .
?GL_ACTIVE_UNIFORM_MAX_LENGTH: Params returns the length of the longest active uniform variable name for Program , including the null termination character (i.e., the size of the character buffer required to store the longest uniform variable name). If no active uniform variables exist, 0 is returned.
?GL_PROGRAM_BINARY_LENGTH: Params returns the length of the program binary, in bytes that will be returned by a call to gl:getProgramBinary/2 . When a progam's ?GL_LINK_STATUS is ?GL_FALSE, its program binary length is zero.
?GL_TRANSFORM_FEEDBACK_BUFFER_MODE: Params returns a symbolic constant indicating the buffer mode used when transform feedback is active. This may be ?GL_SEPARATE_ATTRIBS or ?GL_INTERLEAVED_ATTRIBS.
?GL_TRANSFORM_FEEDBACK_VARYINGS: Params returns the number of varying variables to capture in transform feedback mode for the program.
?GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: Params returns the length of the longest variable name to be used for transform feedback, including the null-terminator.
?GL_GEOMETRY_VERTICES_OUT: Params returns the maximum number of vertices that the geometry shader in Program will output.
?GL_GEOMETRY_INPUT_TYPE: Params returns a symbolic constant indicating the primitive type accepted as input to the geometry shader contained in Program .
?GL_GEOMETRY_OUTPUT_TYPE: Params returns a symbolic constant indicating the primitive type that will be output by the geometry shader contained in Program .
See external documentation.
getProgramInfoLog(Program, BufSize) -> string()
Types
Returns the information log for a program object
gl:getProgramInfoLog 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.
gl:getProgramInfoLog 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 gl:getProgramiv/2 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.
See external documentation.
getShaderiv(Shader, Pname) -> integer()
Returns a parameter from a shader object
gl:getShader 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, ?GL_GEOMETRY_SHADER if Shader is a geometry shader object, and ?GL_FRAGMENT_SHADER if Shader is a fragment shader object.
?GL_DELETE_STATUS: Params returns ?GL_TRUE if Shader is currently flagged for deletion, and ?GL_FALSE otherwise.
?GL_COMPILE_STATUS: Params returns ?GL_TRUE if the last compile operation on Shader was successful, and ?GL_FALSE otherwise.
?GL_INFO_LOG_LENGTH: Params returns the number of characters in the information log for Shader including the null termination character (i.e., the size of the character buffer required to store the information log). If Shader has no information log, a value of 0 is returned.
?GL_SHADER_SOURCE_LENGTH: Params returns the length of the concatenation of the source strings that make up the shader source for the Shader , including the null termination character. (i.e., the size of the character buffer required to store the shader source). If no source code exists, 0 is returned.
See external documentation.
getShaderInfoLog(Shader, BufSize) -> string()
Types
Returns the information log for a shader object
gl:getShaderInfoLog 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.
gl:getShaderInfoLog 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 gl:getShaderiv/2 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.
See external documentation.
getShaderSource(Shader, BufSize) -> string()
Types
Returns the source code string from a shader object
gl:getShaderSource 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 gl:shaderSource/2 . The string returned by the function will be null terminated.
gl:getShaderSource 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 gl:getShaderiv/2 with the value ?GL_SHADER_SOURCE_LENGTH .
See external documentation.
getUniformLocation(Program, Name) -> integer()
Types
Returns the location of a uniform variable
gl:getUniformLocation 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 , if Name starts with the reserved prefix "gl_", or if Name is associated with an atomic counter or a named uniform block.
Uniform variables that are structures or arrays of structures may be queried by calling gl:getUniformLocation 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 gl:getUniformLocation can be used to obtain the location of a uniform variable. This location value can then be passed to gl:uniform1f/2 to set the value of the uniform variable or to gl:getUniformfv/2 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.
See external documentation.
getUniformfv(Program, Location) -> matrix()
Types
Returns the value of a uniform variable
gl:getUniform 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 gl:getUniform for each element of the array. To query values stored in uniform variables declared as structures, call gl:getUniform 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 gl:getUniformLocation/2 can be used to obtain the location of a uniform variable. This location value can then be passed to gl:getUniform 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.
See external documentation.
getUniformiv(Program, Location) -> {integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer()}
Types
See getUniformfv/2
getVertexAttribdv(Index, Pname) -> {float(), float(), float(), float()}
Return a generic vertex attribute parameter
gl:getVertexAttrib returns in Params the value of a generic vertex attribute parameter. The generic vertex attribute to be queried is specified by Index , and the parameter to be queried is specified by Pname .
The accepted parameter names are as follows:
?GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: Params returns a single value, the name of the buffer object currently bound to the binding point corresponding to generic vertex attribute array Index . If no buffer object is bound, 0 is returned. The initial value is 0.
?GL_VERTEX_ATTRIB_ARRAY_ENABLED: Params returns a single value that is non-zero (true) if the vertex attribute array for Index is enabled and 0 (false) if it is disabled. The initial value is ?GL_FALSE.
?GL_VERTEX_ATTRIB_ARRAY_SIZE: Params returns a single value, the size of the vertex attribute array for Index . The size is the number of values for each element of the vertex attribute array, and it will be 1, 2, 3, or 4. The initial value is 4.
?GL_VERTEX_ATTRIB_ARRAY_STRIDE: Params returns a single value, the array stride for (number of bytes between successive elements in) the vertex attribute array for Index . A value of 0 indicates that the array elements are stored sequentially in memory. The initial value is 0.
?GL_VERTEX_ATTRIB_ARRAY_TYPE: Params returns a single value, a symbolic constant indicating the array type for the vertex attribute array for Index . Possible values are ?GL_BYTE, ?GL_UNSIGNED_BYTE, ?GL_SHORT, ?GL_UNSIGNED_SHORT , ?GL_INT, ?GL_UNSIGNED_INT, ?GL_FLOAT, and ?GL_DOUBLE. The initial value is ?GL_FLOAT.
?GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: Params returns a single value that is non-zero (true) if fixed-point data types for the vertex attribute array indicated by Index are normalized when they are converted to floating point, and 0 (false) otherwise. The initial value is ?GL_FALSE.
?GL_VERTEX_ATTRIB_ARRAY_INTEGER: Params returns a single value that is non-zero (true) if fixed-point data types for the vertex attribute array indicated by Index have integer data types, and 0 (false) otherwise. The initial value is 0 (?GL_FALSE).
?GL_VERTEX_ATTRIB_ARRAY_DIVISOR: Params returns a single value that is the frequency divisor used for instanced rendering. See gl:vertexAttribDivisor/2 . The initial value is 0.
?GL_CURRENT_VERTEX_ATTRIB: Params returns four values that represent the current value for the generic vertex attribute specified by index. Generic vertex attribute 0 is unique in that it has no current state, so an error will be generated if Index is 0. The initial value for all other generic vertex attributes is (0,0,0,1).
gl:getVertexAttribdv and gl:getVertexAttribfv return the current attribute values as four single-precision floating-point values; gl:getVertexAttribiv reads them as floating-point values and converts them to four integer values; gl:getVertexAttribIiv and gl:getVertexAttribIuiv read and return them as signed or unsigned integer values, respectively; gl:getVertexAttribLdv reads and returns them as four double-precision floating-point values.
All of the parameters except ?GL_CURRENT_VERTEX_ATTRIB represent state stored in the currently bound vertex array object.
See external documentation.
getVertexAttribfv(Index, Pname) -> {float(), float(), float(), float()}
getVertexAttribiv(Index, Pname) -> {integer(), integer(), integer(), integer()}
Types
Determines if a name corresponds to a program object
gl:isProgram returns ?GL_TRUE if Program is the name of a program object previously created with gl:createProgram/0 and not yet deleted with gl:deleteProgram/1 . If Program is zero or a non-zero value that is not the name of a program object, or if an error occurs, gl:isProgram returns ?GL_FALSE.
See external documentation.
Types
Determines if a name corresponds to a shader object
gl:isShader returns ?GL_TRUE if Shader is the name of a shader object previously created with gl:createShader/1 and not yet deleted with gl:deleteShader/1 . If Shader is zero or a non-zero value that is not the name of a shader object, or if an error occurs, gl:isShader returns ?GL_FALSE.
See external documentation.
Types
Links a program object
gl:linkProgram links the program object specified by Program . If any shader objects of type ?GL_VERTEX_SHADER are attached to Program , they will be used to create an executable that will run on the programmable vertex processor. If any shader objects of type ?GL_GEOMETRY_SHADER are attached to Program , they will be used to create an executable that will run on the programmable geometry processor. If any shader objects of type ?GL_FRAGMENT_SHADER are attached to Program , they will be 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 gl:getProgramiv/2 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 gl:getUniformLocation/2 . 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 Shading Language Specification . The following lists some of the conditions that will cause a link error.
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, geometry or fragment shader.
A varying variable actually used in the fragment shader is not declared in the same way (or is not declared at all) in the vertex shader, or geometry shader shader if present.
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.
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.
The program object contains objects to form a fragment shader but does not contain objects to form a vertex shader.
The program object contains objects to form a geometry shader but does not contain objects to form a vertex shader.
The program object contains objects to form a geometry shader and the input primitive type, output primitive type, or maximum output vertex count is not specified in any compiled geometry shader object.
The program object contains objects to form a geometry shader and the input primitive type, output primitive type, or maximum output vertex count is specified differently in multiple geometry shader objects.
The number of active outputs in the fragment shader is greater than the value of ?GL_MAX_DRAW_BUFFERS .
The program has an active output assigned to a location greater than or equal to the value of ?GL_MAX_DUAL_SOURCE_DRAW_BUFFERS and has an active output assigned an index greater than or equal to one.
More than one varying out variable is bound to the same number and index.
The explicit binding assigments do not leave enough space for the linker to automatically assign a location for a varying out array, which requires multiple contiguous locations.
The Count specified by gl:transformFeedbackVaryings/3 is non-zero, but the program object has no vertex or geometry shader.
Any variable name specified to gl:transformFeedbackVaryings/3 in the Varyings array is not declared as an output in the vertex shader (or the geometry shader, if active).
Any two entries in the Varyings array given gl:transformFeedbackVaryings/3 specify the same varying variable.
The total number of components to capture in any transform feedback varying variable is greater than the constant ?GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS and the buffer mode is ?SEPARATE_ATTRIBS.
When a program object has been successfully linked, the program object can be made part of current state by calling gl:useProgram/1 . 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 gl:getProgramInfoLog/2 .
gl:linkProgram 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 gl:useProgram/1 . 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 gl:useProgram 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 contains shader objects of type ?GL_VERTEX_SHADER, and optionally of type ?GL_GEOMETRY_SHADER, but does not contain shader objects of type ?GL_FRAGMENT_SHADER , the vertex shader executable will be installed on the programmable vertex processor, the geometry shader executable, if present, will be installed on the programmable geometry processor, but no executable will be installed on the fragment processor. The results of rasterizing primitives with such a program will be undefined.
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.
See external documentation.
shaderSource(Shader, String) -> ok
Types
Replaces the source code in a shader object
gl:shaderSource 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.
See external documentation.
Types
Installs a program object as part of current rendering state
gl:useProgram installs the program object specified by Program as part of current rendering state. One or more executables are created in a program object by successfully attaching shader objects to it with gl:attachShader/2 , successfully compiling the shader objects with gl:compileShader/1 , and successfully linking the program object with gl:linkProgram/1 .
A program object will contain an executable that will run on the vertex processor if it contains one or more shader objects of type ?GL_VERTEX_SHADER that have been successfully compiled and linked. A program object will contain an executable that will run on the geometry processor if it contains one or more shader objects of type ?GL_GEOMETRY_SHADER that have been successfully compiled and linked. Similarly, a program object will contain an executable that will run on the fragment processor if it contains one or more shader objects of type ?GL_FRAGMENT_SHADER that have been successfully compiled and linked.
While a program object is in use, applications are free to modify attached shader objects, compile attached shader objects, attach additional shader objects, and detach or delete shader objects. None of these operations will affect the executables that are part of the current state. However, relinking the program object that is currently in use will install the program object as part of the current rendering state if the link operation was successful (see gl:linkProgram/1 ). 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 gl:useProgram removes it from use. After it is removed from use, it cannot be made part of current state until it has been successfully relinked.
If Program is zero, then the current rendering state refers to an invalid program object and the results of shader execution are undefined. However, this is not an error.
If Program does not contain shader objects of type ?GL_FRAGMENT_SHADER, an executable will be installed on the vertex, and possibly geometry processors, but the results of fragment shader execution will be undefined.
See external documentation.
Types
Specify the value of a uniform variable for the current program object
gl:uniform 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 gl:getUniformLocation/2 . gl:uniform operates on the program object that was made part of current state by calling gl:useProgram/1 .
The commands gl:uniform{1|2|3|4}{f|i|ui} are used to change the value of the uniform variable specified by Location using the values passed as arguments. The number specified in the command should match the number of components in the data type of the specified uniform variable (e.g., 1 for float, int, unsigned int, bool; 2 for vec2, ivec2, uvec2, bvec2, etc.). The suffix f indicates that floating-point values are being passed; the suffix i indicates that integer values are being passed; the suffix ui indicates that unsigned integer values are being passed, and this type should also match the data type of the specified uniform variable. The i variants of this function should be used to provide values for uniform variables defined as int, ivec2 , ivec3, ivec4, or arrays of these. The ui variants of this function should be used to provide values for uniform variables defined as unsigned int, uvec2, uvec3, uvec4, or arrays of these. The f variants should be used to provide values for uniform variables of type float, vec2, vec3, vec4, or arrays of these. Either the i, ui or f variants may be used to provide values for uniform variables of type bool, bvec2 , bvec3, bvec4, or arrays of these. The uniform variable will be set to false if the input value is 0 or 0.0f, and it will be set to true otherwise.
All active uniform variables defined in a program object are initialized to 0 when the program object is linked successfully. They retain the values assigned to them by a call to gl:uniform until the next successful link operation occurs on the program object, when they are once again initialized to 0.
The commands gl:uniform{1|2|3|4}{f|i|ui}v can be used to modify a single uniform variable or a uniform variable array. These commands pass a count and a pointer to the values to be loaded into a uniform variable or a uniform variable array. A count of 1 should be used if modifying the value of a single uniform variable, and a count of 1 or greater can be used to modify an entire array or part of an array. When loading n elements starting at an arbitrary position m in a uniform variable array, elements m + n - 1 in the array will be replaced with the new values. If M + N - 1 is larger than the size of the uniform variable array, values for all array elements beyond the end of the array will be ignored. The number specified in the name of the command indicates the number of components for each element in Value , and it should match the number of components in the data type of the specified uniform variable (e.g., 1 for float, int, bool; 2 for vec2, ivec2, bvec2, etc.). The data type specified in the name of the command must match the data type for the specified uniform variable as described previously for gl:uniform{1|2|3|4}{f|i|ui}.
For uniform variable arrays, each element of the array is considered to be of the type indicated in the name of the command (e.g., gl:uniform3f or gl:uniform3fv 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 gl:uniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv are used to modify a matrix or an array of matrices. The numbers in the command name are interpreted as the dimensionality of the matrix. The number 2 indicates a 2 × 2 matrix (i.e., 4 values), the number 3 indicates a 3 × 3 matrix (i.e., 9 values), and the number 4 indicates a 4 × 4 matrix (i.e., 16 values). Non-square matrix dimensionality is explicit, with the first number representing the number of columns and the second number representing the number of rows. For example, 2x4 indicates a 2 × 4 matrix with 2 columns and 4 rows (i.e., 8 values). If Transpose is ?GL_FALSE, each matrix is assumed to be supplied in column major order. If Transpose is ?GL_TRUE, each matrix is assumed to be supplied in row major order. The Count argument indicates the number of matrices to be passed. A count of 1 should be used if modifying the value of a single matrix, and a count greater than 1 can be used to modify an array of matrices.
See external documentation.
uniform2f(Location, V0, V1) -> ok
Types
See uniform1f/2
uniform3f(Location, V0, V1, V2) -> ok
Types
See uniform1f/2
uniform4f(Location, V0, V1, V2, V3) -> ok
Types
See uniform1f/2
Types
See uniform1f/2
uniform2i(Location, V0, V1) -> ok
Types
See uniform1f/2
uniform3i(Location, V0, V1, V2) -> ok
Types
See uniform1f/2
uniform4i(Location, V0, V1, V2, V3) -> ok
Types
See uniform1f/2
uniform1fv(Location, Value) -> ok
Types
See uniform1f/2
uniform2fv(Location, Value) -> ok
Types
See uniform1f/2
uniform3fv(Location, Value) -> ok
Types
See uniform1f/2
uniform4fv(Location, Value) -> ok
Types
See uniform1f/2
uniform1iv(Location, Value) -> ok
Types
See uniform1f/2
uniform2iv(Location, Value) -> ok
Types
See uniform1f/2
uniform3iv(Location, Value) -> ok
Types
See uniform1f/2
uniform4iv(Location, Value) -> ok
Types
See uniform1f/2
uniformMatrix2fv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix3fv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix4fv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
validateProgram(Program) -> ok
Types
Validates a program object
gl:validateProgram 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 gl:getProgramiv/2 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.
See external documentation.
vertexAttrib1d(Index, X) -> ok
Types
Specifies the value of a generic vertex attribute
The gl:vertexAttrib family of entry points allows an application to pass generic vertex attributes in numbered locations.
Generic attributes are defined as four-component values that are organized into an array. The first entry of this array is numbered 0, and the size of the array is specified by the implementation-dependent constant ?GL_MAX_VERTEX_ATTRIBS. Individual elements of this array can be modified with a gl:vertexAttrib call that specifies the index of the element to be modified and a value for that element.
These commands can be used to specify one, two, three, or all four components of the generic vertex attribute specified by Index . A 1 in the name of the command indicates that only one value is passed, and it will be used to modify the first component of the generic vertex attribute. The second and third components will be set to 0, and the fourth component will be set to 1. Similarly, a 2 in the name of the command indicates that values are provided for the first two components, the third component will be set to 0, and the fourth component will be set to 1. A 3 in the name of the command indicates that values are provided for the first three components and the fourth component will be set to 1, whereas a 4 in the name indicates that values are provided for all four components.
The letters s, f, i, d, ub, us, and ui indicate whether the arguments are of type short, float, int, double, unsigned byte, unsigned short, or unsigned int. When v is appended to the name, the commands can take a pointer to an array of such values.
Additional capitalized letters can indicate further alterations to the default behavior of the glVertexAttrib function:
The commands containing N indicate that the arguments will be passed as fixed-point values that are scaled to a normalized range according to the component conversion rules defined by the OpenGL specification. Signed values are understood to represent fixed-point values in the range [-1,1], and unsigned values are understood to represent fixed-point values in the range [0,1].
The commands containing I indicate that the arguments are extended to full signed or unsigned integers.
The commands containing P indicate that the arguments are stored as packed components within a larger natural type.
The commands containing L indicate that the arguments are full 64-bit quantities and should be passed directly to shader inputs declared as 64-bit double precision types.
OpenGL Shading Language attribute variables are allowed to be of type mat2, mat3, or mat4. Attributes of these types may be loaded using the gl:vertexAttrib 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 gl:bindAttribLocation/3 . This allows an application to use more descriptive variable names in a vertex shader. A subsequent change to the specified generic vertex attribute will be immediately reflected as a change to the corresponding attribute variable in the vertex shader.
The binding between a generic vertex attribute index and a user-defined attribute variable in a vertex shader is part of the state of a program object, but the current value of the generic vertex attribute is not. The value of each generic vertex attribute is part of current state, just like standard vertex attributes, 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.
See external documentation.
vertexAttrib1dv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib1d(Index, X).
vertexAttrib1f(Index, X) -> ok
Types
See vertexAttrib1d/2
vertexAttrib1fv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib1f(Index, X).
vertexAttrib1s(Index, X) -> ok
Types
See vertexAttrib1d/2
vertexAttrib1sv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib1s(Index, X).
vertexAttrib2d(Index, X, Y) -> ok
Types
See vertexAttrib1d/2
vertexAttrib2dv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib2d(Index, X, Y).
vertexAttrib2f(Index, X, Y) -> ok
Types
See vertexAttrib1d/2
vertexAttrib2fv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib2f(Index, X, Y).
vertexAttrib2s(Index, X, Y) -> ok
Types
See vertexAttrib1d/2
vertexAttrib2sv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib2s(Index, X, Y).
vertexAttrib3d(Index, X, Y, Z) -> ok
Types
See vertexAttrib1d/2
vertexAttrib3dv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib3d(Index, X, Y, Z).
vertexAttrib3f(Index, X, Y, Z) -> ok
Types
See vertexAttrib1d/2
vertexAttrib3fv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib3f(Index, X, Y, Z).
vertexAttrib3s(Index, X, Y, Z) -> ok
Types
See vertexAttrib1d/2
vertexAttrib3sv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib3s(Index, X, Y, Z).
vertexAttrib4Nbv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4Niv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4Nsv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4Nub(Index, X, Y, Z, W) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4Nubv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib4Nub(Index, X, Y, Z, W).
vertexAttrib4Nuiv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4Nusv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4bv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4d(Index, X, Y, Z, W) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4dv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib4d(Index, X, Y, Z, W).
vertexAttrib4f(Index, X, Y, Z, W) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4fv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib4f(Index, X, Y, Z, W).
vertexAttrib4iv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4s(Index, X, Y, Z, W) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4sv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttrib4s(Index, X, Y, Z, W).
vertexAttrib4ubv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4uiv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttrib4usv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttribPointer(Index, Size, Type, Normalized, Stride, Pointer) -> ok
Define an array of generic vertex attribute data
gl:vertexAttribPointer, gl:vertexAttribIPointer and gl:vertexAttribLPointer specify the location and data format of the array of generic vertex attributes at index Index to use when rendering. Size specifies the number of components per attribute and must be 1, 2, 3, 4, or ?GL_BGRA. Type specifies the data type of each component, and Stride specifies the byte stride from one attribute to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.
For gl:vertexAttribPointer, if Normalized is set to ?GL_TRUE, it indicates that values stored in an integer format are to be mapped to the range [-1,1] (for signed values) or [0,1] (for unsigned values) when they are accessed and converted to floating point. Otherwise, values will be converted to floats directly without normalization.
For gl:vertexAttribIPointer, only the integer types ?GL_BYTE, ?GL_UNSIGNED_BYTE , ?GL_SHORT, ?GL_UNSIGNED_SHORT, ?GL_INT, ?GL_UNSIGNED_INT are accepted. Values are always left as integer values.
gl:vertexAttribLPointer specifies state for a generic vertex attribute array associated with a shader attribute variable declared with 64-bit double precision components. Type must be ?GL_DOUBLE. Index , Size , and Stride behave as described for gl:vertexAttribPointer and gl:vertexAttribIPointer.
If Pointer is not NULL, a non-zero named buffer object must be bound to the ?GL_ARRAY_BUFFER target (see gl:bindBuffer/2 ), otherwise an error is generated. Pointer is treated as a byte offset into the buffer object's data store. The buffer object binding (?GL_ARRAY_BUFFER_BINDING) is saved as generic vertex attribute array state (?GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING ) for index Index .
When a generic vertex attribute array is specified, Size , Type , Normalized , Stride , and Pointer are saved as vertex array state, in addition to the current vertex array buffer object binding.
To enable and disable a generic vertex attribute array, call gl:disableVertexAttribArray/1 and gl:disableVertexAttribArray/1 with Index . If enabled, the generic vertex attribute array is used when gl:drawArrays/3 , gl:multiDrawArrays/3 , gl:drawElements/4 , see glMultiDrawElements, or gl:drawRangeElements/6 is called.
See external documentation.
uniformMatrix2x3fv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix3x2fv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix2x4fv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix4x2fv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix3x4fv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix4x3fv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
colorMaski(Index, R, G, B, A) -> ok
Types
getBooleani_v(Target, Index) -> [0 | 1]
See getBooleanv/1
getIntegeri_v(Target, Index) -> [integer()]
See getBooleanv/1
See enable/1
isEnabledi(Target, Index) -> 0 | 1
beginTransformFeedback(PrimitiveMode) -> ok
Types
Start transform feedback operation
Transform feedback mode captures the values of varying variables written by the vertex shader (or, if active, the geometry shader). Transform feedback is said to be active after a call to gl:beginTransformFeedback until a subsequent call to gl:beginTransformFeedback/1 . Transform feedback commands must be paired.
If no geometry shader is present, while transform feedback is active the Mode parameter to gl:drawArrays/3 must match those specified in the following table:
Transform Feedback PrimitiveMode Allowed Render Primitive Modes?GL_POINTS?GL_POINTS
?GL_LINES?GL_LINES, ?GL_LINE_LOOP, ?GL_LINE_STRIP , ?GL_LINES_ADJACENCY, ?GL_LINE_STRIP_ADJACENCY
?GL_TRIANGLES ?GL_TRIANGLES, ?GL_TRIANGLE_STRIP, ?GL_TRIANGLE_FAN, ?GL_TRIANGLES_ADJACENCY , ?GL_TRIANGLE_STRIP_ADJACENCY
If a geometry shader is present, the output primitive type from the geometry shader must match those provided in the following table:
Transform Feedback PrimitiveMode Allowed Geometry Shader Output Primitive Type?GL_POINTS?points
?GL_LINES ?line_strip
?GL_TRIANGLES?triangle_strip
See external documentation.
bindBufferRange(Target, Index, Buffer, Offset, Size) -> ok
Bind a range within a buffer object to an indexed buffer target
gl:bindBufferRange binds a range the buffer object Buffer represented by Offset and Size to the binding point at index Index of the array of targets specified by Target . Each Target represents an indexed array of buffer binding points, as well as a single general binding point that can be used by other buffer manipulation functions such as gl:bindBuffer/2 or see glMapBuffer. In addition to binding a range of Buffer to the indexed buffer binding target, gl:bindBufferBase also binds the range to the generic buffer binding point specified by Target .
Offset specifies the offset in basic machine units into the buffer object Buffer and Size specifies the amount of data that can be read from the buffer object while used as an indexed target.
See external documentation.
bindBufferBase(Target, Index, Buffer) -> ok
Bind a buffer object to an indexed buffer target
gl:bindBufferBase binds the buffer object Buffer to the binding point at index Index of the array of targets specified by Target . Each Target represents an indexed array of buffer binding points, as well as a single general binding point that can be used by other buffer manipulation functions such as gl:bindBuffer/2 or see glMapBuffer. In addition to binding Buffer to the indexed buffer binding target, gl:bindBufferBase also binds Buffer to the generic buffer binding point specified by Target .
See external documentation.
transformFeedbackVaryings(Program, Varyings, BufferMode) -> ok
Specify values to record in transform feedback buffers
The names of the vertex or geometry shader outputs to be recorded in transform feedback mode are specified using gl:transformFeedbackVaryings. When a geometry shader is active, transform feedback records the values of selected geometry shader output variables from the emitted vertices. Otherwise, the values of the selected vertex shader outputs are recorded.
The state set by gl:tranformFeedbackVaryings is stored and takes effect next time gl:linkProgram/1 is called on Program . When gl:linkProgram/1 is called, Program is linked so that the values of the specified varying variables for the vertices of each primitive generated by the GL are written to a single buffer object if BufferMode is ?GL_INTERLEAVED_ATTRIBS or multiple buffer objects if BufferMode is ?GL_SEPARATE_ATTRIBS .
In addition to the errors generated by gl:transformFeedbackVaryings, the program Program will fail to link if:
The count specified by gl:transformFeedbackVaryings is non-zero, but the program object has no vertex or geometry shader.
Any variable name specified in the Varyings array is not declared as an output in the vertex shader (or the geometry shader, if active).
Any two entries in the Varyings array specify the same varying variable.
The total number of components to capture in any varying variable in Varyings is greater than the constant ?GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS and the buffer mode is ?GL_SEPARATE_ATTRIBS.
The total number of components to capture is greater than the constant ?GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS and the buffer mode is ?GL_INTERLEAVED_ATTRIBS.
See external documentation.
getTransformFeedbackVarying(Program, Index, BufSize) -> {Size::integer(), Type::enum(), Name::string()}
Types
Retrieve information about varying variables selected for transform feedback
Information about the set of varying variables in a linked program that will be captured during transform feedback may be retrieved by calling gl:getTransformFeedbackVarying. gl:getTransformFeedbackVarying provides information about the varying variable selected by Index . An Index of 0 selects the first varying variable specified in the Varyings array passed to gl:transformFeedbackVaryings/3 , and an Index of ?GL_TRANSFORM_FEEDBACK_VARYINGS-1 selects the last such variable.
The name of the selected varying is returned as a null-terminated string in Name . The actual number of characters written into Name , excluding the null terminator, is returned in Length . If Length is NULL, no length is returned. The maximum number of characters that may be written into Name , including the null terminator, is specified by BufSize .
The length of the longest varying name in program is given by ?GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH , which can be queried with gl:getProgramiv/2 .
For the selected varying variable, its type is returned into Type . The size of the varying is returned into Size . The value in Size is in units of the type returned in Type . The type returned can be any of the scalar, vector, or matrix attribute types returned by gl:getActiveAttrib/3 . If an error occurred, the return parameters Length , Size , Type and Name will be unmodified. This command will return as much information about the varying variables as possible. If no information is available, Length will be set to zero and Name will be an empty string. This situation could arise if gl:getTransformFeedbackVarying is called after a failed link.
See external documentation.
clampColor(Target, Clamp) -> ok
specify whether data read via
gl:readPixels/7 should be clamped
gl:clampColor controls color clamping that is performed during gl:readPixels/7 . Target must be ?GL_CLAMP_READ_COLOR. If Clamp is ?GL_TRUE, read color clamping is enabled; if Clamp is ?GL_FALSE, read color clamping is disabled. If Clamp is ?GL_FIXED_ONLY, read color clamping is enabled only if the selected read buffer has fixed point components and disabled otherwise.
See external documentation.
beginConditionalRender(Id, Mode) -> ok
Start conditional rendering
Conditional rendering is started using gl:beginConditionalRender and ended using gl:endConditionalRender . During conditional rendering, all vertex array commands, as well as gl:clear/1 and gl:clearBufferiv/3 have no effect if the (?GL_SAMPLES_PASSED) result of the query object Id is zero, or if the (?GL_ANY_SAMPLES_PASSED) result is ?GL_FALSE . The results of commands setting the current vertex state, such as gl:vertexAttrib1d/2 are undefined. If the (?GL_SAMPLES_PASSED) result is non-zero or if the (?GL_ANY_SAMPLES_PASSED ) result is ?GL_TRUE, such commands are not discarded. The Id parameter to gl:beginConditionalRender must be the name of a query object previously returned from a call to gl:genQueries/1 . Mode specifies how the results of the query object are to be interpreted. If Mode is ?GL_QUERY_WAIT, the GL waits for the results of the query to be available and then uses the results to determine if subsequent rendering commands are discarded. If Mode is ?GL_QUERY_NO_WAIT, the GL may choose to unconditionally execute the subsequent rendering commands without waiting for the query to complete.
If Mode is ?GL_QUERY_BY_REGION_WAIT, the GL will also wait for occlusion query results and discard rendering commands if the result of the occlusion query is zero. If the query result is non-zero, subsequent rendering commands are executed, but the GL may discard the results of the commands for any region of the framebuffer that did not contribute to the sample count in the specified occlusion query. Any such discarding is done in an implementation-dependent manner, but the rendering command results may not be discarded for any samples that contributed to the occlusion query sample count. If Mode is ?GL_QUERY_BY_REGION_NO_WAIT, the GL operates as in ?GL_QUERY_BY_REGION_WAIT , but may choose to unconditionally execute the subsequent rendering commands without waiting for the query to complete.
See external documentation.
vertexAttribIPointer(Index, Size, Type, Stride, Pointer) -> ok
getVertexAttribIiv(Index, Pname) -> {integer(), integer(), integer(), integer()}
getVertexAttribIuiv(Index, Pname) -> {integer(), integer(), integer(), integer()}
vertexAttribI1i(Index, X) -> ok
Types
See vertexAttrib1d/2
vertexAttribI2i(Index, X, Y) -> ok
Types
See vertexAttrib1d/2
vertexAttribI3i(Index, X, Y, Z) -> ok
Types
See vertexAttrib1d/2
vertexAttribI4i(Index, X, Y, Z, W) -> ok
Types
See vertexAttrib1d/2
vertexAttribI1ui(Index, X) -> ok
Types
See vertexAttrib1d/2
vertexAttribI2ui(Index, X, Y) -> ok
Types
See vertexAttrib1d/2
vertexAttribI3ui(Index, X, Y, Z) -> ok
Types
See vertexAttrib1d/2
vertexAttribI4ui(Index, X, Y, Z, W) -> ok
Types
See vertexAttrib1d/2
vertexAttribI1iv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribI1i(Index, X).
vertexAttribI2iv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribI2i(Index, X, Y).
vertexAttribI3iv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribI3i(Index, X, Y, Z).
vertexAttribI4iv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribI4i(Index, X, Y, Z, W).
vertexAttribI1uiv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribI1ui(Index, X).
vertexAttribI2uiv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribI2ui(Index, X, Y).
vertexAttribI3uiv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribI3ui(Index, X, Y, Z).
vertexAttribI4uiv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribI4ui(Index, X, Y, Z, W).
vertexAttribI4bv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttribI4sv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttribI4ubv(Index, V) -> ok
Types
See vertexAttrib1d/2
vertexAttribI4usv(Index, V) -> ok
Types
See vertexAttrib1d/2
getUniformuiv(Program, Location) -> {integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer()}
Types
See getUniformfv/2
bindFragDataLocation(Program, Color, Name) -> ok
Types
Bind a user-defined varying out variable to a fragment shader color number
gl:bindFragDataLocation explicitly specifies the binding of the user-defined varying out variable Name to fragment shader color number ColorNumber for program Program . If Name was bound previously, its assigned binding is replaced with ColorNumber . Name must be a null-terminated string. ColorNumber must be less than ?GL_MAX_DRAW_BUFFERS .
The bindings specified by gl:bindFragDataLocation have no effect until Program is next linked. Bindings may be specified at any time after Program has been created. Specifically, they may be specified before shader objects are attached to the program. Therefore, any name may be specified in Name , including a name that is never used as a varying out variable in any fragment shader object. Names beginning with ?gl_ are reserved by the GL.
In addition to the errors generated by gl:bindFragDataLocation, the program Program will fail to link if:
The number of active outputs is greater than the value ?GL_MAX_DRAW_BUFFERS.
More than one varying out variable is bound to the same color number.
See external documentation.
getFragDataLocation(Program, Name) -> integer()
Types
Query the bindings of color numbers to user-defined varying out variables
gl:getFragDataLocation retrieves the assigned color number binding for the user-defined varying out variable Name for program Program . Program must have previously been linked. Name must be a null-terminated string. If Name is not the name of an active user-defined varying out fragment shader variable within Program , -1 will be returned.
See external documentation.
uniform1ui(Location, V0) -> ok
Types
See uniform1f/2
uniform2ui(Location, V0, V1) -> ok
Types
See uniform1f/2
uniform3ui(Location, V0, V1, V2) -> ok
Types
See uniform1f/2
uniform4ui(Location, V0, V1, V2, V3) -> ok
Types
See uniform1f/2
uniform1uiv(Location, Value) -> ok
Types
See uniform1f/2
uniform2uiv(Location, Value) -> ok
Types
See uniform1f/2
uniform3uiv(Location, Value) -> ok
Types
See uniform1f/2
uniform4uiv(Location, Value) -> ok
Types
See uniform1f/2
texParameterIiv(Target, Pname, Params) -> ok
See texParameterf/3
texParameterIuiv(Target, Pname, Params) -> ok
getTexParameterIiv(Target, Pname) -> {integer(), integer(), integer(), integer()}
getTexParameterIuiv(Target, Pname) -> {integer(), integer(), integer(), integer()}
clearBufferiv(Buffer, Drawbuffer, Value) -> ok
Clear individual buffers of the currently bound draw framebuffer
gl:clearBuffer* clears the specified buffer to the specified value(s). If Buffer is ?GL_COLOR, a particular draw buffer ?GL_DRAWBUFFER I is specified by passing I as DrawBuffer . In this case, Value points to a four-element vector specifying the R, G, B and A color to clear that draw buffer to. If Buffer is one of ?GL_FRONT, ?GL_BACK, ?GL_LEFT, ?GL_RIGHT, or ?GL_FRONT_AND_BACK , identifying multiple buffers, each selected buffer is cleared to the same value. Clamping and conversion for fixed-point color buffers are performed in the same fashion as gl:clearColor/4 .
If Buffer is ?GL_DEPTH, DrawBuffer must be zero, and Value points to a single value to clear the depth buffer to. Only gl:clearBufferfv should be used to clear depth buffers. Clamping and conversion for fixed-point depth buffers are performed in the same fashion as gl:clearDepth/1 .
If Buffer is ?GL_STENCIL, DrawBuffer must be zero, and Value points to a single value to clear the stencil buffer to. Only gl:clearBufferiv should be used to clear stencil buffers. Masing and type conversion are performed in the same fashion as gl:clearStencil/1 .
gl:clearBufferfi may be used to clear the depth and stencil buffers. Buffer must be ?GL_DEPTH_STENCIL and DrawBuffer must be zero. Depth and Stencil are the depth and stencil values, respectively.
The result of gl:clearBuffer is undefined if no conversion between the type of Value and the buffer being cleared is defined. However, this is not an error.
See external documentation.
clearBufferuiv(Buffer, Drawbuffer, Value) -> ok
See clearBufferiv/3
clearBufferfv(Buffer, Drawbuffer, Value) -> ok
See clearBufferiv/3
clearBufferfi(Buffer, Drawbuffer, Depth, Stencil) -> ok
getStringi(Name, Index) -> string()
See getString/1
drawArraysInstanced(Mode, First, Count, Primcount) -> ok
drawElementsInstanced(Mode, Count, Type, Indices, Primcount) -> ok
texBuffer(Target, Internalformat, Buffer) -> ok
Attach the storage for a buffer object to the active buffer texture
gl:texBuffer attaches the storage for the buffer object named Buffer to the active buffer texture, and specifies the internal format for the texel array found in the attached buffer object. If Buffer is zero, any buffer object attached to the buffer texture is detached and no new buffer object is attached. If Buffer is non-zero, it must be the name of an existing buffer object. Target must be ?GL_TEXTURE_BUFFER . Internalformat specifies the storage format, and must be one of the following sized internal formats:
ComponentSized Internal FormatBase Type ComponentsNorm0123
?GL_R8ubyte1YESR00 1
?GL_R16ushort1YESR 001
?GL_R16Fhalf1NO R001
?GL_R32Ffloat 1NOR001
?GL_R8I byte1NOR001
?GL_R16I short1NOR001
?GL_R32Iint1NOR001
?GL_R8UIubyte1NOR0 01
?GL_R16UIushort1NO R001
?GL_R32UIuint1 NOR001
?GL_RG8ubyte 2YESRG01
?GL_RG16 ushort2YESRG01
?GL_RG16Fhalf2NORG0 1
?GL_RG32Ffloat2NORG 01
?GL_RG8Ibyte2NO RG01
?GL_RG16Ishort 2NORG01
?GL_RG32I int2NORG01
?GL_RG8UI ubyte2NORG01
?GL_RG16UIushort2NORG0 1
?GL_RG32UIuint2NORG 01
?GL_RGB32Ffloat3NO RGB1
?GL_RGB32Iint 3NORGB1
?GL_RGB32UI uint3NORGB1
?GL_RGBA8uint4YESRGB A
?GL_RGBA16short4YESR GBA
?GL_RGBA16Fhalf4NO RGBA
?GL_RGBA32Ffloat 4NORGBA
?GL_RGBA8I byte4NORGBA
?GL_RGBA16Ishort4NORGB A
?GL_RGBA32Iint4NORG BA
?GL_RGBA8UIubyte4NO RGBA
?GL_RGBA16UIushort 4NORGBA
?GL_RGBA32UI uint4NORGBA
When a buffer object is attached to a buffer texture, the buffer object's data store is taken as the texture's texel array. The number of texels in the buffer texture's texel array is given by buffer_size components×sizeof( base_type/)
where buffer_size is the size of the buffer object, in basic machine units and components and base type are the element count and base data type for elements, as specified in the table above. The number of texels in the texel array is then clamped to the implementation-dependent limit ?GL_MAX_TEXTURE_BUFFER_SIZE. When a buffer texture is accessed in a shader, the results of a texel fetch are undefined if the specified texel coordinate is negative, or greater than or equal to the clamped number of texels in the texel array.
See external documentation.
primitiveRestartIndex(Index) -> ok
Types
Specify the primitive restart index
gl:primitiveRestartIndex specifies a vertex array element that is treated specially when primitive restarting is enabled. This is known as the primitive restart index.
When one of the Draw* commands transfers a set of generic attribute array elements to the GL, if the index within the vertex arrays corresponding to that set is equal to the primitive restart index, then the GL does not process those elements as a vertex. Instead, it is as if the drawing command ended with the immediately preceding transfer, and another drawing command is immediately started with the same parameters, but only transferring the immediately following element through the end of the originally specified elements.
When either gl:drawElementsBaseVertex/5 , gl:drawElementsInstancedBaseVertex/6 or see glMultiDrawElementsBaseVertex is used, the primitive restart comparison occurs before the basevertex offset is added to the array index.
See external documentation.
getInteger64i_v(Target, Index) -> [integer()]
See getBooleanv/1
getBufferParameteri64v(Target, Pname) -> [integer()]
framebufferTexture(Target, Attachment, Texture, Level) -> ok
Attach a level of a texture object as a logical buffer to the currently bound framebuffer object
gl:framebufferTexture, gl:framebufferTexture1D, gl:framebufferTexture2D, and gl:framebufferTexture attach a selected mipmap level or image of a texture object as one of the logical buffers of the framebuffer object currently bound to Target . Target must be ?GL_DRAW_FRAMEBUFFER, ?GL_READ_FRAMEBUFFER, or ?GL_FRAMEBUFFER . ?GL_FRAMEBUFFER is equivalent to ?GL_DRAW_FRAMEBUFFER.
Attachment specifies the logical attachment of the framebuffer and must be ?GL_COLOR_ATTACHMENT i, ?GL_DEPTH_ATTACHMENT, ?GL_STENCIL_ATTACHMENT or ?GL_DEPTH_STENCIL_ATTACHMMENT . i in ?GL_COLOR_ATTACHMENTi may range from zero to the value of ?GL_MAX_COLOR_ATTACHMENTS - 1. Attaching a level of a texture to ?GL_DEPTH_STENCIL_ATTACHMENT is equivalent to attaching that level to both the ?GL_DEPTH_ATTACHMENTand the ?GL_STENCIL_ATTACHMENT attachment points simultaneously.
Textarget specifies what type of texture is named by Texture , and for cube map textures, specifies the face that is to be attached. If Texture is not zero, it must be the name of an existing texture with type Textarget , unless it is a cube map texture, in which case Textarget must be ?GL_TEXTURE_CUBE_MAP_POSITIVE_X ?GL_TEXTURE_CUBE_MAP_NEGATIVE_X, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Y, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y , ?GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.
If Texture is non-zero, the specified Level of the texture object named Texture is attached to the framebfufer attachment point named by Attachment . For gl:framebufferTexture1D , gl:framebufferTexture2D, and gl:framebufferTexture3D, Texture must be zero or the name of an existing texture with a target of Textarget , or Texture must be the name of an existing cube-map texture and Textarget must be one of ?GL_TEXTURE_CUBE_MAP_POSITIVE_X , ?GL_TEXTURE_CUBE_MAP_POSITIVE_Y, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Z, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_X , ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, or ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.
If Textarget is ?GL_TEXTURE_RECTANGLE, ?GL_TEXTURE_2D_MULTISAMPLE, or ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY, then Level must be zero. If Textarget is ?GL_TEXTURE_3D, then level must be greater than or equal to zero and less than or equal to log2 of the value of ?GL_MAX_3D_TEXTURE_SIZE. If Textarget is one of ?GL_TEXTURE_CUBE_MAP_POSITIVE_X, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Y, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Z , ?GL_TEXTURE_CUBE_MAP_NEGATIVE_X, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, or ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z , then Level must be greater than or equal to zero and less than or equal to log2 of the value of ?GL_MAX_CUBE_MAP_TEXTURE_SIZE. For all other values of Textarget , Level must be greater than or equal to zero and no larger than log2 of the value of ?GL_MAX_TEXTURE_SIZE.
Layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.
For gl:framebufferTexture1D, if Texture is not zero, then Textarget must be ?GL_TEXTURE_1D. For gl:framebufferTexture2D, if Texture is not zero, Textarget must be one of ?GL_TEXTURE_2D, ?GL_TEXTURE_RECTANGLE , ?GL_TEXTURE_CUBE_MAP_POSITIVE_X, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Y, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Z , ?GL_TEXTURE_CUBE_MAP_NEGATIVE_X, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z , or ?GL_TEXTURE_2D_MULTISAMPLE. For gl:framebufferTexture3D, if Texture is not zero, then Textarget must be ?GL_TEXTURE_3D.
See external documentation.
vertexAttribDivisor(Index, Divisor) -> ok
Types
Modify the rate at which generic vertex attributes advance during instanced rendering
gl:vertexAttribDivisor modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives in a single draw call. If Divisor is zero, the attribute at slot Index advances once per vertex. If Divisor is non-zero, the attribute advances once per Divisor instances of the set(s) of vertices being rendered. An attribute is referred to as instanced if its ?GL_VERTEX_ATTRIB_ARRAY_DIVISOR value is non-zero.
Index must be less than the value of ?GL_MAX_VERTEX_ATTRIBUTES.
See external documentation.
Types
Specifies minimum rate at which sample shaing takes place
gl:minSampleShading specifies the rate at which samples are shaded within a covered pixel. Sample-rate shading is enabled by calling gl:enable/1 with the parameter ?GL_SAMPLE_SHADING . If ?GL_MULTISAMPLE or ?GL_SAMPLE_SHADING is disabled, sample shading has no effect. Otherwise, an implementation must provide at least as many unique color values for each covered fragment as specified by Value times Samples where Samples is the value of ?GL_SAMPLES for the current framebuffer. At least 1 sample for each covered fragment is generated.
A Value of 1.0 indicates that each sample in the framebuffer should be indpendently shaded. A Value of 0.0 effectively allows the GL to ignore sample rate shading. Any value between 0.0 and 1.0 allows the GL to shade only a subset of the total samples within each covered fragment. Which samples are shaded and the algorithm used to select that subset of the fragment's samples is implementation dependent.
See external documentation.
blendEquationi(Buf, Mode) -> ok
See blendEquation/1
blendEquationSeparatei(Buf, ModeRGB, ModeAlpha) -> ok
blendFunci(Buf, Src, Dst) -> ok
blendFuncSeparatei(Buf, SrcRGB, DstRGB, SrcAlpha, DstAlpha) -> ok
loadTransposeMatrixfARB(M) -> ok
Types
loadTransposeMatrixdARB(M) -> ok
Types
multTransposeMatrixfARB(M) -> ok
Types
multTransposeMatrixdARB(M) -> ok
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
currentPaletteMatrixARB(Index) -> ok
Types
matrixIndexubvARB(Indices) -> ok
Types
matrixIndexusvARB(Indices) -> ok
Types
matrixIndexuivARB(Indices) -> ok
Types
programStringARB(Target, Format, String) -> ok
bindProgramARB(Target, Program) -> ok
deleteProgramsARB(Programs) -> ok
Types
genProgramsARB(N) -> [integer()]
Types
programEnvParameter4dARB(Target, Index, X, Y, Z, W) -> ok
programEnvParameter4dvARB(Target, Index, Params) -> ok
programEnvParameter4fARB(Target, Index, X, Y, Z, W) -> ok
programEnvParameter4fvARB(Target, Index, Params) -> ok
programLocalParameter4dARB(Target, Index, X, Y, Z, W) -> ok
programLocalParameter4dvARB(Target, Index, Params) -> ok
programLocalParameter4fARB(Target, Index, X, Y, Z, W) -> ok
programLocalParameter4fvARB(Target, Index, Params) -> ok
getProgramEnvParameterdvARB(Target, Index) -> {float(), float(), float(), float()}
getProgramEnvParameterfvARB(Target, Index) -> {float(), float(), float(), float()}
getProgramLocalParameterdvARB(Target, Index) -> {float(), float(), float(), float()}
getProgramLocalParameterfvARB(Target, Index) -> {float(), float(), float(), float()}
getProgramStringARB(Target, Pname, String) -> ok
getBufferParameterivARB(Target, Pname) -> [integer()]
Types
getHandleARB(Pname) -> integer()
Types
detachObjectARB(ContainerObj, AttachedObj) -> ok
Types
createShaderObjectARB(ShaderType) -> integer()
Types
shaderSourceARB(ShaderObj, String) -> ok
Types
compileShaderARB(ShaderObj) -> ok
Types
createProgramObjectARB() -> integer()
attachObjectARB(ContainerObj, Obj) -> ok
Types
linkProgramARB(ProgramObj) -> ok
Types
useProgramObjectARB(ProgramObj) -> ok
Types
validateProgramARB(ProgramObj) -> ok
Types
getObjectParameterfvARB(Obj, Pname) -> float()
getObjectParameterivARB(Obj, Pname) -> integer()
getInfoLogARB(Obj, MaxLength) -> string()
Types
getAttachedObjectsARB(ContainerObj, MaxCount) -> [integer()]
Types
getUniformLocationARB(ProgramObj, Name) -> integer()
Types
getActiveUniformARB(ProgramObj, Index, MaxLength) -> {Size::integer(), Type::enum(), Name::string()}
Types
getUniformfvARB(ProgramObj, Location) -> matrix()
Types
getUniformivARB(ProgramObj, Location) -> {integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer()}
Types
getShaderSourceARB(Obj, MaxLength) -> string()
Types
bindAttribLocationARB(ProgramObj, Index, Name) -> ok
Types
getActiveAttribARB(ProgramObj, Index, MaxLength) -> {Size::integer(), Type::enum(), Name::string()}
Types
getAttribLocationARB(ProgramObj, Name) -> integer()
Types
isRenderbuffer(Renderbuffer) -> 0 | 1
Types
Determine if a name corresponds to a renderbuffer object
gl:isRenderbuffer returns ?GL_TRUE if Renderbuffer is currently the name of a renderbuffer object. If Renderbuffer is zero, or if Renderbuffer is not the name of a renderbuffer object, or if an error occurs, gl:isRenderbuffer returns ?GL_FALSE. If Renderbuffer is a name returned by gl:genRenderbuffers/1 , by that has not yet been bound through a call to gl:bindRenderbuffer/2 or gl:framebufferRenderbuffer/4 , then the name is not a renderbuffer object and gl:isRenderbuffer returns ?GL_FALSE .
See external documentation.
bindRenderbuffer(Target, Renderbuffer) -> ok
Bind a renderbuffer to a renderbuffer target
gl:bindRenderbuffer binds the renderbuffer object with name Renderbuffer to the renderbuffer target specified by Target . Target must be ?GL_RENDERBUFFER . Renderbuffer is the name of a renderbuffer object previously returned from a call to gl:genRenderbuffers/1 , or zero to break the existing binding of a renderbuffer object to Target .
See external documentation.
deleteRenderbuffers(Renderbuffers) -> ok
Types
Delete renderbuffer objects
gl:deleteRenderbuffers deletes the N renderbuffer objects whose names are stored in the array addressed by Renderbuffers . The name zero is reserved by the GL and is silently ignored, should it occur in Renderbuffers , as are other unused names. Once a renderbuffer object is deleted, its name is again unused and it has no contents. If a renderbuffer that is currently bound to the target ?GL_RENDERBUFFER is deleted, it is as though gl:bindRenderbuffer/2 had been executed with a Target of ?GL_RENDERBUFFER and a Name of zero.
If a renderbuffer object is attached to one or more attachment points in the currently bound framebuffer, then it as if gl:framebufferRenderbuffer/4 had been called, with a Renderbuffer of zero for each attachment point to which this image was attached in the currently bound framebuffer. In other words, this renderbuffer object is first detached from all attachment ponits in the currently bound framebuffer. Note that the renderbuffer image is specifically not detached from any non-bound framebuffers.
See external documentation.
genRenderbuffers(N) -> [integer()]
Types
Generate renderbuffer object names
gl:genRenderbuffers 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 gl:genRenderbuffers .
Renderbuffer object names returned by a call to gl:genRenderbuffers are not returned by subsequent calls, unless they are first deleted with gl:deleteRenderbuffers/1 .
The names returned in Renderbuffers are marked as used, for the purposes of gl:genRenderbuffers only, but they acquire state and type only when they are first bound.
See external documentation.
renderbufferStorage(Target, Internalformat, Width, Height) -> ok
Establish data storage, format and dimensions of a renderbuffer object's image
gl:renderbufferStorage is equivalent to calling gl:renderbufferStorageMultisample/5 with the Samples set to zero.
The target of the operation, specified by Target must be ?GL_RENDERBUFFER. Internalformat specifies the internal format to be used for the renderbuffer object's storage and must be a color-renderable, depth-renderable, or stencil-renderable format. Width and Height are the dimensions, in pixels, of the renderbuffer. Both Width and Height must be less than or equal to the value of ?GL_MAX_RENDERBUFFER_SIZE .
Upon success, gl:renderbufferStorage deletes any existing data store for the renderbuffer image and the contents of the data store after calling gl:renderbufferStorage are undefined.
See external documentation.
getRenderbufferParameteriv(Target, Pname) -> integer()
Retrieve information about a bound renderbuffer object
gl:getRenderbufferParameteriv retrieves information about a bound renderbuffer object. Target specifies the target of the query operation and must be ?GL_RENDERBUFFER . Pname specifies the parameter whose value to query and must be one of ?GL_RENDERBUFFER_WIDTH , ?GL_RENDERBUFFER_HEIGHT, ?GL_RENDERBUFFER_INTERNAL_FORMAT, ?GL_RENDERBUFFER_RED_SIZE , ?GL_RENDERBUFFER_GREEN_SIZE, ?GL_RENDERBUFFER_BLUE_SIZE, ?GL_RENDERBUFFER_ALPHA_SIZE , ?GL_RENDERBUFFER_DEPTH_SIZE, ?GL_RENDERBUFFER_DEPTH_SIZE, ?GL_RENDERBUFFER_STENCIL_SIZE , or ?GL_RENDERBUFFER_SAMPLES.
Upon a successful return from gl:getRenderbufferParameteriv, if Pname is ?GL_RENDERBUFFER_WIDTH , ?GL_RENDERBUFFER_HEIGHT, ?GL_RENDERBUFFER_INTERNAL_FORMAT, or ?GL_RENDERBUFFER_SAMPLES , then Params will contain the width in pixels, the height in pixels, the internal format, or the number of samples, respectively, of the image of the renderbuffer currently bound to Target .
If Pname is ?GL_RENDERBUFFER_RED_SIZE, ?GL_RENDERBUFFER_GREEN_SIZE, ?GL_RENDERBUFFER_BLUE_SIZE, ?GL_RENDERBUFFER_ALPHA_SIZE, ?GL_RENDERBUFFER_DEPTH_SIZE , or ?GL_RENDERBUFFER_STENCIL_SIZE, then Params will contain the actual resolutions (not the resolutions specified when the image array was defined) for the red, green, blue, alpha depth, or stencil components, respectively, of the image of the renderbuffer currently bound to Target .
See external documentation.
isFramebuffer(Framebuffer) -> 0 | 1
Types
Determine if a name corresponds to a framebuffer object
gl:isFramebuffer returns ?GL_TRUE if Framebuffer is currently the name of a framebuffer object. If Framebuffer is zero, or if ?framebuffer is not the name of a framebuffer object, or if an error occurs, gl:isFramebuffer returns ?GL_FALSE. If Framebuffer is a name returned by gl:genFramebuffers/1 , by that has not yet been bound through a call to gl:bindFramebuffer/2 , then the name is not a framebuffer object and gl:isFramebuffer returns ?GL_FALSE.
See external documentation.
bindFramebuffer(Target, Framebuffer) -> ok
Bind a framebuffer to a framebuffer target
gl:bindFramebuffer binds the framebuffer object with name Framebuffer to the framebuffer target specified by Target . Target must be either ?GL_DRAW_FRAMEBUFFER , ?GL_READ_FRAMEBUFFER or ?GL_FRAMEBUFFER. If a framebuffer object is bound to ?GL_DRAW_FRAMEBUFFER or ?GL_READ_FRAMEBUFFER, it becomes the target for rendering or readback operations, respectively, until it is deleted or another framebuffer is bound to the corresponding bind point. Calling gl:bindFramebuffer with Target set to ?GL_FRAMEBUFFER binds Framebuffer to both the read and draw framebuffer targets. Framebuffer is the name of a framebuffer object previously returned from a call to gl:genFramebuffers/1 , or zero to break the existing binding of a framebuffer object to Target .
See external documentation.
deleteFramebuffers(Framebuffers) -> ok
Types
Delete framebuffer objects
gl:deleteFramebuffers deletes the N framebuffer objects whose names are stored in the array addressed by Framebuffers . The name zero is reserved by the GL and is silently ignored, should it occur in Framebuffers , as are other unused names. Once a framebuffer object is deleted, its name is again unused and it has no attachments. If a framebuffer that is currently bound to one or more of the targets ?GL_DRAW_FRAMEBUFFER or ?GL_READ_FRAMEBUFFER is deleted, it is as though gl:bindFramebuffer/2 had been executed with the corresponding Target and Framebuffer zero.
See external documentation.
genFramebuffers(N) -> [integer()]
Types
Generate framebuffer object names
gl:genFramebuffers returns N framebuffer object names in Ids . There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genFramebuffers .
Framebuffer object names returned by a call to gl:genFramebuffers are not returned by subsequent calls, unless they are first deleted with gl:deleteFramebuffers/1 .