gl(3)
gl โ the Erlang wrapper era ๐ โจ
okay bestie, sit down, hydrate, because this is the gl module: Erlang wrapper functions for OpenGL. Yes, the whole standard OpenGL API, wrapped up cute for Erlang. We are so back. ๐ซถ
It documents the functions as a brief version of the complete OpenGL reference pages โ so like, the sparknotes of the sparknotes, but make it Erlang. ๐ฅ
โจ DESCRIPTION โจ
Standard OpenGL API. That's the whole mission statement, bestie.
This documents the functions as a brief version of the complete OpenGL reference pages. (Yes, "brief". We said what we said. The full lore lives elsewhere.) ๐
๐ DATA TYPES ๐
clamp() :: float().โ it's a float. that's it. no notes. ๐enum() :: non_neg_integer().โ a non-negative integer, living its best little integer life. โญf() :: float().โ a float, fr fr.i() :: integer().โ just an integer, iconic, no cap.m12() :: {f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}.โ a tuple of twelvef()s, exactly twelve, we counted, don't come for us. ๐งm16() :: {f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}.โ and this one? sixteenf()s. the way that it's just more floats. ๐ญmatrix() :: m12() | m16().โ a matrix is either anm12()or anm16(). choose your fighter. ๐mem() :: binary() | tuple().โ memory things: a binary, or a tuple. both valid, both slay.offset() :: non_neg_integer().โ a non-negative integer standing in for an offset. periodt.
๐ FUNCTIONS ๐
accum(Op :: enum(), Value :: f()) -> ok.
So the accumulation buffer is an extended-range color buffer, right? And here's the twist: images are not rendered into it. ๐ Nope. Instead, images rendered into one of the color buffers get added to the contents of the accumulation buffer after rendering. And the glow-up? Effects like antialiasing (of points, lines, and polygons), motion blur, and depth of field can be created by accumulating images generated with different transformation matrices. it's giving cinematic. ๐ฌ
๐ External documentation.
activeShaderProgram(Pipeline :: i(), Program :: i()) -> ok.
gl:activeShaderProgram/2 sets the linked program named by Program to be the active program for the program pipeline object Pipeline. The active program in the active program pipeline object is the target of calls to gl:uniform() when no program has been made current through a call to gl:useProgram/1. main character program energy, honestly. ๐
๐ External documentation.
activeTexture(Texture :: enum()) -> ok.
gl:activeTexture/1 selects which texture unit subsequent texture state calls will affect. And how many texture units can an implementation support? implementation dependent, bestie โ but it must be at least 80. eighty. minimum. slay. ๐ฅ
๐ External documentation.
alphaFunc(Func :: enum(), Ref :: clamp()) -> ok.
The alpha test discards fragments depending on the outcome of a comparison between an incoming fragment's alpha value and a constant reference value. gl:alphaFunc/2 specifies the reference value and the comparison function. The comparison is only performed if alpha testing is enabled โ and by default? it is not enabled. ๐ซ (See gl:enable/1 and gl:disable/1 of ?GL_ALPHA_TEST.) so if you forgot to enable it, that's a you problem, we're just the messenger. ๐
๐ External documentation.
areTexturesResident(Textures :: [i()]) -> {0 | 1, Residences :: [0 | 1]}.
So GL establishes a ``working set'' of textures that are resident in texture memory. Those textures can be bound to a texture target much more efficiently than textures that are not resident. speed. efficiency. it's giving organized. โจ
๐ External documentation.
arrayElement(I :: i()) -> ok.
gl:arrayElement/1 commands are used within gl:'begin'/1/gl:'end'/0 pairs to specify vertex and attribute data for point, line, and polygon primitives. If ?GL_VERTEX_ARRAY is enabled when gl:arrayElement/1 is called, a single vertex is drawn, using vertex and attribute data taken from location I of the enabled arrays. If ?GL_VERTEX_ARRAY is not enabled, no drawing occurs โ but the attributes corresponding to the enabled arrays are modified anyway. sneaky little side quest. ๐
๐ External documentation.
attachShader(Program :: i(), Shader :: i()) -> ok.
Okay so to create a complete shader program, there has to be a way to specify the list of things that will be linked together โ and program objects provide that mechanism, periodt. ๐ Shaders that are to be linked together in a program object must first be attached to that program object. gl:attachShader/2 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. besties being besties. ๐ซถ
๐ External documentation.
bindAttribLocation(Program :: i(), Index :: i(), Name :: string()) -> ok.
gl:bindAttribLocation/3 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. And 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. mutual matching, cute. ๐
๐ External documentation.
bindBuffer(Target :: enum(), Buffer :: i()) -> ok.
gl:bindBuffer/2 binds a buffer object to the specified buffer binding point. Calling gl:bindBuffer/2 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 โ surprise, you made a baby buffer. ๐ถ When a buffer object is bound to a target, the previous binding for that target is automatically broken. out with the old. ๐
๐ External documentation.
bindBufferBase(Target :: enum(), Index :: i(), Buffer :: i()) -> ok.
gl:bindBufferBase/3 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 glMapBuffer. And on top of binding Buffer to the indexed buffer binding target, gl:bindBufferBase/3 also binds Buffer to the generic buffer binding point specified by Target. double duty, no complaints. โจ
๐ External documentation.
bindBufferRange(Target :: enum(), Index :: i(), Buffer :: i(), Offset :: i(), Size :: i()) -> ok.
gl:bindBufferRange/5 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 glMapBuffer. In addition to binding a range of Buffer to the indexed buffer binding target, gl:bindBufferRange/5 also binds the range to the generic buffer binding point specified by Target. a whole range, bestie, not the whole buffer. ๐
๐ External documentation.
bindBuffersBase(Target :: enum(), First :: i(), Buffers :: [i()]) -> ok.
gl:bindBuffersBase/3 binds a set of Count buffer objects whose names are given in the array Buffers to the Count consecutive binding points starting from index First of the array of targets specified by Target. If Buffers is ?NULL then gl:bindBuffersBase/3 unbinds any buffers that are currently bound to the referenced binding points. Assuming no errors are generated, it is equivalent to the following pseudo-code, which calls gl:bindBufferBase/3, with the exception that the non-indexed Target is not changed by gl:bindBuffersBase/3: (the pseudo-code is over there in the full docs, we're just the hype team ๐ซก)
๐ External documentation.
bindBuffersRange(Target :: enum(), First :: i(), Buffers :: [i()], Offsets :: [i()], Sizes :: [i()]) -> ok.
gl:bindBuffersRange/5 binds a set of Count ranges from buffer objects whose names are given in the array Buffers to the Count consecutive binding points starting from index First of the array of targets specified by Target. Offsets specifies the address of an array containing Count starting offsets within the buffers, and Sizes specifies the address of an array of Count sizes of the ranges. If Buffers is ?NULL then Offsets and Sizes are ignored and gl:bindBuffersRange/5 unbinds any buffers that are currently bound to the referenced binding points. Assuming no errors are generated, it is equivalent to the following pseudo-code, which calls gl:bindBufferRange/5, with the exception that the non-indexed Target is not changed by gl:bindBuffersRange/5: (again, pseudo-code lives in the full docs, mwah ๐)
๐ External documentation.
bindFragDataLocation(Program :: i(), Color :: i(), Name :: string()) -> ok.
gl:bindFragDataLocation/3 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. And ColorNumber must be less than ?GL_MAX_DRAW_BUFFERS. rules are rules! โ ๏ธ
๐ External documentation.
bindFragDataLocationIndexed(Program :: i(), ColorNumber :: i(), Index :: i(), Name :: string()) -> ok.
gl:bindFragDataLocationIndexed/4 specifies that the varying out variable Name in Program should be bound to fragment color ColorNumber when the program is next linked. Index may be zero or one to specify that the color be used as either the first or second color input to the blend equation, respectively. zero or one. that's the vibe check. ๐
๐ External documentation.
bindFramebuffer(Target :: enum(), Framebuffer :: i()) -> ok.
โฆand bestie we are nowhere near done, there is SO much more of this module โ hold that thought. ๐
Alright bestie, we're picking up right where we left off โ the bind squad is UP next ๐
๐ซถ gl:bindFramebuffer/2
gl:bindFramebuffer/2 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/2 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.
โจ External documentation.
๐ง bindImageTexture/7
bindImageTexture(Unit, Texture, Level, Layered, Layer, Access,
Format) ->
ok
when
Unit :: i(),
Texture :: i(),
Level :: i(),
Layered :: 0 | 1,
Layer :: i(),
Access :: enum(),
Format :: enum().
gl:bindImageTexture/7 binds a single level of a texture to an image unit so shaders can read from it and write to it. Unit is the zero-based index of the image unit you're binding the texture level to. Texture is the name of an existing texture object to bind to the image unit โ and if Texture is zero, any existing binding to that image unit just gets broken, no cap ๐ซ. Level is the level of the texture you're binding to the image unit.
โจ External documentation.
๐ bindImageTextures/2
bindImageTextures(First :: i(), Textures :: [i()]) -> ok.
gl:bindImageTextures/2 takes a whole array of existing texture objects and binds their images to a specified number of consecutive image units. Count is the number of texture objects whose names live in the array Textures. That many texture names get read from the array and bound to the Count consecutive texture units starting at First. If a zero shows up in the Textures array, any existing binding to that image unit gets reset. Every non-zero entry in Textures has to be the name of an existing texture object. When a non-zero entry in Textures is present: the image at level zero is bound, the binding is considered layered with the first layer set to zero, and the image is bound for read-write access. The image unit format parameter comes from the internal format of the image at level zero of the texture object. For cube map textures, the internal format of the positive X image of level zero is what's used. And if Textures is ?NULL, it's as if an appropriately sized array containing only zeros had been specified. iconic.
โจ External documentation.
๐ bindProgramPipeline/1
bindProgramPipeline(Pipeline :: i()) -> ok.
gl:bindProgramPipeline/1 binds a program pipeline object to the current context. Pipeline must be a name previously returned from a call to gl:genProgramPipelines/1. And listen โ if no program pipeline exists with name Pipeline, a new pipeline object gets created with that name and initialized to the default state vector. surprise creation, we love to see it โจ
โจ External documentation.
๐ bindRenderbuffer/2
bindRenderbuffer(Target :: enum(), Renderbuffer :: i()) -> ok.
gl:bindRenderbuffer/2 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.
โจ External documentation.
๐ฆ bindSampler/2
bindSampler(Unit :: i(), Sampler :: i()) -> ok.
gl:bindSampler/2 binds Sampler to the texture unit at index Unit. Sampler must be zero or the name of a sampler object previously returned from a call to gl:genSamplers/1. Oh and heads up: Unit must be less than the value of ?GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS. don't test it ๐
โจ External documentation.
๐ธ bindSamplers/2
bindSamplers(First :: i(), Samplers :: [i()]) -> ok.
gl:bindSamplers/2 binds samplers from an array of existing sampler objects to a specified number of consecutive sampler units. Count is the number of sampler objects whose names are stored in the array Samplers. That many sampler names get read from the array and bound to the Count consecutive sampler units starting at First.
โจ External documentation.
๐ bindTexture/2
bindTexture(Target :: enum(), Texture :: i()) -> ok.
gl:bindTexture/2 is your "create or use a named texture" moment. Call it with Target set to ?GL_TEXTURE_1D, ?GL_TEXTURE_2D, ?GL_TEXTURE_3D, ?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_RECTANGLE, ?GL_TEXTURE_CUBE_MAP, ?GL_TEXTURE_CUBE_MAP_ARRAY, ?GL_TEXTURE_BUFFER, ?GL_TEXTURE_2D_MULTISAMPLE or ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY, and Texture set to the name of the new texture โ boom, the texture name is bound to that target. And the moment a texture is bound to a target, the previous binding for that target is automatically broken. out with the old, in with the new ๐
โจ External documentation.
๐ bindTextureUnit/2
bindTextureUnit(Unit :: i(), Texture :: i()) -> ok.
gl:bindTextureUnit/2 binds an existing texture object to the texture unit numbered Unit. simple. clean. slay.
โจ External documentation.
โญ bindTextures/2
bindTextures(First :: i(), Textures :: [i()]) -> ok.
gl:bindTextures/2 binds an array of existing texture objects to a specified number of consecutive texture units. Count is the number of texture objects whose names are stored in the array Textures. That many texture names get read from the array and bound to the Count consecutive texture units starting at First. The target โ aka the type of texture โ is deduced from the texture object, and each texture gets bound to the corresponding target of the texture unit. If a zero appears in the Textures array, any existing binding to any target of that texture unit is reset, and the default texture for that target is bound in its place instead. Every non-zero entry in Textures must be the name of an existing texture object. If Textures is ?NULL, it's as if an appropriately sized array containing only zeros had been specified.
โจ External documentation.
๐ฅ bindTransformFeedback/2
bindTransformFeedback(Target :: enum(), Id :: i()) -> ok.
gl:bindTransformFeedback/2 binds the transform feedback object with name Id to the current GL state. Id must be a name previously returned from a call to gl:genTransformFeedbacks/1. And if Id hasn't been bound before? A new transform feedback object with name Id gets created, initialized with the default transform state vector. main character energy fr fr ๐
โจ External documentation.
๐ง bindVertexArray/1
bindVertexArray(Array :: i()) -> ok.
gl:bindVertexArray/1 binds the vertex array object with name Array. Array is the name of a vertex array object previously returned from a call to gl:genVertexArrays/1, or zero to break the existing vertex array object binding.
โจ External documentation.
๐ bitmap/7
bitmap(Width, Height, Xorig, Yorig, Xmove, Ymove, Bitmap) -> ok
when
Width :: i(),
Height :: i(),
Xorig :: f(),
Yorig :: f(),
Xmove :: f(),
Ymove :: f(),
Bitmap :: offset() | mem().
A bitmap is a binary image, bestie. When it's drawn, the bitmap gets positioned relative to the current raster position, and frame buffer pixels corresponding to 1's in the bitmap are written using the current raster color or index. Frame buffer pixels corresponding to 0's in the bitmap? Untouched. not modified. as they were. ๐ซถ
โจ External documentation.
๐ blendColor/4
blendColor(Red :: clamp(),
Green :: clamp(),
Blue :: clamp(),
Alpha :: clamp()) ->
ok.
The ?GL_BLEND_COLOR may be used to calculate the source and destination blending factors. The color components get clamped to the range [0 1] before being stored. Peep gl:blendFunc/2 for a complete description of the blending operations. Initially, ?GL_BLEND_COLOR is set to (0, 0, 0, 0). defaults, we love them ๐
โจ External documentation.
๐ blendEquationSeparatei/3
blendEquationSeparatei(Buf :: i(),
ModeRGB :: enum(),
ModeAlpha :: enum()) ->
ok.
The blend equations decide how a new pixel (the ''source'' color) gets combined with a pixel already in the framebuffer (the ''destination'' color). These functions specify one blend equation for the RGB-color components and one blend equation for the alpha component. gl:blendEquationSeparatei/3 specifies the blend equations for a single draw buffer, whereas gl:blendEquationSeparate/2 sets the blend equations for all draw buffers.
โจ External documentation.
๐ธ blendEquationi/2
blendEquationi(Buf :: i(), Mode :: enum()) -> ok.
The blend equations determine how a new pixel (the ''source'' color) gets combined with a pixel already in the framebuffer (the ''destination'' color). This function sets both the RGB blend equation and the alpha blend equation to a single equation. gl:blendEquationi/2 specifies the blend equation for a single draw buffer, whereas gl:blendEquation/1 sets the blend equation for all draw buffers.
โจ External documentation.
๐ blendFuncSeparatei/5
blendFuncSeparatei(Buf :: i(),
SrcRGB :: enum(),
DstRGB :: enum(),
SrcAlpha :: enum(),
DstAlpha :: enum()) ->
ok.
Pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values already in the frame buffer (the destination values). And note this, bestie: blending is initially disabled. Use gl:enable/1 and gl:disable/1 with argument ?GL_BLEND to turn blending on and off. don't forget to actually enable it, we've all been there ๐ญ
โจ External documentation.
๐ฆ blendFunci/3
blendFunci(Buf :: i(), Src :: enum(), Dst :: enum()) -> ok.
Okay so like, pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already sitting in the frame buffer (those are the destination values, bestie). Blending starts off disabled ๐ค โ use gl:enable/1 and gl:disable/1 with the argument ?GL_BLEND to turn it on and off.
๐ External documentation.
blitFramebuffer
blitFramebuffer(SrcX0, SrcY0, SrcX1, SrcY1, DstX0, DstY0, DstX1, DstY1, Mask, Filter) ->
ok
when
SrcX0 :: i(),
SrcY0 :: i(),
SrcX1 :: i(),
SrcY1 :: i(),
DstX0 :: i(),
DstY0 :: i(),
DstX1 :: i(),
DstY1 :: i(),
Mask :: i(),
Filter :: enum().
gl:blitFramebuffer/10 and glBlitNamedFramebuffer transfer a rectangle of pixel values from one region of a read framebuffer to another region of a draw framebuffer. it's giving copy-paste but for pixels ๐
๐ External documentation.
bufferData
bufferData(Target :: enum(),
Size :: i(),
Data :: offset() | mem(),
Usage :: enum()) ->
ok.
gl:bufferData/4 and glNamedBufferData create a new data store for a buffer object. With gl:bufferData/4, the buffer object currently bound to Target is the one that gets used. For glNamedBufferData, a buffer object associated with the ID the caller specifies in Buffer gets used instead ๐
๐ External documentation.
bufferStorage
bufferStorage(Target :: enum(),
Size :: i(),
Data :: offset() | mem(),
Flags :: i()) ->
ok.
gl:bufferStorage/4 and glNamedBufferStorage create a new immutable data store ๐. For gl:bufferStorage/4, the buffer object currently bound to Target will be initialized. For glNamedBufferStorage, Buffer is the name of the buffer object that's getting configured. The size of the data store is specified by Size. If you've got initial data available, its address may be supplied in Data. Otherwise, to create an uninitialized data store, Data should be ?NULL. no cap.
๐ External documentation.
bufferSubData
bufferSubData(Target :: enum(),
Offset :: i(),
Size :: i(),
Data :: offset() | mem()) ->
ok.
gl:bufferSubData/4 and glNamedBufferSubData redefine some or all of the data store for the specified buffer object. Data starting at byte offset Offset and extending for Size bytes is copied to the data store from the memory pointed to by Data. Offset and Size must define a range lying entirely within the buffer object's data store โ don't be out here coloring outside the lines ๐๏ธ
๐ External documentation.
callList
callList(List :: i()) -> ok.
gl:callList/1 causes the named display list to be executed. The commands saved in the display list are executed in order, just as if they were called without using a display list at all. If List hasn't been defined as a display list, gl:callList/1 is simply ignored ๐
๐ External documentation.
callLists
callLists(Lists :: [i()]) -> ok.
gl:callLists/1 causes each display list in the list of names passed as Lists to be executed. So as a result, the commands saved in each display list are executed in order, just as if they were called without using a display list. Names of display lists that haven't been defined are ignored. periodt.
๐ External documentation.
checkFramebufferStatus
checkFramebufferStatus(Target :: enum()) -> enum().
gl:checkFramebufferStatus/1 and glCheckNamedFramebufferStatus return the completeness status of a framebuffer object when it's treated as a read or draw framebuffer, depending on the value of Target. vibe check for your framebuffer โจ
๐ External documentation.
clampColor
clampColor(Target :: enum(), Clamp :: enum()) -> ok.
gl:clampColor/2 controls the color clamping that gets 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. And if Clamp is ?GL_FIXED_ONLY, read color clamping is enabled only if the selected read buffer has fixed point components, and disabled otherwise. conditional queen ๐
๐ External documentation.
clear
clear(Mask :: i()) -> ok.
gl:clear/1 sets the bitplane area of the window to values previously selected by gl:clearColor/4, gl:clearDepth/1, and gl:clearStencil/1. You can clear multiple color buffers at once by selecting more than one buffer at a time using gl:drawBuffer/1. multitasking icon ๐
๐ External documentation.
clearAccum
clearAccum(Red :: f(), Green :: f(), Blue :: f(), Alpha :: f()) -> ok.
gl:clearAccum/4 specifies the red, green, blue, and alpha values used by gl:clear/1 to clear the accumulation buffer.
๐ External documentation.
clearBufferuiv
clearBufferuiv(Buffer :: enum(),
Drawbuffer :: i(),
Value :: tuple()) ->
ok.
These commands clear a specified buffer of a framebuffer to specified value(s). For gl:clearBuffer*(), the framebuffer is the currently bound draw framebuffer object. For glClearNamedFramebuffer*, Framebuffer is zero โ which means the default draw framebuffer โ or the name of a framebuffer object.
๐ External documentation.
clearColor
clearColor(Red :: clamp(),
Green :: clamp(),
Blue :: clamp(),
Alpha :: clamp()) ->
ok.
gl:clearColor/4 specifies the red, green, blue, and alpha values used by gl:clear/1 to clear the color buffers. Values you pass to gl:clearColor/4 get clamped to the range [0 1].
๐ External documentation.
clearDepthf
clearDepthf(D :: f()) -> ok.
gl:clearDepth/1 specifies the depth value used by gl:clear/1 to clear the depth buffer. Values specified by gl:clearDepth/1 are clamped to the range [0 1].
๐ External documentation.
clearIndex
clearIndex(C :: f()) -> ok.
gl:clearIndex/1 specifies the index used by gl:clear/1 to clear the color index buffers. C is not clamped, bestie. Instead, C gets converted to a fixed-point value with unspecified precision to the right of the binary point. The integer part of this value is then masked with 2 m-1, where m is the number of bits in a color index stored in the frame buffer. math girlies rise ๐งฎ
๐ External documentation.
clearStencil
clearStencil(S :: i()) -> ok.
gl:clearStencil/1 specifies the index used by gl:clear/1 to clear the stencil buffer. S is masked with 2 m-1, where m is the number of bits in the stencil buffer.
๐ External documentation.
clearTexImage
clearTexImage(Texture :: i(),
Level :: i(),
Format :: enum(),
Type :: enum(),
Data :: offset() | mem()) ->
ok.
gl:clearTexImage/5 fills all an image contained in a texture with an application supplied value. Texture must be the name of an existing texture. Also, Texture may not be the name of a buffer texture, and its internal format may not be compressed. rules are rules ๐
โโ๏ธ
๐ External documentation.
clearTexSubImage
clearTexSubImage(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, Type, Data) ->
ok
when
Texture :: i(),
Level :: i(),
Xoffset :: i(),
Yoffset :: i(),
Zoffset :: i(),
Width :: i(),
Height :: i(),
Depth :: i(),
Format :: enum(),
Type :: enum(),
Data :: offset() | mem().
gl:clearTexSubImage/11 fills all or part of an image contained in a texture with an application supplied value. Texture must be the name of an existing texture. And again: Texture may not be the name of a buffer texture, and its internal format may not be compressed โจ
๐ External documentation.
clientActiveTexture
clientActiveTexture(Texture :: enum()) -> ok.
gl:clientActiveTexture/1 selects the vertex array client state parameters to be modified by gl:texCoordPointer/4, and to be enabled or disabled with gl:enableClientState/1 or gl:disableClientState/1, respectively, when called with a parameter of ?GL_TEXTURE_COORD_ARRAY. so many states bestie ๐ญ
๐ External documentation.
clientWaitSync
clientWaitSync(Sync :: i(), Flags :: i(), Timeout :: i()) -> enum().
gl:clientWaitSync/3 causes the client to block and wait for the sync object specified by Sync to become signaled. If Sync is already signaled when gl:clientWaitSync/3 is called, gl:clientWaitSync/3 returns immediately, otherwise it'll block and wait for up to Timeout nanoseconds for Sync to become signaled. the way she waits โณ
๐ External documentation.
clipControl
clipControl(Origin :: enum(), Depth :: enum()) -> ok.
gl:clipControl/2 controls the clipping volume behavior and the clip coordinate to window coordinate transformation behavior.
๐ External documentation.
clipPlane
clipPlane(Plane :: enum(), Equation :: {f(), f(), f(), f()}) -> ok.
Geometry is always clipped against the boundaries of a six-plane frustum in x, y, and z. gl:clipPlane/2 lets you specify additional planes โ not necessarily perpendicular to the x, y, or z axis โ against which all geometry gets clipped. To find out the maximum number of additional clipping planes, call gl:getIntegerv/1 with the argument ?GL_MAX_CLIP_PLANES. All implementations support at least six such clipping planes. And because the resulting clipping region is the intersection of the defined half-spaces, it is always convex. geometry ate that ๐
๐ External documentation.
color4usv
color4usv({Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()}) ->
ok.
okay so bestie, continuing the color lore: The GL is holding onto both a current single-valued color index and a current four-valued RGBA color. gl:color() sets a new four-valued RGBA color. gl:color() has two major variants: gl:color3() and gl:color4(). The gl:color3() variants specify new red, green, and blue values explicitly and set the current alpha value to 1.0 (full intensity) implicitly. The gl:color4() variants specify all four color components explicitly. It's giving dual-color main character energy, fr fr. ๐
External documentation. ๐
colorMaski(Index :: i(),
R :: 0 | 1,
G :: 0 | 1,
B :: 0 | 1,
A :: 0 | 1) ->
ok.
gl:colorMask/4 and gl:colorMaski/5 specify whether the individual color components in the frame buffer can or cannot be written. gl:colorMaski/5 sets the mask for a specific draw buffer, whereas gl:colorMask/4 sets the mask for all draw buffers. If Red is ?GL_FALSE, for example, no change is made to the red component of any pixel in any of the color buffers, regardless of the drawing operation attempted. So yeah, it's the ultimate "can u touch this pixel component or nah" vibe check. ๐ซ๐ด
External documentation. ๐
colorMaterial(Face :: enum(), Mode :: enum()) -> ok.
gl:colorMaterial/2 specifies which material parameters track the current color. When ?GL_COLOR_MATERIAL is enabled, the material parameter or parameters specified by Mode, of the material or materials specified by Face, track the current color at all times. It's literally making your materials follow the current color like a loyal bestie. ๐ฏโโ๏ธ๐
External documentation. ๐
colorPointer(Size :: i(),
Type :: enum(),
Stride :: i(),
Ptr :: offset() | mem()) ->
ok.
gl:colorPointer/4 specifies the location and data format of an array of color components to use when rendering. Size specifies the number of components per color, and must be 3 or 4. Type specifies the data type of each color component, and Stride specifies the byte stride from one color to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.) So you can pack it tight or keep it separate, your call. ๐จ๐ฆ
External documentation. ๐
colorSubTable(Target, Start, Count, Format, Type, Data) -> ok
when
Target :: enum(),
Start :: i(),
Count :: i(),
Format :: enum(),
Type :: enum(),
Data :: offset() | mem().
gl:colorSubTable/6 is used to respecify a contiguous portion of a color table previously defined using gl:colorTable/6. The pixels referenced by Data replace the portion of the existing table from indices Start to start+count-1, inclusive. This region may not include any entries outside the range of the color table as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect. So zero-width? valid but pointless, like texting "hey" with no follow-up. ๐
External documentation. ๐
colorTable(Target, Internalformat, Width, Format, Type, Table) ->
ok
when
Target :: enum(),
Internalformat :: enum(),
Width :: i(),
Format :: enum(),
Type :: enum(),
Table :: offset() | mem().
gl:colorTable/6 may be used in two ways: to test the actual size and color resolution of a lookup table given a particular set of parameters, or to load the contents of a color lookup table. Use the targets ?GL_PROXY_* for the first case and the other targets for the second case. Two moods, one function, periodt. ๐๐ฅ
External documentation. ๐
colorTableParameteriv(Target :: enum(),
Pname :: enum(),
Params :: {i(), i(), i(), i()}) ->
ok.
gl:colorTableParameter() is used to specify the scale factors and bias terms applied to color components when they are loaded into a color table. Target indicates which color table the scale and bias terms apply to; it must be set to ?GL_COLOR_TABLE, ?GL_POST_CONVOLUTION_COLOR_TABLE, or ?GL_POST_COLOR_MATRIX_COLOR_TABLE. So if you're trying to fine-tune the color table glow-up, this is the one. โจ๐๏ธ
External documentation. ๐
compileShader(Shader :: i()) -> ok.
gl:compileShader/1 compiles the source code strings that have been stored in the shader object specified by Shader. Basically it's the "go bestie, become a shader" button. ๐งโโ๏ธโ๏ธ
External documentation. ๐
compressedTexImage1D(Target, Level, Internalformat, Width, Border,
ImageSize, Data) ->
ok
when
Target :: enum(),
Level :: i(),
Internalformat :: enum(),
Width :: i(),
Border :: i(),
ImageSize :: i(),
Data :: offset() | mem().
Texturing allows elements of an image array to be read by shaders. ๐๐ผ๏ธ
External documentation. ๐
compressedTexImage2D(Target, Level, Internalformat, Width, Height,
Border, ImageSize, Data) ->
ok
when
Target :: enum(),
Level :: i(),
Internalformat :: enum(),
Width :: i(),
Height :: i(),
Border :: i(),
ImageSize :: i(),
Data :: offset() | mem().
Texturing allows elements of an image array to be read by shaders. Same iconic energy, now in 2D. ๐ฆ๐ผ๏ธ
External documentation. ๐
compressedTexImage3D(Target, Level, Internalformat, Width, Height,
Depth, Border, ImageSize, Data) ->
ok
when
Target :: enum(),
Level :: i(),
Internalformat :: enum(),
Width :: i(),
Height :: i(),
Depth :: i(),
Border :: i(),
ImageSize :: i(),
Data :: offset() | mem().
Texturing allows elements of an image array to be read by shaders. 3D? We love depth, literally. ๐๐ผ๏ธ
External documentation. ๐
compressedTextureSubImage1D(Texture, Level, Xoffset, Width,
Format, ImageSize, Data) ->
ok
when
Texture :: i(),
Level :: i(),
Xoffset :: i(),
Width :: i(),
Format :: enum(),
ImageSize :: i(),
Data :: offset() | mem().
Texturing allows elements of an image array to be read by shaders. Sub-image edition, 1D. ๐๐ผ๏ธ
External documentation. ๐
compressedTextureSubImage2D(Texture, Level, Xoffset, Yoffset,
Width, Height, Format, ImageSize,
Data) ->
ok
when
Texture :: i(),
Level :: i(),
Xoffset :: i(),
Yoffset :: i(),
Width :: i(),
Height :: i(),
Format :: enum(),
ImageSize :: i(),
Data :: offset() | mem().
Texturing allows elements of an image array to be read by shaders. Sub-image 2D, still serving. ๐ธ๐ผ๏ธ
External documentation. ๐
compressedTextureSubImage3D(Texture, Level, Xoffset, Yoffset,
Zoffset, Width, Height, Depth, Format,
ImageSize, Data) ->
ok
when
Texture :: i(),
Level :: i(),
Xoffset :: i(),
Yoffset :: i(),
Zoffset :: i(),
Width :: i(),
Height :: i(),
Depth :: i(),
Format :: enum(),
ImageSize :: i(),
Data :: offset() | mem().
Texturing allows elements of an image array to be read by shaders. Sub-image 3D, the final boss of texture sub-images. ๐๐ผ๏ธ
External documentation. ๐
convolutionFilter1D(Target, Internalformat, Width, Format, Type,
Image) ->
ok
when
Target :: enum(),
Internalformat :: enum(),
Width :: i(),
Format :: enum(),
Type :: enum(),
Image :: offset() | mem().
gl:convolutionFilter1D/6 builds a one-dimensional convolution filter kernel from an array of pixels. It's giving math but make it fashion. ๐ฅ๐งฎ
External documentation. ๐
gl:convolutionFilter2D/7 ๐
convolutionFilter2D(Target, Internalformat, Width, Height, Format,
Type, Image) ->
ok
when
Target :: enum(),
Internalformat :: enum(),
Width :: i(),
Height :: i(),
Format :: enum(),
Type :: enum(),
Image :: offset() | mem().
Okay so bestie, gl:convolutionFilter2D/7 builds a two-dimensional convolution filter kernel from an array of pixels. That's the whole vibe. The kernel is giving main character energy. โจ
External documentation.
gl:convolutionParameteriv/3 ๐
convolutionParameteriv(Target :: enum(),
Pname :: enum(),
Params :: tuple()) ->
ok.
gl:convolutionParameter() sets the value of a convolution parameter. Simple as that. ๐
External documentation.
gl:copyBufferSubData/5 ๐ฆ
copyBufferSubData(ReadTarget, WriteTarget, ReadOffset,
WriteOffset, Size) ->
ok
when
ReadTarget :: enum(),
WriteTarget :: enum(),
ReadOffset :: i(),
WriteOffset :: i(),
Size :: i().
gl:copyBufferSubData/5 and glCopyNamedBufferSubData copy part of the data store attached to a source buffer object to the data store attached to a destination buffer object. The number of basic machine units indicated by Size is copied from the source at offset ReadOffset to the destination at WriteOffset. ReadOffset, WriteOffset and Size are in terms of basic machine units. No cap. ๐ธ
External documentation.
gl:copyColorSubTable/5 ๐
copyColorSubTable(Target :: enum(),
Start :: i(),
X :: i(),
Y :: i(),
Width :: i()) ->
ok.
gl:copyColorSubTable/5 is used to respecify a contiguous portion of a color table previously defined using gl:colorTable/6. The pixels copied from the framebuffer replace the portion of the existing table from indices Start to start+x-1, inclusive. This region may not include any entries outside the range of the color table, as was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect. So yeah, zero width is a no-op. ๐คทโโ๏ธ
External documentation.
gl:copyColorTable/5 โจ
copyColorTable(Target :: enum(),
Internalformat :: enum(),
X :: i(),
Y :: i(),
Width :: i()) ->
ok.
gl:copyColorTable/5 loads a color table with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:colorTable/6). Lowkey iconic. ๐
External documentation.
gl:copyConvolutionFilter1D/5 ๐
copyConvolutionFilter1D(Target :: enum(),
Internalformat :: enum(),
X :: i(),
Y :: i(),
Width :: i()) ->
ok.
gl:copyConvolutionFilter1D/5 defines a one-dimensional convolution filter kernel with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:convolutionFilter1D/6). Periodt. ๐ซถ
External documentation.
gl:copyConvolutionFilter2D/6 ๐ธ
copyConvolutionFilter2D(Target :: enum(),
Internalformat :: enum(),
X :: i(),
Y :: i(),
Width :: i(),
Height :: i()) ->
ok.
gl:copyConvolutionFilter2D/6 defines a two-dimensional convolution filter kernel with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:convolutionFilter2D/7). Slay. ๐
External documentation.
gl:copyImageSubData/15 ๐ฅ
copyImageSubData(SrcName, SrcTarget, SrcLevel, SrcX, SrcY, SrcZ,
DstName, DstTarget, DstLevel, DstX, DstY, DstZ,
SrcWidth, SrcHeight, SrcDepth) ->
ok
when
SrcName :: i(),
SrcTarget :: enum(),
SrcLevel :: i(),
SrcX :: i(),
SrcY :: i(),
SrcZ :: i(),
DstName :: i(),
DstTarget :: enum(),
DstLevel :: i(),
DstX :: i(),
DstY :: i(),
DstZ :: i(),
SrcWidth :: i(),
SrcHeight :: i(),
SrcDepth :: i().
gl:copyImageSubData/15 may be used to copy data from one image (i.e. texture or renderbuffer) to another. gl:copyImageSubData/15 does not perform general-purpose conversions such as scaling, resizing, blending, color-space, or format conversions. It should be considered to operate in a manner similar to a CPU memcpy. CopyImageSubData can copy between images with different internal formats, provided the formats are compatible. So itโs like memcpy but for GPU images, and only if the formats vibe together. ๐
External documentation.
gl:copyPixels/5 ๐
copyPixels(X :: i(),
Y :: i(),
Width :: i(),
Height :: i(),
Type :: enum()) ->
ok.
gl:copyPixels/5 copies a screen-aligned rectangle of pixels from the specified frame buffer location to a region relative to the current raster position. Its operation is well defined only if the entire pixel source region is within the exposed portion of the window. Results of copies from outside the window, or from regions of the window that are not exposed, are hardware dependent and undefined. So bestie, donโt do that. ๐
External documentation.
gl:copyTexImage1D/7 โ
copyTexImage1D(Target, Level, Internalformat, X, Y, Width, Border) ->
ok
when
Target :: enum(),
Level :: i(),
Internalformat :: enum(),
X :: i(),
Y :: i(),
Width :: i(),
Border :: i().
gl:copyTexImage1D/7 defines a one-dimensional texture image with pixels from the current ?GL_READ_BUFFER. Thatโs the tea. ๐
External documentation.
gl:copyTexImage2D/8 ๐
copyTexImage2D(Target, Level, Internalformat, X, Y, Width, Height,
Border) ->
ok
when
Target :: enum(),
Level :: i(),
Internalformat :: enum(),
X :: i(),
Y :: i(),
Width :: i(),
Height :: i(),
Border :: i().
gl:copyTexImage2D/8 defines a two-dimensional texture image, or cube-map texture image with pixels from the current ?GL_READ_BUFFER. Iconic. โจ
External documentation.
gl:copyTexSubImage1D/6 ๐
copyTexSubImage1D(Target :: enum(),
Level :: i(),
Xoffset :: i(),
X :: i(),
Y :: i(),
Width :: i()) ->
ok.
gl:copyTexSubImage1D/6 and glCopyTextureSubImage1D replace a portion of a one-dimensional texture image with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:texSubImage1D/7). For gl:copyTexSubImage1D/6, the texture object that is bound to Target will be used for the process. For glCopyTextureSubImage1D, Texture tells which texture object should be used for the purpose of the call. See the difference? One uses the bound texture, the other uses the Texture you pass. ๐ซถ
External documentation.
gl:copyTexSubImage2D/8 ๐
copyTexSubImage2D(Target, Level, Xoffset, Yoffset, X, Y, Width,
Height) ->
ok
when
Target :: enum(),
Level :: i(),
Xoffset :: i(),
Yoffset :: i(),
X :: i(),
Y :: i(),
Width :: i(),
Height :: i().
gl:copyTexSubImage2D/8 and glCopyTextureSubImage2D replace a rectangular portion of a two-dimensional texture image, cube-map texture image, rectangular image, or a linear portion of a number of slices of a one-dimensional array texture with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:texSubImage2D/9). Thatโs a lot of things, but okay. ๐ธ
External documentation.
gl:copyTexSubImage3D/9 ๐ฆ
copyTexSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, X, Y,
Width, Height) ->
ok
when
Target :: enum(),
Level :: i(),
Xoffset :: i(),
Yoffset :: i(),
Zoffset :: i(),
X :: i(),
Y :: i(),
Width :: i(),
Height :: i().
gl:copyTexSubImage3D/9 and glCopyTextureSubImage3D functions replace a rectangular portion of a three-dimensional or two-dimensional array texture image with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:texSubImage3D/11). Note it says โfunctionsโ plural because it mentions two. ๐
External documentation.
gl:createBuffers/1 โจ
createBuffers(N :: i()) -> [i()].
gl:createBuffers/1 returns N previously unused buffer names in Buffers, each representing a new buffer object initialized as if it had been bound to an unspecified target. So you get a list of fresh buffer names. No cap. ๐
External documentation.
gl:createFramebuffers/1 ๐
createFramebuffers(N :: i()) -> [i()].
createFramebuffers/1</p>
gl:createFramebuffers(N :: i()) -> [i()]
okay so gl:createFramebuffers/1 hands you back N previously unused framebuffer names in Framebuffers โ bestie, each one is a brand new framebuffer object, freshly initialized to the default state. clean slate energy ๐
External documentation.
createProgram/0</p>
createProgram() -> i().
gl:createProgram/0 creates an empty program object and returns a non-zero value by which it can be referenced. a program object is literally an object you can attach shader objects to โ it's giving container, it's giving main character hosting the whole cast ๐ซถ
it's got two jobs, no cap:
- it's the mechanism for saying which shader objects will be linked together to create a program
- it's how you check the compatibility of the shaders that'll be used to build that program (like, are your vertex shader and your fragment shader even compatible? vibe check โจ)
and when you don't need a shader object as part of a program object anymore? you can detach it. no strings attached ๐
External documentation.
createProgramPipelines/1</p>
gl:createProgramPipelines(N :: i()) -> [i()]
gl:createProgramPipelines/1 returns N previously unused program pipeline names in Pipelines, each one a new program pipeline object initialized to the default state. iconic ๐
External documentation.
createQueries/2</p>
gl:createQueries(Target :: enum(), N :: i()) -> [i()]
gl:createQueries/2 returns N previously unused query object names in Ids, each representing a new query object with the specified Target. yes bestie, you tell it the target, it gives you the goods ๐ธ
External documentation.
createRenderbuffers/1</p>
gl:createRenderbuffers(N :: i()) -> [i()]
gl:createRenderbuffers/1 returns N previously unused renderbuffer object names in Renderbuffers, each a new renderbuffer object initialized to the default state. fresh out the box ๐
External documentation.
createSamplers/1</p>
gl:createSamplers(N :: i()) -> [i()]
gl:createSamplers/1 returns N previously unused sampler names in Samplers, each a new sampler object initialized to the default state. obsessed ๐ฆ
External documentation.
createShader/1</p>
createShader(Type :: enum()) -> i().
gl:createShader/1 creates an empty shader object and returns a non-zero value by which it can be referenced. a shader object is what holds onto the source code strings that define a shader, fr fr.
ShaderType says which type of shader you're making. Five types of shader are supported. (what they are๐)
- a shader of type
?GL_COMPUTE_SHADERโ intended to run on the programmable compute processor - a shader of type
?GL_VERTEX_SHADERโ intended to run on the programmable vertex processor - a shader of type
?GL_TESS_CONTROL_SHADERโ intended to run on the programmable tessellation processor in the control stage - a shader of type
?GL_TESS_EVALUATION_SHADERโ intended to run on the programmable tessellation processor in the evaluation stage - a shader of type
?GL_GEOMETRY_SHADERโ intended to run on the programmable geometry processor - a shader of type
?GL_FRAGMENT_SHADERโ intended to run on the programmable fragment processor
slay, that's the whole lineup ๐
External documentation.
createShaderProgramv/2</p>
createShaderProgramv(Type :: enum(),
Strings :: [unicode:chardata()]) -> i().
gl:createShaderProgram() creates a program object containing compiled and linked shaders for a single stage specified by Type. Strings refers to an array of Count strings from which to create the shader executables. one call, whole program, no cap ๐ญ๐ฅ
External documentation.
createTextures/2</p>
gl:createTextures(Target :: enum(), N :: i()) -> [i()]
gl:createTextures/2 returns N previously unused texture names in Textures, each representing a new texture object of the dimensionality and type specified by Target, and initialized to the default values for that texture type. the way it already knows what kind of texture you wanted... ๐
External documentation.
createTransformFeedbacks/1</p>
gl:createTransformFeedbacks(N :: i()) -> [i()]
gl:createTransformFeedbacks/1 returns N previously unused transform feedback object names in Ids, each a new transform feedback object initialized to the default state. ๐
External documentation.
createVertexArrays/1</p>
gl:createVertexArrays(N :: i()) -> [i()]
gl:createVertexArrays/1 returns N previously unused vertex array object names in Arrays, each a new vertex array object initialized to the default state. ๐
External documentation.
cullFace/1</p>
cullFace(Mode :: enum()) -> ok.
gl:cullFace/1 specifies whether front- or back-facing facets are culled (as specified by mode) โ but only when facet culling is enabled. and heads up bestie: facet culling is initially disabled. ๐
to turn facet culling on and off, you call gl:enable/1 and gl:disable/1 with the argument ?GL_CULL_FACE.
facets include triangles, quadrilaterals, polygons, and rectangles. yes, all of them. the whole squad ๐
External documentation.
debugMessageControl/5</p>
debugMessageControl(Source :: enum(),
Type :: enum(),
Severity :: enum(),
Ids :: [i()],
Enabled :: 0 | 1) -> ok.
gl:debugMessageControl/5 controls the reporting of debug messages generated by a debug context. the parameters Source, Type and Severity form a filter to select messages from the pool of potential messages generated by the GL. it's giving you choose what you wanna hear โจ
External documentation.
debugMessageInsert/5</p>
debugMessageInsert(Source :: enum(),
Type :: enum(),
Id :: i(),
Severity :: enum(),
Buf :: string()) -> ok.
gl:debugMessageInsert/5 inserts a user-supplied message into the debug output queue. so you can literally put your own lil notes in there ๐
- Source specifies the source that will be used to classify the message, and must be
?GL_DEBUG_SOURCE_APPLICATIONor?GL_DEBUG_SOURCE_THIRD_PARTY. all other sources are reserved for use by the GL implementation. - Type indicates the type of the message to be inserted, and may be one of
?GL_DEBUG_TYPE_ERROR,?GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR,?GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR,?GL_DEBUG_TYPE_PORTABILITY,?GL_DEBUG_TYPE_PERFORMANCE,?GL_DEBUG_TYPE_MARKER,?GL_DEBUG_TYPE_PUSH_GROUP,?GL_DEBUG_TYPE_POP_GROUP, or?GL_DEBUG_TYPE_OTHER. - Severity indicates the severity of the message, and may be
?GL_DEBUG_SEVERITY_LOW,?GL_DEBUG_SEVERITY_MEDIUM,?GL_DEBUG_SEVERITY_HIGHor?GL_DEBUG_SEVERITY_NOTIFICATION. - Id is available for application defined use and may be any value. this value will be recorded and used to identify the message. so like, tag it however you want ๐ท๏ธ
External documentation.
deleteBuffers/1</p>
deleteBuffers(Buffers :: [i()]) -> ok.
gl:deleteBuffers/1 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 โ aka the absence of any buffer object. gone, reduced to atoms ๐
External documentation.
deleteFramebuffers/1</p>
deleteFramebuffers(Framebuffers :: [i()]) -> ok.
gl:deleteFramebuffers/1 deletes the N framebuffer objects whose names are stored in the array addressed by Framebuffers.
heads up: the name zero is reserved by the GL and is silently ignored should it occur in Framebuffers โ same for other unused names, they just get skipped, no drama โจ
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.
External documentation.
deleteLists/2</p>
deleteLists(List :: i(), Range :: i()) -> ok.
gl:deleteLists/2 causes a contiguous group of display lists to be deleted. List is the name of the first display list to be deleted, and Range is the number of display lists to delete. all display lists d with list <= d <= list+range-1 are deleted. it's a whole block, they all go together ๐ซถ
External documentation.
deleteProgram/1</p>
deleteProgram(Program :: i()) -> ok.
gl:deleteProgram/1 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. hit undo, bestie ๐ญ
External documentation.
deleteProgramPipelines/1</p>
deleteProgramPipelines(Pipelines :: [i()]) -> ok.
gl:deleteProgramPipelines/1 deletes the N program pipeline objects whose names are stored in the array Pipelines. unused names in Pipelines are ignored, as is the name zero ๐
after a program pipeline object is deleted, its name is again unused and it has no contents. if a program pipeline object that is currently bound is deleted, the binding for that object reverts to zero and no program pipeline object becomes current. nobody's home ๐
External documentation.
deleteQueries/1</p>
deleteQueries(Ids :: [i()]) -> ok.
gl:deleteQueries/1 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). โป๏ธ
External documentation.
deleteRenderbuffers/1</p>
deleteRenderbuffers(Renderbuffers :: [i()]) -> ok.
gl:deleteRenderbuffers/1 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.
External documentation.
deleteSamplers/1</p>
deleteSamplers(Samplers :: [i()]) -> ok.
gl:deleteSamplers/1 deletes N sampler objects named by the elements of the array Samplers. after a sampler object is deleted, its name is again unused ๐ฆ
if a sampler object that is currently bound to a sampler unit is deleted, it is as though gl:bindSampler/2 is called with unit set to the unit the sampler is bound to and sampler zero. unused names in samplers are silently ignored, as is the reserved name zero. so chill, it won't yell at you ๐
External documentation.
deleteShader/1</p>
deleteShader(Shader :: i()) -> ok.
deleteShader(Shader :: i()) -> ok.โ bestie, this one frees the memory and invalidates the name tied to the shader object you named inShader. It's literally the undo button forgl:createShader/1. Poof, gone ๐จ
External documentation.
deleteSync(Sync :: i()) -> ok.โ sogl:deleteSync/1deletes the sync object you point at withSync. Here's the tea: if the fence command that goes with that sync object has already completed, or if there's nogl:waitSync/3orgl:clientWaitSync/3command blocking onSync, the object gets deleted immediately, no waiting ๐
But if something is blocking? Then Sync gets flagged for deletion and it'll be deleted later โ once it's not associated with any fence command anymore and isn't blocking any gl:waitSync/3 or gl:clientWaitSync/3 command. Either way, the moment gl:deleteSync/1 returns, the name Sync is invalid and you can't use it to refer to the sync object ever again. Periodt โจ
External documentation.
deleteTextures(Textures :: [i()]) -> ok.โgl:deleteTextures/1deletesNtextures named by the elements of the arrayTextures. After a texture is deleted it has no contents or dimensionality, and its name is free for reuse (like, say, bygl:genTextures/1). And if you delete a texture that's currently bound? The binding reverts to0โ that's the default texture, babe ๐
External documentation.
deleteTransformFeedbacks(Ids :: [i()]) -> ok.โ this deletes theNtransform feedback objects whose names live in the arrayIds. Unused names inIdsget ignored, and so does the name zero โ it's giving "we don't see you" ๐ After a transform feedback object is deleted, its name is again unused and it has no contents. And if you delete an active transform feedback object, its name immediately becomes unused, but the underlying object isn't actually deleted until it's no longer active. Sneaky but iconic ๐ฅ
External documentation.
deleteVertexArrays(Arrays :: [i()]) -> ok.โgl:deleteVertexArrays/1deletesNvertex array objects whose names are stored in the array addressed byArrays. Once a vertex array object is deleted it has no contents and its name is again unused. If a vertex array object that's currently bound gets deleted, the binding for that object reverts to zero and the default vertex array becomes current. Unused names inArraysare silently ignored โ same for the value zero. No drama, no error, they just don't exist to us anymore ๐
External documentation.
depthFunc(Func :: enum()) -> ok.โgl:depthFunc/1specifies the function used to compare each incoming pixel depth value against the depth value already chillin' in the depth buffer. Important: the comparison only happens if depth testing is enabled. (Seegl:enable/1andgl:disable/1of?GL_DEPTH_TEST.) ๐
External documentation.
depthMask(Flag :: 0 | 1) -> ok.โgl:depthMask/1says whether the depth buffer is enabled for writing. IfFlagis?GL_FALSE, depth buffer writing is disabled. Otherwise it's enabled. And initially? Depth buffer writing is enabled. Default behavior said slay ๐
External documentation.
depthRangeArrayv(First :: i(), V :: [{f(), f()}]) -> ok.โ okay so after clipping and division byw, depth coordinates range from-1to1, corresponding to the near and far clipping planes. Each viewport has its own independent depth range, specified as a linear mapping of the normalized depth coordinates in this range to window depth coordinates. And regardless of how the actual depth buffer is implemented, window coordinate depth values are treated as though they range from0through1(like color components, cute) ๐
gl:depthRangeArray() specifies that linear mapping for each viewport in the range First, First + Count). So the values accepted by gl:depthRangeArray() are both clamped to this range before they're accepted. Lowkey very picky of them.
External documentation.
depthRangeIndexed(Index :: i(), N :: f(), F :: f()) -> ok.โ same whole deal: after clipping and division byw, depth coordinates range from-1to1, corresponding to the near and far clipping planes. Each viewport gets an independent depth range defined as a linear mapping of normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from0through1(like color components) โจ
gl:depthRangeIndexed/3 specifies that linear mapping for a specified viewport. Thus, the values accepted by gl:depthRangeIndexed/3 are both clamped to this range before they're accepted. Same clamp energy, different function ๐
External documentation.
depthRangef(N :: f(), F :: f()) -> ok.โ yep, again: after clipping and division byw, depth coordinates range from-1to1, corresponding to the near and far clipping planes.gl:depthRange/2specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from0through1(like color components). Thus, the values accepted bygl:depthRange/2are both clamped to this range before they're accepted ๐ธ
External documentation.
detachShader(Program :: i(), Shader :: i()) -> ok.โgl:detachShader/2detaches the shader object named byShaderfrom the program object named byProgram. This is your undo forgl:attachShader/2. It's giving "we were never together" ๐ญ
External documentation.
dispatchCompute(Num_groups_x :: i(), Num_groups_y :: i(), Num_groups_z :: i()) -> ok.โgl:dispatchCompute/3launches one or more compute work groups ๐ Each work group is processed by the active program object for the compute shader stage. And here's the vibe: while the individual shader invocations inside a work group are executed as a unit, work groups are executed completely independently and in unspecified order โ so don't come for them about timing, bestie.Num_groups_x,Num_groups_yandNum_groups_zspecify how many local work groups get dispatched in the X, Y and Z dimensions respectively. Slay in 3D ๐
External documentation.
dispatchComputeIndirect(Indirect :: i()) -> ok.โgl:dispatchComputeIndirect/1launches one or more compute work groups using parameters stored in the buffer object currently bound to the?GL_DISPATCH_INDIRECT_BUFFERtarget. Each work group is processed by the active program object for the compute shader stage. While the individual shader invocations within a work group are executed as a unit, work groups are executed completely independently and in unspecified order โ no cap ๐งIndirectholds the offset into the data store of the buffer object bound to?GL_DISPATCH_INDIRECT_BUFFERwhere those parameters are stored.
External documentation.
drawArrays(Mode :: enum(), First :: i(), Count :: i()) -> ok.โgl:drawArrays/3specifies multiple geometric primitives with very few subroutine calls, which is the whole point โจ Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call togl:drawArrays/3. Efficiency? We love her ๐
External documentation.
drawArraysIndirect(Mode :: enum(), Indirect :: offset() | mem()) -> ok.โgl:drawArraysIndirect/2specifies multiple geometric primitives with very few subroutine calls too. It behaves similarly togl:drawArraysInstancedBaseInstance/5, execept that the parameters togl:drawArraysInstancedBaseInstance/5are stored in memory at the address given byIndirect๐
External documentation.
drawArraysInstanced(Mode :: enum(), First :: i(), Count :: i(), Instancecount :: i()) -> ok.โgl:drawArraysInstanced/4behaves identically togl:drawArrays/3except thatInstancecountinstances of the range of elements are executed, and the value of the internal counterInstanceIDadvances for each iteration ๐InstanceIDis an internal 32-bit integer counter that may be read by a vertex shader as?gl_InstanceID.
External documentation.
drawArraysInstancedBaseInstance(Mode :: enum(), First :: i(), Count :: i(), Instancecount :: i(), Baseinstance :: i()) -> ok.โgl:drawArraysInstancedBaseInstance/5behaves identically togl:drawArrays/3except thatInstancecountinstances of the range of elements are executed and the value of the internal counterInstanceIDadvances for each iteration ๐InstanceIDis an internal 32-bit integer counter that may be read by a vertex shader as?gl_InstanceID.
External documentation.
drawBuffer(Mode :: enum()) -> ok.โ when colors are written to the frame buffer, they get written into the color buffers specified bygl:drawBuffer/1๐จ One of the following values can be used for default framebuffer:
External documentation.
drawBuffers(Bufs :: [enum()]) -> ok.โgl:drawBuffers/1andglNamedFramebufferDrawBuffersdefine an array of buffers that fragment shader data outputs get written into ๐ If a fragment shader writes a value to one or more user defined output variables, then the value of each variable gets written into the buffer specified at a location withinBufscorresponding to the location assigned to that user defined output. And the draw buffer used for user defined outputs assigned to locations greater than or equal toN? It's implicitly set to?GL_NONE, and any data written to such an output is discarded. Not the data being ghosted ๐
External documentation.
๐ gl:drawElements/4 โ the element-array era begins
drawElements(Mode :: enum(),
Count :: i(),
Type :: enum(),
Indices :: offset() | mem()) ->
ok.
gl:drawElements/4 slaps multiple geometric primitives into existence with very few subroutine calls, which is the whole vibe. Instead of calling a GL function to pass each individual vertex, normal, texture coordinate, edge flag, or color one by one (exhausting, honestly), you can prespecify separate arrays of vertices, normals, and so on, and then use them to construct a sequence of primitives with a single call to gl:drawElements/4. One call. Main character energy. ๐ฆ
External documentation.
๐
gl:drawElementsBaseVertex/5 โ same but with a base offset
drawElementsBaseVertex(Mode, Count, Type, Indices, Basevertex) ->
ok
when
Mode :: enum(),
Count :: i(),
Type :: enum(),
Indices :: offset() | mem(),
Basevertex :: i().
gl:drawElementsBaseVertex/5 behaves identically to gl:drawElements/4, bestie, with one lil twist: the ith element transferred by the corresponding draw call gets taken from element Indices[i] + Basevertex of each enabled array. So far so cute. โจ
But listen: if the resulting value is larger than the maximum value representable by Type, it's as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions, yikes). And if the sum would be negative? The operation is undefined. No cap, so maybe don't do that. ๐ญ
External documentation.
๐ gl:drawElementsIndirect/3 โ the parameters live in memory now
drawElementsIndirect(Mode :: enum(),
Type :: enum(),
Indirect :: offset() | mem()) ->
ok.
gl:drawElementsIndirect/3 specifies multiple indexed geometric primitives with very few subroutine calls โ yes, again, iconic behaviour. It behaves similarly to gl:drawElementsInstancedBaseVertexBaseInstance/7, except that the parameters to gl:drawElementsInstancedBaseVertexBaseInstance/7 are stored in memory at the address given by Indirect. Sneaky. Indirect. Love that for it. ๐
External documentation.
๐ฅ gl:drawElementsInstanced/5 โ now we're looping
drawElementsInstanced(Mode, Count, Type, Indices, Instancecount) ->
ok
when
Mode :: enum(),
Count :: i(),
Type :: enum(),
Indices :: offset() | mem(),
Instancecount :: i().
gl:drawElementsInstanced/5 behaves identically to gl:drawElements/4 except that Instancecount instances of the set of elements are executed, and the value of the internal counter InstanceID advances for each iteration. Glow-up per loop, honestly. โจ
InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID. Foreshadowing: you'll want it later. ๐
External documentation.
๐ฆ gl:drawElementsInstancedBaseInstance/6 โ same deal, base instance edition
drawElementsInstancedBaseInstance(Mode, Count, Type, Indices,
Instancecount, Baseinstance) ->
ok
when
Mode :: enum(),
Count :: i(),
Type :: enum(),
Indices :: offset() | mem(),
Instancecount :: i(),
Baseinstance :: i().
gl:drawElementsInstancedBaseInstance/6 behaves identically to gl:drawElements/4 except that Instancecount instances of the set of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID. Yeah, it's the same paragraph as before. It's giving consistency. Periodt. ๐
External documentation.
๐ gl:drawElementsInstancedBaseVertex/6 โ instanced AND offset
drawElementsInstancedBaseVertex(Mode, Count, Type, Indices,
Instancecount, Basevertex) ->
ok
when
Mode :: enum(),
Count :: i(),
Type :: enum(),
Indices :: offset() | mem(),
Instancecount :: i(),
Basevertex :: i().
gl:drawElementsInstancedBaseVertex/6 behaves identically to gl:drawElementsInstanced/5 except that the ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. ๐ธ
And the caveats, because there's always a caveat: if the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative. Be careful, bestie, fr fr. ๐ญ
External documentation.
๐ gl:drawElementsInstancedBaseVertexBaseInstance/7 โ the full send
drawElementsInstancedBaseVertexBaseInstance(Mode, Count, Type,
Indices,
Instancecount,
Basevertex,
Baseinstance) ->
ok
when
Mode :: enum(),
Count :: i(),
Type :: enum(),
Indices :: offset() | mem(),
Instancecount :: i(),
Basevertex :: i(),
Baseinstance :: i().
gl:drawElementsInstancedBaseVertexBaseInstance/7 behaves identically to gl:drawElementsInstanced/5 except that the ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative. Every parameter, every warning, we're keeping them all, no skips. ๐
External documentation.
๐ gl:drawPixels/5 โ memory to framebuffer, straight up
drawPixels(Width :: i(),
Height :: i(),
Format :: enum(),
Type :: enum(),
Pixels :: offset() | mem()) ->
ok.
gl:drawPixels/5 reads pixel data from memory and writes it into the frame buffer relative to the current raster position โ but only provided that the raster position is valid. Gatekept, kinda. ๐ช
So how do you make it valid? Use gl:rasterPos() or gl:windowPos() to set the current raster position. Then use gl:get() with argument ?GL_CURRENT_RASTER_POSITION_VALID to figure out if the specified raster position is valid, and gl:get() with argument ?GL_CURRENT_RASTER_POSITION to query the raster position itself. Vibe check your raster position before you commit, okay? โ
External documentation.
๐ธ gl:drawRangeElements/6 โ drawElements but with boundaries
drawRangeElements(Mode, Start, End, Count, Type, Indices) -> ok
when
Mode :: enum(),
Start :: i(),
End :: i(),
Count :: i(),
Type :: enum(),
Indices :: offset() | mem().
gl:drawRangeElements/6 is a restricted form of gl:drawElements/4. Mode and Count match the corresponding arguments to gl:drawElements/4, with the additional constraint that all values in the arrays Count must lie between Start and End, inclusive. Stay in your lane, values. ๐ฆ
External documentation.
โจ gl:drawRangeElementsBaseVertex/7 โ restricted, but with base vertex
drawRangeElementsBaseVertex(Mode, Start, End, Count, Type,
Indices, Basevertex) ->
ok
when
Mode :: enum(),
Start :: i(),
End :: i(),
Count :: i(),
Type :: enum(),
Indices :: offset() | mem(),
Basevertex :: i().
gl:drawRangeElementsBaseVertex/7 is a restricted form of gl:drawElementsBaseVertex/5. Mode, Count and Basevertex match the corresponding arguments to gl:drawElementsBaseVertex/5, with the additional constraint that all values in the array Indices must lie between Start and End, inclusive, prior to adding Basevertex. โ ๏ธ
Index values lying outside the range [Start, End] are treated in the same way as gl:drawElementsBaseVertex/5 โ so no new rules, we're just reusing them. Then: the ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative. Say it with me one more time: negative sum, undefined, do not. ๐
External documentation.
๐ซ gl:drawTransformFeedback/2 โ count, but sourced from feedback
drawTransformFeedback(Mode :: enum(), Id :: i()) -> ok.
gl:drawTransformFeedback/2 draws primitives of a type specified by Mode using a count retrieved from the transform feedback specified by Id. Recycling era! โป๏ธ
Calling gl:drawTransformFeedback/2 is equivalent to calling gl:drawArrays/3 with Mode as specified, First set to zero, and Count set to the number of vertices captured on vertex stream zero the last time transform feedback was active on the transform feedback object named by Id. That's the whole recipe, lowkey elegant. ๐ฅ
External documentation.
drawTransformFeedbackInstanced(Mode :: enum(), Id :: i(), Instancecount :: i()) -> ok.
ok so gl:drawTransformFeedbackInstanced/3 draws multiple copies of a range of primitives โ the type is whatever Mode says โ and the count? it's not yours, bestie, it's retrieved from the transform feedback stream specified by Stream of the transform feedback object specified by Id โจ
and listen: calling gl:drawTransformFeedbackInstanced/3 is exactly equivalent to calling gl:drawArraysInstanced/4 with Mode and Instancecount as specified, First set to zero, and Count set to the number of vertices captured on vertex stream zero the last time transform feedback was active on the transform feedback object named by Id ๐
External documentation.
drawTransformFeedbackStream(Mode :: enum(), Id :: i(), Stream :: i()) -> ok.
gl:drawTransformFeedbackStream/3 draws primitives of a type specified by Mode, using a count retrieved from the transform feedback stream specified by Stream of the transform feedback object specified by Id ๐ฆ
and it's equivalent to calling gl:drawArrays/3 with Mode as specified, First set to zero, and Count set to the number of vertices captured on vertex stream Stream the last time transform feedback was active on the transform feedback object named by Id โจ (yes, the same energy as the instanced one, but this one's not instanced, iykyk)
External documentation.
drawTransformFeedbackStreamInstanced(Mode :: enum(), Id :: i(), Stream :: i(), Instancecount :: i()) -> ok.
gl:drawTransformFeedbackStreamInstanced/4 draws multiple copies of a range of primitives of a type specified by Mode, and the count comes from the transform feedback stream specified by Stream of the transform feedback object specified by Id ๐
calling gl:drawTransformFeedbackStreamInstanced/4 is equivalent to calling gl:drawArraysInstanced/4 with Mode and Instancecount as specified, First set to zero, and Count set to the number of vertices captured on vertex stream Stream the last time transform feedback was active on the transform feedback object named by Id ๐ธ
External documentation.
edgeFlagPointer(Stride :: i(), Ptr :: offset() | mem()) -> ok.
gl:edgeFlagPointer/2 says where the array lives and what shape it's in โ specifically an array of boolean edge flags to use when rendering ๐
and Stride? that's the byte stride from one edge flag to the next, which is the whole trick that lets vertices and attributes be packed into a single array or stored in separate arrays. your call, bestie.
External documentation.
edgeFlagv({Flag :: 0 | 1}) -> ok.
every vertex of a polygon, separate triangle, or separate quadrilateral specified between a gl:'begin'/1 / gl:'end'/0 pair gets marked as the start of either a boundary or nonboundary edge ๐
if the current edge flag is true when the vertex is specified, the vertex is marked as the start of a boundary edge. otherwise it's the start of a nonboundary edge. and gl:edgeFlag/1 sets the edge flag bit to ?GL_TRUE if Flag is ?GL_TRUE, and to ?GL_FALSE otherwise. periodt.
External documentation.
enableClientState(Cap :: enum()) -> ok.
gl:enableClientState/1 and gl:disableClientState/1 turn individual client-side capabilities on or off ๐
and by default? bestie, all client-side capabilities are disabled. that's the starting position.
both of them take a single argument, Cap, which can assume one of the following values:
External documentation.
enableVertexAttribArray(Index :: i()) -> ok.
gl:enableVertexAttribArray/1 and gl:enableVertexArrayAttrib/2 enable the generic vertex attribute array specified by Index โจ
here's the difference tho: gl:enableVertexAttribArray/1 uses the currently bound vertex array object for the operation, whereas gl:enableVertexArrayAttrib/2 updates the state of the vertex array object with ID Vaobj. not the same girl, don't mix them up.
External documentation.
enablei(Target :: enum(), Index :: i()) -> ok.
gl:enable/1 and gl:disable/1 enable and disable various capabilities. use gl:isEnabled/1 or gl:get() to find out the current setting of any capability โ vibe check your own state, bestie ๐
initial value for every capability, with the exception of ?GL_DITHER and ?GL_MULTISAMPLE, is ?GL_FALSE. the initial value for ?GL_DITHER and ?GL_MULTISAMPLE is ?GL_TRUE. those two are just built different, no cap.
External documentation.
'end'() -> ok.
gl:'begin'/1 and gl:'end'/0 delimit the vertices that define a primitive or a group of like primitives ๐
gl:'begin'/1 takes a single argument that specifies in which of ten ways the vertices are interpreted. taking n as an integer count starting at one, and N as the total number of vertices specified, the interpretations are as follows:
External documentation.
endConditionalRender() -> ok.
conditional rendering is started with gl:beginConditionalRender/2 and ended with gl:endConditionalRender/0 ๐ and during conditional rendering, all vertex array commands, plus gl:clear/1 and gl:clearBuffer(), 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 ๐ญ
heads up bestie: the results of commands setting the current vertex state, like gl:vertexAttrib(), are undefined. undefined is not a vibe. ๐
if the ?GL_SAMPLES_PASSED result is non-zero, or if the ?GL_ANY_SAMPLES_PASSED result is ?GL_TRUE, then those commands are not discarded โจ
the Id parameter to gl:beginConditionalRender/2 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 those results to decide 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. impatient icon behavior.
External documentation.
endQuery(Target :: enum()) -> ok.
gl:beginQuery/2 and gl:endQuery/1 delimit the boundaries of a query object ๐ซ
Query must be a name previously returned from a call to gl:genQueries/1. and if a query object with name Id doesn't exist yet, it gets 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 โ that's the whole list, no extras, don't freestyle it. the behavior of the query object depends on its type and is as follows.
External documentation.
endQueryIndexed(Target :: enum(), Index :: i()) -> ok.
gl:beginQueryIndexed/3 and gl:endQueryIndexed/2 delimit the boundaries of a query object ๐ธ same deal as the last one.
Query must be a name previously returned from a call to gl:genQueries/1. if a query object with name Id doesn't exist yet 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. and yes, the behavior of the query object depends on its type and is as follows.
External documentation.
endTransformFeedback() -> ok.
transform feedback mode captures the values of varying variables written by the vertex shader (or, if it's active, the geometry shader) ๐
transform feedback is said to be active after a call to gl:beginTransformFeedback/1 until a subsequent call to gl:endTransformFeedback/0. and transform feedback commands must be paired. they're a matching set, bestie, don't leave one hanging ๐
External documentation.
evalCoord2fv({U :: f(), V :: f()}) -> ok.
gl:evalCoord1() evaluates enabled one-dimensional maps at argument U โจ gl:evalCoord2() does the same thing for two-dimensional maps, using two domain values, U and V ๐
to define a map, call glMap1 and glMap2; to enable and disable it, call gl:enable/1 and gl:disable/1. that's the whole loop, no cap.
External documentation.
evalMesh2(Mode :: enum(), I1 :: i(), I2 :: i(), J1 :: i(), J2 :: i()) -> ok.
gl:mapGrid() and gl:evalMesh() work in tandem to efficiently generate and evaluate a series of evenly-spaced map domain values ๐
gl:evalMesh() steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1 and glMap2. and Mode determines whether the resulting vertices get connected as points, lines, or filled polygons โ points / lines / filled, pick your era โจ
External documentation.
evalPoint2(I :: i(), J :: i()) -> ok.
gl:mapGrid() and gl:evalMesh() are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values ๐ซ and gl:evalPoint() can be used to evaluate a single grid point in the same gridspace that's traversed by gl:evalMesh() ๐
calling gl:evalPoint1/1 is equivalent to calling glEvalCoord1( i.รฐ u+u 1 ); where รฐ u=(u 2-u 1)/n
External documentation.
feedbackBuffer(Size :: i(), Type :: enum(), Buffer :: mem()) -> ok.
gl:feedbackBuffer/3 controls feedback ๐ฆ and feedback, like selection, is a GL mode โ you select it by calling gl:renderMode/1 with ?GL_FEEDBACK.
when the GL is in feedback mode, no pixels are produced by rasterization ๐ญ instead, information about the primitives that would have been rasterized gets fed back to the application using the GL. plot twist, but make it useful.
External documentation.
fenceSync(Condition :: enum(), Flags :: i()) -> i().
gl:fenceSync/2 creates a new fence sync object, inserts a fence command into the GL command stream, associates it with that sync object, and returns a non-zero name corresponding to the sync object โจ yes bestie it gives you a name back, that's the i() in the signature, obsessed ๐ซถ
External documentation.
finish() -> ok.
### gl:finish/0 (part 2, the sequel)
okay so gl:finish/0 does not come back until the effects of every single GL command you called before it are, like, done done. and when we say effects, we mean all of it, bestie: every change to GL state, every change to connection state, and every change to the frame buffer contents. no sneaky stragglers. ๐
๐ External documentation.
### flush/0 ๐
flush() -> ok.
okay so different GL implementations be buffering commands in, like, several totally different locations โ network buffers, the graphics accelerator itself, the whole vibe. gl:flush/0 empties all of those buffers, which makes every command you issued actually get executed as fast as the real rendering engine will accept it. and like, that execution might not be finished in any particular time period, but it does finish in finite time. so, no cap, it ends. โจ
๐ External documentation.
### flushMappedNamedBufferRange/3 ๐ฟ
flushMappedNamedBufferRange(Buffer :: i(),
Offset :: i(),
Length :: i()) ->
ok.
gl:flushMappedBufferRange/3 is literally telling the universe "hey, i made changes to a range of a mapped buffer object." the buffer object must have previously been mapped with the ?GL_MAP_FLUSH_EXPLICIT_BIT flag โ otherwise, not it. ๐ซถ
๐ External documentation.
### fogCoordPointer/3 ๐ซ๏ธ
fogCoordPointer(Type :: enum(),
Stride :: i(),
Pointer :: offset() | mem()) ->
ok.
gl:fogCoordPointer/3 sets up the location and data format of an array of fog coordinates to use when rendering. Type is the data type of each fog coordinate, and Stride is the byte stride from one fog coordinate to the next โ which is how you get vertices and attributes packed into one single array, or stored in separate arrays. your call, your aesthetic. ๐
๐ External documentation.
### fogCoordfv/1 ๐จ
fogCoordfv({Coord :: f()}) -> ok.
gl:fogCoord() specifies the fog coordinate that's associated with each vertex and with the current raster position. the value you give gets interpolated and used to compute the fog color (see gl:fog()). it's giving atmosphere, honestly. ๐
๐ External documentation.
### fogiv/2 ๐
fogiv(Pname :: enum(), Params :: tuple()) -> ok.
fog is initially disabled, fyi. while it's enabled, fog affects rasterized geometry, bitmaps, and pixel blocks โ but not buffer clear operations, so don't come for those. to turn fog on and off, call gl:enable/1 and gl:disable/1 with the argument ?GL_FOG. periodt. ๐
๐ External documentation.
### framebufferParameteri/3 ๐๏ธ
framebufferParameteri(Target :: enum(),
Pname :: enum(),
Param :: i()) ->
ok.
gl:framebufferParameteri/3 and glNamedFramebufferParameteri modify the value of the parameter named Pname in the specified framebuffer object. lowkey important: there are no modifiable parameters of the default draw and read framebuffer, so they're not valid targets of these commands. sorry babe. ๐
๐ External documentation.
### framebufferRenderbuffer/4 ๐ผ๏ธ
framebufferRenderbuffer(Target, Attachment, Renderbuffertarget,
Renderbuffer) ->
ok
when
Target :: enum(),
Attachment :: enum(),
Renderbuffertarget :: enum(),
Renderbuffer :: i().
gl:framebufferRenderbuffer/4 and glNamedFramebufferRenderbuffer attach a renderbuffer as one of the logical buffers of the specified framebuffer object. and once again: renderbuffers cannot be attached to the default draw and read framebuffer, so those are not valid targets of these commands. the default framebuffer is not like the other girls. ๐
๐ External documentation.
### framebufferTextureLayer/5 ๐ง
framebufferTextureLayer(Target :: enum(),
Attachment :: enum(),
Texture :: i(),
Level :: i(),
Layer :: i()) ->
ok.
these commands attach a selected mipmap level or image of a texture object as one of the logical buffers of the specified framebuffer object. and yep, you guessed it โ textures cannot be attached to the default draw and read framebuffer, so they're not valid targets of these commands either. โจ
๐ External documentation.
### frontFace/1 ๐
frontFace(Mode :: enum()) -> ok.
in a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. so eliminating those invisible polygons has the obvious benefit of speeding up rendering of the image โ free performance, literally an icon. to enable and disable elimination of back-facing polygons, call gl:enable/1 and gl:disable/1 with the argument ?GL_CULL_FACE. ๐
๐ External documentation.
### frustum/6 ๐
frustum(Left :: f(),
Right :: f(),
Bottom :: f(),
Top :: f(),
Near_val :: f(),
Far_val :: f()) ->
ok.
gl:frustum/6 describes a perspective matrix that produces a perspective projection. the current matrix (see gl:matrixMode/1) gets multiplied by this matrix and the result replaces the current matrix โ exactly as if gl:multMatrix() were called with the following matrix as its argument:
๐ External documentation.
### genBuffers/1 ๐งบ
genBuffers(N :: i()) -> [i()].
gl:genBuffers/1 returns N buffer object names in Buffers. there's no guarantee the names form a contiguous set of integers, BUT it is guaranteed that none of the returned names was in use immediately before the call to gl:genBuffers/1. so, fresh names only. ๐
๐ External documentation.
### genFramebuffers/1 ๐ช
genFramebuffers(N :: i()) -> [i()].
gl:genFramebuffers/1 returns N framebuffer object names in Ids. no guarantee they're contiguous integers, but fr fr, it is guaranteed that none of the returned names was in use immediately before the call to gl:genFramebuffers/1. ๐ฆ
๐ External documentation.
### genLists/1 ๐
genLists(Range :: i()) -> i().
gl:genLists/1 takes one argument, Range. it returns an integer n such that Range contiguous empty display lists, named n, n+1, ..., n+range-1, are created. and here's the catch: if Range is 0, if there's no group of Range contiguous names available, or if any error is generated, then no display lists get generated and 0 is returned. zero display lists, bestie, zero. ๐ญ
๐ External documentation.
### genProgramPipelines/1 ๐ ๏ธ
genProgramPipelines(N :: i()) -> [i()].
gl:genProgramPipelines/1 returns N previously unused program pipeline object names in Pipelines. these names get marked as used โ for the purposes of gl:genProgramPipelines/1 only โ but they only actually acquire program pipeline state when they're first bound. so they're like, reserved, not fully moved in yet. ๐
๐ External documentation.
### genQueries/1 โ
genQueries(N :: i()) -> [i()].
gl:genQueries/1 returns N query object names in Ids. no guarantee they're contiguous integers, however it is guaranteed that none of the returned names was in use immediately before the call to gl:genQueries/1. ๐
๐ External documentation.
### genRenderbuffers/1 ๐งต
genRenderbuffers(N :: i()) -> [i()].
gl:genRenderbuffers/1 returns N renderbuffer object names in Renderbuffers. not guaranteed contiguous, but guaranteed that none of the returned names was in use immediately before the call to gl:genRenderbuffers/1. slay. โจ
๐ External documentation.
### genSamplers/1 ๐๏ธ
genSamplers(Count :: i()) -> [i()].
gl:genSamplers/1 returns N sampler object names in Samplers. no guarantee of contiguous integers, but it is guaranteed that none of the returned names was in use immediately before the call to gl:genSamplers/1. ๐
๐ External documentation.
### genTextures/1 ๐งถ
genTextures(N :: i()) -> [i()].
gl:genTextures/1 returns N texture names in Textures. you already know the vibe: not guaranteed contiguous, but guaranteed that none of the returned names was in use immediately before the call to gl:genTextures/1. ๐ธ
๐ External documentation.
### genTransformFeedbacks/1 ๐
genTransformFeedbacks(N :: i()) -> [i()].
gl:genTransformFeedbacks/1 returns N previously unused transform feedback object names in Ids. these names are marked as used โ for the purposes of gl:genTransformFeedbacks/1 only โ but they only acquire transform feedback state when they are first bound. main character energy, but they need to be bound first. ๐
๐ External documentation.
### genVertexArrays/1 ๐๏ธ
genVertexArrays(N :: i()) -> [i()].
gl:genVertexArrays/1 returns N vertex array object names in Arrays. no guarantee they're contiguous integers, however it is guaranteed that none of the returned names was in use immediately before the call to gl:genVertexArrays/1. obsessed with the consistency tbh. ๐ซถ
๐ External documentation.
### generateTextureMipmap/1 ๐ช
generateTextureMipmap(Texture :: i()) -> ok.
gl:generateMipmap/1 and gl:generateTextureMipmap/1 generate mipmaps for the specified texture object. for gl:generateMipmap/1, that's the texture object bound to Target. for gl:generateTextureMipmap/1, Texture is the name of the texture object. two ways, same glow-up. โจ
๐ External documentation.
### getActiveAttrib/3 ๐
getActiveAttrib(Program :: i(), Index :: i(), BufSize :: i()) ->
{Size :: i(), Type :: enum(), Name ::
string()}.
gl:getActiveAttrib/3 returns info about an active attribute variable in the program object specified by Program. you can get the number of active attributes by calling gl:getProgram() with the value ?GL_ACTIVE_ATTRIBUTES. a value of 0 for Index selects the first active attribute variable, and permissible values for Index range from zero up to the number of active attribute variables minus one. no going over, bestie. ๐
๐ External documentation.
### getActiveSubroutineName/4 ๐ท๏ธ
getActiveSubroutineName(Program :: i(),
Shadertype :: enum(),
Index :: i(),
Bufsize :: i()) ->
string().
gl:getActiveSubroutineName/4 queries the name of an active shader subroutine uniform from the program object given in Program. Index specifies the index of the shader subroutine uniform within the shader stage given by Stage, and it must be between zero and the value of ?GL_ACTIVE_SUBROUTINES minus one for that shader stage. stay in your range, babe. ๐
๐ External documentation.
getActiveSubroutineUniformName(Program :: i(), Shadertype :: enum(), Index :: i(), Bufsize :: i()) -> string().
okay so gl:getActiveSubroutineUniformName/4 grabs the name of an active shader subroutine uniform. ๐
Programโ has the name of the program that's holding the uniform, bestieShadertypeโ says which stage this uniform location (Index) is valid forIndexโ must be between zero and the value of?GL_ACTIVE_SUBROUTINE_UNIFORMSminus one for the shader stage, no exceptions โ
External documentation.
getActiveUniform(Program :: i(), Index :: i(), BufSize :: i()) -> {Size :: i(), Type :: enum(), Name :: string()}.
gl:getActiveUniform/3 serves up info about an active uniform variable inside the program object you named in Program. ๐ธ
Wanna know how many active uniform variables exist? Call gl:getProgram() with the value ?GL_ACTIVE_UNIFORMS and boom, there's your count. โจ
Indexof 0 picks the very first active uniform variable- legal
Indexvalues run from zero up to the number of active uniform variables minus one โ go outside that and that's a you problem ๐
External documentation.
getActiveUniformBlockName(Program :: i(), UniformBlockIndex :: i(), BufSize :: i()) -> string().
gl:getActiveUniformBlockName/3 pulls the name of the active uniform block sitting at UniformBlockIndex inside Program. simple as that, iconic ๐
External documentation.
getActiveUniformBlockiv(Program :: i(), UniformBlockIndex :: i(), Pname :: enum(), Params :: mem()) -> ok.
gl:getActiveUniformBlockiv/4 gets you information about an active uniform block within Program. that's the whole vibe ๐ฆ
External documentation.
getActiveUniformName(Program :: i(), UniformIndex :: i(), BufSize :: i()) -> string().
gl:getActiveUniformName/3 returns the name of the active uniform at UniformIndex within Program. let me break it down for you ๐ซถ
- If
UniformNameis notNULL, up toBufSizecharacters (including a nul-terminator) get written into the array whose address is specified byUniformName. - If
Lengthis notNULL, the number of characters that were (or would have been) written intoUniformNameโ not counting the nul-terminator โ gets placed in the variable whose address is specified inLength. - If
LengthisNULL, no length comes back at all. ๐
wanna know the length of the longest uniform name in Program? that's the value of ?GL_ACTIVE_UNIFORM_MAX_LENGTH, which you can query with gl:getProgram(). ๐
External documentation.
getActiveUniformsiv(Program :: i(), UniformIndices :: [i()], Pname :: enum()) -> [i()].
gl:getActiveUniformsiv/3 queries the value of the parameter named Pname for each of the uniforms within Program whose indices you listed in the array of UniformCount unsigned integers called UniformIndices. ๐ฅ
On success, the value of the parameter for each uniform is written into the matching entry in the array whose address is given in Params. If an error gets generated, nothing is written into Params โ periodt. โ
External documentation.
getAttachedShaders(Program :: i(), MaxCount :: i()) -> [i()].
gl:getAttachedShaders/2 returns the names of the shader objects attached to Program. ๐
- the names of shader objects attached to
Programcome back inShaders - the actual number of shader names written into
Shaderscomes back inCount - if no shader objects are attached to
Program,Countis set to 0 - the max number of shader names that may be returned in
Shadersis specified byMaxCount๐
External documentation.
getAttribLocation(Program :: i(), Name :: string()) -> i().
gl:getAttribLocation/2 queries the previously linked program object specified by Program for the attribute variable specified by Name, and hands you back the index of the generic vertex attribute that's bound to that attribute variable. ๐
- If
Nameis a matrix attribute variable, you get the index of the first column of the matrix. - If the named attribute variable is not an active attribute in the specified program object, or if
Namestarts with the reserved prefix"gl_", you get a value of-1. sorry bestie, that's the rules ๐ญ
External documentation.
getBufferParameteriv(Target :: enum(), Pname :: enum()) -> i().
gl:getBufferParameteriv/2 returns in Data a selected parameter of the buffer object specified by Target. short and sweet, we love to see it โจ
External documentation.
getBufferParameterivARB(Target :: enum(), Pname :: enum()) -> [i()].
these functions return in Data a selected parameter of the specified buffer object. ๐ฆ
External documentation.
getBufferSubData(Target :: enum(), Offset :: i(), Size :: i(), Data :: mem()) -> ok.
gl:getBufferSubData/4 and glGetNamedBufferSubData return some or all of the data contents of the data store of the specified buffer object. ๐
data starting at byte offset Offset and extending for Size bytes gets copied from the buffer object's data store to the memory pointed to by Data.
โ ๏ธ An error is thrown if the buffer object is currently mapped, or ifOffsetandSizetogether define a range beyond the bounds of the buffer object's data store. do not test it. ๐
External documentation.
getClipPlane(Plane :: enum()) -> {f(), f(), f(), f()}.
gl:getClipPlane/1 returns in Equation the four coefficients of the plane equation for Plane. ๐โจ
External documentation.
getColorTable(Target :: enum(), Format :: enum(), Type :: enum(), Table :: mem()) -> ok.
gl:getColorTable/4 returns in Table the contents of the color table specified by Target. ๐จ
no pixel transfer operations are performed, but the pixel storage modes that are applicable to gl:readPixels/7 are performed. iykyk ๐ซถ
External documentation.
getColorTableParameteriv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.
returns parameters specific to color table Target. ๐
External documentation.
getCompressedTexImage(Target :: enum(), Lod :: i(), Img :: mem()) -> ok.
gl:getCompressedTexImage/3 and glGetnCompressedTexImage return the compressed texture image associated with Target and Lod into Pixels. ๐ง
glGetCompressedTextureImage serves the same purpose, but instead of taking a texture target, it takes the ID of the texture object. ๐ธ
Pixelsshould be an array ofBufSizebytes for theglGetnCompresedTexImageandglGetCompressedTextureImagefunctions- and of
?GL_TEXTURE_COMPRESSED_IMAGE_SIZEbytes in the case ofgl:getCompressedTexImage/3 - if the actual data takes less space than
BufSize, the remaining bytes will not be touched. untouched, unbothered, living its life ๐ Targetspecifies the texture target, to which the texture the data the function should extract the data from is bound toLodspecifies the level-of-detail number of the desired image
External documentation.
getConvolutionFilter(Target :: enum(), Format :: enum(), Type :: enum(), Image :: mem()) -> ok.
gl:getConvolutionFilter/4 returns the current 1D or 2D convolution filter kernel as an image. ๐ฅ
the one- or two-dimensional image is placed in Image according to the specifications in Format and Type. no pixel transfer operations are performed on this image, but the relevant pixel storage modes are applied. โจ
External documentation.
getConvolutionParameteriv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.
gl:getConvolutionParameter() retrieves convolution parameters. ๐
Targetdetermines which convolution filter is queriedPnamedetermines which parameter is returned:
External documentation.
getDebugMessageLog(Count :: i(), BufSize :: i()) -> {i(), Sources :: [enum()], Types :: [enum()], Ids :: [i()], Severities :: [enum()], MessageLog :: [string()]}.
gl:getDebugMessageLog/2 retrieves messages from the debug message log. ๐๐
a maximum of Count messages are retrieved from the log. and then, one by one:
- if
Sourcesis notNULL, the source of each message is written into up toCountelements of the array - if
Typesis notNULL, the type of each message is written into up toCountelements of the array - if
Idis notNULL, the identifier of each message is written into up toCountelements of the array - if
Severitiesis notNULL, the severity of each message is written into up toCountelements of the array - if
Lengthsis notNULL, the length of each message is written into up toCountelements of the array ๐ซถ
External documentation.
getError() -> enum().
gl:getError/0 returns the value of the error flag. ๐
every detectable error gets a numeric code and a symbolic name. when an error happens, the error flag is set to the appropriate error code value. after that, no other errors are recorded until gl:getError/0 is called, the error code is returned, and the flag is reset to ?GL_NO_ERROR. one at a time, bestie, one at a time โ
if a call to gl:getError/0 returns ?GL_NO_ERROR, then there has been no detectable error since the last call to gl:getError/0, or since the GL was initialized. ๐
External documentation.
getFragDataIndex(Program :: i(), Name :: string()) -> i().
๐ gl:getFragDataIndex/2
okay so gl:getFragDataIndex/2 hands you back the index of the fragment color that the variable Name was bound to the last time the program object Program got linked. literally that's it. and if Name is not a varying out variable of Program, or if literally any error pops off? you get -1. that's the whole deal bestie โจ
External documentation.
๐ฆ gl:getFragDataLocation/2
getFragDataLocation(Program :: i(), Name :: string()) -> i().
gl:getFragDataLocation/2 retrieves the assigned color number binding for the user-defined varying out variable Name for program Program. two requirements, no skipping: Program must have been linked before, and Name must be a null-terminated string. if Name isn't the name of an active user-defined varying out fragment shader variable inside Program, congrats, you get -1 back ๐ซถ
External documentation.
๐ธ gl:getFramebufferAttachmentParameteriv/3
getFramebufferAttachmentParameteriv(Target :: enum(),
Attachment :: enum(),
Pname :: enum()) ->
i().
so gl:getFramebufferAttachmentParameteriv/3 and glGetNamedFramebufferAttachmentParameteriv return the parameters of attachments of a specified framebuffer object. slay ๐
External documentation.
๐ gl:getFramebufferParameteriv/2
getFramebufferParameteriv(Target :: enum(), Pname :: enum()) -> i().
gl:getFramebufferParameteriv/2 and glGetNamedFramebufferParameteriv query the parameters of a specified framebuffer object. iconic, obsessed โจ
External documentation.
๐ gl:getGraphicsResetStatus/0
getGraphicsResetStatus() -> enum().
certain events can just,,, reset the GL context. and that reset means all context state is gone โ vanished, lost, ghosted. ๐ญ your application then has to recreate every single object in the affected context. no cap, it's giving chaos.
External documentation.
๐ gl:getHistogram/5
getHistogram(Target :: enum(),
Reset :: 0 | 1,
Format :: enum(),
Type :: enum(),
Values :: mem()) ->
ok.
gl:getHistogram/5 returns the current histogram table as a one-dimensional image with the same width as the histogram. no pixel transfer operations get performed on this image, but pixel storage modes that apply to 1D images are honored. respect the storage modes, periodt โจ
External documentation.
๐ gl:getHistogramParameteriv/2
getHistogramParameteriv(Target :: enum(), Pname :: enum()) -> {i()}.
gl:getHistogramParameter() is used to query parameter values for the current histogram or for a proxy. you call gl:getHistogramParameter() with a Target of ?GL_HISTOGRAM (to get info for the current histogram table) or ?GL_PROXY_HISTOGRAM (to get info from the most recent proxy request), plus one of the following values for the Pname argument:
External documentation.
โญ gl:getIntegerv/1
getIntegerv(Pname :: enum()) -> [i()].
these commands return values for simple state variables in GL. Pname is the symbolic constant saying which state variable you want back, and Data is a pointer to an array of the indicated type where the returned data gets placed. simple as ๐
External documentation.
๐ gl:getInternalformativ/4
getInternalformativ(Target :: enum(),
Internalformat :: enum(),
Pname :: enum(),
BufSize :: i()) ->
[i()].
no documentation available. literally nothing, bestie, we move ๐
๐ฅ gl:getLightiv/2
getLightiv(Light :: enum(), Pname :: enum()) ->
{i(), i(), i(), i()}.
gl:getLight() returns in Params the value or values of a light source parameter. Light names the light and is a symbolic name of the form ?GL_LIGHT i where i ranges from 0 to the value of ?GL_MAX_LIGHTS - 1. quick note: ?GL_MAX_LIGHTS is an implementation dependent constant that's greater than or equal to eight. and Pname specifies one of ten light source parameters, again by symbolic name. ten of them, don't lose count ๐
External documentation.
๐ฆ gl:getMapiv/3
getMapiv(Target :: enum(), Query :: enum(), V :: mem()) -> ok.
glMap1 and glMap2 define evaluators, and gl:getMap() returns evaluator parameters. Target picks a map, Query selects a specific parameter, and V points to the storage where the values get returned. okay so that's the flow โจ
External documentation.
๐ gl:getMaterialiv/2
getMaterialiv(Face :: enum(), Pname :: enum()) ->
{i(), i(), i(), i()}.
gl:getMaterial() returns in Params the value or values of parameter Pname of material Face. six parameters are defined:
External documentation.
๐ธ gl:getMinmax/5
getMinmax(Target :: enum(),
Reset :: 0 | 1,
Format :: enum(),
Types :: enum(),
Values :: mem()) ->
ok.
gl:getMinmax/5 returns the accumulated minimum and maximum pixel values (computed on a per-component basis, iykyk) in a one-dimensional image of width 2. first set of return values = the minima, second set = the maxima. the format of those return values is determined by Format, and their type is determined by Types. cute, organised, obsessed ๐
External documentation.
โญ gl:getMinmaxParameteriv/2
getMinmaxParameteriv(Target :: enum(), Pname :: enum()) -> {i()}.
gl:getMinmaxParameter() retrieves parameters for the current minmax table by setting Pname to one of the following values:
External documentation.
๐ gl:getMultisamplefv/2
getMultisamplefv(Pname :: enum(), Index :: i()) -> {f(), f()}.
gl:getMultisamplefv/2 queries the location of a given sample. Pname specifies the sample parameter to retrieve and must be ?GL_SAMPLE_POSITION. Index corresponds to the sample whose location you want back. the sample location comes back as two floating-point values in Val[0] and Val[1], each between 0 and 1, corresponding to the X and Y locations respectively in the GL pixel space of that sample. and btw (0.5, 0.5) corresponds to the pixel center. Index must be between zero and the value of ?GL_SAMPLES minus one. zero to ?GL_SAMPLES - 1, no going out of bounds bestie ๐ซถ
External documentation.
๐ gl:getPixelMapusv/2
getPixelMapusv(Map :: enum(), Values :: mem()) -> ok.
see the gl:pixelMap() reference page for a description of the acceptable values for the Map parameter. gl:getPixelMap() returns in Data the contents of the pixel map specified in Map. pixel maps are used during the execution of gl:readPixels/7, gl:drawPixels/5, gl:copyPixels/5, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, gl:texSubImage3D/11, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, and gl:copyTexSubImage3D/9. to map color indices, stencil indices, color components, and depth components to other values. iconic lineup fr fr ๐
External documentation.
๐ gl:getPolygonStipple/0
getPolygonStipple() -> binary().
gl:getPolygonStipple/0 returns to Pattern a 32ร32 polygon stipple pattern. the pattern is packed into memory as if gl:readPixels/7 were called with both height and width of 32, type of ?GL_BITMAP, and format of ?GL_COLOR_INDEX, and the stipple pattern were stored in an internal 32ร32 color index buffer. big however though: unlike gl:readPixels/7, pixel transfer operations (shift, offset, pixel map) are not applied to the returned stipple image. don't expect them ๐ซ
External documentation.
๐ฆ gl:getProgramBinary/2
getProgramBinary(Program :: i(), BufSize :: i()) ->
{BinaryFormat :: enum(), Binary :: binary()}.
gl:getProgramBinary/2 returns a binary representation of the compiled and linked executable for Program into the array of bytes whose address is specified in Binary. the maximum number of bytes that may be written into Binary is specified by BufSize. and here's the catch: if the program binary is greater in size than BufSize bytes, an error is generated. otherwise, the actual number of bytes written into Binary is returned in the variable whose address is given by Length. if Length is ?NULL, then no length is returned. noted ๐
External documentation.
๐ gl:getProgramInfoLog/2
getProgramInfoLog(Program :: i(), BufSize :: i()) -> string().
gl:getProgramInfoLog/2 returns the information log for the specified program object. that log gets modified whenever the program object is linked or validated. and the string that's returned will be null terminated, just so you know ๐
External documentation.
๐ธ gl:getProgramInterfaceiv/3
getProgramInterfaceiv(Program :: i(),
ProgramInterface :: enum(),
Pname :: enum()) ->
i().
gl:getProgramInterfaceiv/3 queries the property of the interface identified by ProgramInterface in Program, and the property name is given by Pname. (yes the original says "identifed", we're keeping the vibe, the facts are the facts ๐)
External documentation.
โญ gl:getProgramPipelineInfoLog/2
getProgramPipelineInfoLog(Pipeline :: i(), BufSize :: i()) ->
string().
gl:getProgramPipelineInfoLog/2 retrieves the info log for the program pipeline object Pipeline. the info log, including its null terminator, is written into the array of characters whose address is given by InfoLog. the maximum number of characters that may be written into InfoLog is given by BufSize, and the actual number of characters written into InfoLog is returned in the integer whose address is given by Length. if Length is ?NULL, no length is returned. null terminator included, don't forget it ๐ซถ
External documentation.
๐ gl:getProgramPipelineiv/2
getProgramPipelineiv(Pipeline :: i(), Pname :: enum()) -> i().
gl:getProgramPipelineiv/2 retrieves the value of a property of the program pipeline object Pipeline. Pname specifies the name of the parameter whose value you want to retrieve. and the value of that parameter gets written to the variable whose address is given by Params. slay โจ
External documentation.
๐ gl:getProgramResourceIndex/3
getProgramResourceIndex(Program :: i(),
ProgramInterface :: enum(),
Name :: string()) ->
i().
gl:getProgramResourceIndex/3 returns the unsigned integer index assigned to a resource named Name in the interface type ProgramInterface of program object Program. that's the whole thing, no notes ๐
External documentation.
๐ gl:getProgramResourceLocation/3
getProgramResourceLocation(Program :: i(),
ProgramInterface :: enum(),
Name :: string()) ->
i().
K so getProgramResourceLocation/3 hands you back the location that got assigned to the variable named Name over in the interface ProgramInterface of the program object Program. ๐ฏ Requirements bestie: Program has to be the name of a program that's been linked successfully (no half-baked links, we don't do that here), and ProgramInterface must be one of ?GL_UNIFORM, ?GL_PROGRAM_INPUT, ?GL_PROGRAM_OUTPUT, ?GL_VERTEX_SUBROUTINE_UNIFORM, ?GL_TESS_CONTROL_SUBROUTINE_UNIFORM, ?GL_TESS_EVALUATION_SUBROUTINE_UNIFORM, ?GL_GEOMETRY_SUBROUTINE_UNIFORM, ?GL_FRAGMENT_SUBROUTINE_UNIFORM, ?GL_COMPUTE_SUBROUTINE_UNIFORM, or ?GL_TRANSFORM_FEEDBACK_BUFFER. that's the whole guest list, no plus-ones. ๐
External documentation.
getProgramResourceLocationIndex(Program :: i(), ProgramInterface :: enum(), Name :: string()) -> i().
gl:getProgramResourceLocationIndex/3 gives you the fragment color index assigned to the variable named Name in interface ProgramInterface of program object Program โ and yes, Program must be the name of a program that has been linked successfully, lowercase on the must. โจ ProgramInterface has exactly one option and it's ?GL_PROGRAM_OUTPUT. That's it, that's the whole menu. ๐
External documentation.
getProgramResourceName(Program :: i(), ProgramInterface :: enum(), Index :: i(), BufSize :: i()) -> string().
gl:getProgramResourceName/4 retrieves the name string assigned to the single active resource with an index of Index in the interface ProgramInterface of program object Program. And Index has to be less than the number of entries in the active resource list for ProgramInterface โ like, don't go off the end bestie, the list has a length for a reason. ๐ฆ
External documentation.
getProgramStageiv(Program :: i(), Shadertype :: enum(), Pname :: enum()) -> i().
gl:getProgramStage() queries a parameter of a shader stage attached to a program object. Program holds the name of the program the shader is attached to, Shadertype says which stage we're querying from, and Pname says which parameter we want. The value (or values!) of the parameter comes back in the variable whose address is given in Values. ๐ฅ
External documentation.
getProgramiv(Program :: i(), Pname :: enum()) -> i().
gl:getProgram() returns in Params the value of a parameter for a specific program object. The following parameters are defined:
External documentation.
getQueryIndexediv(Target :: enum(), Index :: i(), Pname :: enum()) -> i().
gl:getQueryIndexediv/3 returns in Params a selected parameter of the indexed query object target specified by Target and Index. Index specifies the index of the query object target and must be between zero and a target-specific maximum. ๐ธ
External documentation.
getQueryObjectuiv(Id :: i(), Pname :: enum()) -> i().
These commands return a selected parameter of the query object specified by Id. gl:getQueryObject() returns in Params a selected parameter of the query object specified by Id. gl:getQueryBufferObject() returns in Buffer a selected parameter of the query object specified by Id, by writing it to Buffer's data store at the byte offset specified by Offset. ๐
External documentation.
getQueryiv(Target :: enum(), Pname :: enum()) -> i().
gl:getQueryiv/2 returns in Params a selected parameter of the query object target specified by Target. short, sweet, iconic. ๐
External documentation.
getRenderbufferParameteriv(Target :: enum(), Pname :: enum()) -> i().
gl:getRenderbufferParameteriv/2 and glGetNamedRenderbufferParameteriv query parameters of a specified renderbuffer object. ๐
External documentation.
getSamplerParameteriv(Sampler :: i(), Pname :: enum()) -> [i()].
gl:getSamplerParameter() returns in Params the value or values of the sampler parameter specified as Pname. Sampler defines the target sampler, and it must be the name of an existing sampler object, returned from a previous call to gl:genSamplers/1. Pname accepts the same symbols as gl:samplerParameter(), with the same interpretations:
External documentation.
getShaderInfoLog(Shader :: i(), BufSize :: i()) -> string().
gl:getShaderInfoLog/2 returns the information log for the specified shader object. Heads up bestie: the information log for a shader object is modified when the shader is compiled. The string that is returned will be null terminated. ๐ซถ
External documentation.
getShaderPrecisionFormat(Shadertype :: enum(), Precisiontype :: enum()) -> {Range :: {i(), i()}, Precision :: i()}.
gl:getShaderPrecisionFormat/2 retrieves the numeric range and precision for the implementation's representation of quantities in different numeric formats in a specified shader type. ShaderType specifies the type of shader whose numeric precision and range we're grabbing, and it must be one of ?GL_VERTEX_SHADER or ?GL_FRAGMENT_SHADER. PrecisionType specifies the numeric format to query and must be one of ?GL_LOW_FLOAT, ?GL_MEDIUM_FLOAT ?GL_HIGH_FLOAT, ?GL_LOW_INT, ?GL_MEDIUM_INT, or ?GL_HIGH_INT. ๐
External documentation.
getShaderSource(Shader :: i(), BufSize :: i()) -> string().
gl:getShaderSource/2 returns the concatenation of the source code strings from the shader object specified by Shader. Those 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. โจ
External documentation.
getShaderiv(Shader :: i(), Pname :: enum()) -> i().
gl:getShader() returns in Params the value of a parameter for a specific shader object. The following parameters are defined:
External documentation.
getStringi(Name :: enum(), Index :: i()) -> string().
gl:getString/1 returns a pointer to a static string describing some aspect of the current GL connection. Name can be one of the following:
External documentation.
getSubroutineIndex(Program :: i(), Shadertype :: enum(), Name :: string()) -> i().
gl:getSubroutineIndex/3 returns the index of a subroutine uniform within a shader stage attached to a program object. Program contains the name of the program the shader is attached to. Shadertype specifies the stage from which to query the shader subroutine index. Name contains the null-terminated name of the subroutine uniform whose name to query. ๐ข
External documentation.
getSubroutineUniformLocation(Program :: i(), Shadertype :: enum(), Name :: string()) -> i().
gl:getSubroutineUniformLocation/3 returns the location of the subroutine uniform variable Name in the shader stage of type Shadertype attached to Program, with behavior otherwise identical to gl:getUniformLocation/2. twin energy fr fr ๐ฏ
External documentation.
getSynciv(Sync :: i(), Pname :: enum(), BufSize :: i()) -> [i()].
gl:getSynciv/3 retrieves properties of a sync object. Sync specifies the name of the sync object whose properties to retrieve. ๐งฒ
External documentation.
getTexEnviv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.
gl:getTexEnv() returns in Params selected values of a texture environment that was specified with gl:texEnv(). Target specifies a texture environment. ๐
External documentation.
getTexGeniv(Coord :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.
gl:getTexGen() returns in Params selected parameters of a texture coordinate generation function that was specified using gl:texGen(). Coord names one of the (s, t, r, q) texture coordinates, using the symbolic constant ?GL_S, ?GL_T, ?GL_R, or ?GL_Q. ๐
External documentation.
getTexImage(Target :: enum(), Level :: i(), Format :: enum(), Type :: enum(), Pixels :: mem()) -> ok.
gl:getTexImage/5, glGetnTexImage and glGetTextureImage functions return a texture image into Pixels. For gl:getTexImage/5 and glGetnTexImage, Target specifies whether the desired texture image is one specified by gl:texImage1D/8 (?GL_TEXTURE_1D), gl:texImage2D/9 (?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_RECTANGLE, ?GL_TEXTURE_2D or any of ?GL_TEXTURE_CUBE_MAP_*), or gl:texImage3D/10 (?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_3D, ?GL_TEXTURE_CUBE_MAP_ARRAY). For glGetTextureImage, Texture specifies the texture object name. On top of the texture types accepted by gl:getTexImage/5 and glGetnTexImage, that function also accepts cube map texture objects (with effective target ?GL_TEXTURE_CUBE_MAP). Level specifies the level-of-detail number of the desired image. Format and Type specify the format and type of the desired image array โ peek the reference page for gl:texImage1D/8 for a description of the acceptable values for the Format and Type parameters, respectively. For the glGetnTexImage and glGetTextureImage functions, bufSize tells the size of the buffer to receive the retrieved pixel data, and ngl those two do not write more than BufSize bytes into Pixels. ๐
External documentation.
getTexLevelParameteriv(Target :: enum(), Level :: i(), Pname :: enum()) -> {i()}.
๐ getTexLevelParameterfv/3, getTexLevelParameteriv/3, glGetTextureLevelParameterfv, glGetTextureLevelParameteriv
okay so these four girlies ๐ are all about peeking at one specific mip level of a texture. They return, in Params, the texture parameter values for a specific level-of-detail value, and that value is the one you pass as Level.
For the first two functions, Target is what defines which target texture we're talking about, and it's giving many options:
?GL_TEXTURE_1D?GL_TEXTURE_2D?GL_TEXTURE_3D?GL_PROXY_TEXTURE_1D?GL_PROXY_TEXTURE_2D?GL_PROXY_TEXTURE_3D?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?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z?GL_PROXY_TEXTURE_CUBE_MAP
The remaining two take a Texture argument instead, and that one specifies the name of the texture object. periodt ๐
External documentation.
๐ getTexParameteriv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.
getTexParameteriv(Target :: enum(), Pname :: enum()) ->
{i(), i(), i(), i()}.
So gl:getTexParameter() and glGetTextureParameter return, in Params, the value (or values, she's flexible โจ) of the texture parameter specified as Pname. And Target? That's the one defining the target texture. Here's the whole roster of what Target can be, no cap:
?GL_TEXTURE_1D,?GL_TEXTURE_2D,?GL_TEXTURE_3D?GL_TEXTURE_1D_ARRAY,?GL_TEXTURE_2D_ARRAY?GL_TEXTURE_RECTANGLE?GL_TEXTURE_CUBE_MAP,?GL_TEXTURE_CUBE_MAP_ARRAY?GL_TEXTURE_2D_MULTISAMPLE,?GL_TEXTURE_2D_MULTISAMPLE_ARRAY
...which specify one-, two-, or three-dimensional, one-dimensional array, two-dimensional array, rectangle, cube-mapped or cube-mapped array, two-dimensional multisample, or two-dimensional multisample array texturing, respectively. Whew. She contains multitudes ๐ฆ
And Pname? It accepts the same symbols as gl:texParameter(), with the same interpretations. Same energy, different function.
External documentation.
๐ธ getTransformFeedbackVarying(Program :: i(), Index :: i(), BufSize :: i()) -> {Size :: i(), Type :: enum(), Name :: string()}.
getTransformFeedbackVarying(Program :: i(),
Index :: i(),
BufSize :: i()) ->
{Size :: i(),
Type :: enum(),
Name :: string()}.
Wanna know about the varying variables hanging out in a linked program โ the ones that are gonna get captured during transform feedback? Bestie, that's literally this function. Call gl:getTransformFeedbackVarying/3 and it provides info about the varying variable selected by Index.
Index math time, she's precise ๐: an Index of 0 selects the first varying variable specified in the Varyings array that you passed to gl:transformFeedbackVaryings/3, and an Index of the value of ?GL_TRANSFORM_FEEDBACK_VARYINGS minus one selects the last such variable. Slay.
External documentation.
โจ getUniformBlockIndex(Program :: i(), UniformBlockName :: string()) -> i().
getUniformBlockIndex(Program :: i(), UniformBlockName :: string()) ->
i().
Short and sweet: gl:getUniformBlockIndex/2 retrieves the index of a uniform block within Program. iconic, no notes ๐
External documentation.
๐ฆ getUniformIndices(Program :: i(), UniformNames :: [unicode:chardata()]) -> [i()].
getUniformIndices(Program :: i(),
UniformNames :: [unicode:chardata()]) ->
[i()].
Same vibe, plural edition ๐
gl:getUniformIndices/2 retrieves the indices of a number of uniforms within Program. Returns a whole lil list of them.
External documentation.
๐ getUniformLocation(Program :: i(), Name :: string()) -> i().
getUniformLocation(Program :: i(), Name :: string()) -> i().
glGetUniformLocation returns an integer that represents the location of a specific uniform variable within a program object. And the rules for Name? Strict, bestie:
Namemust be a null terminated string that contains no white space.Namemust be an active uniform variable name inProgram.- ...and it must not be 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. So if you get a -1, it's not you, it's the name ๐
External documentation.
๐ getUniformSubroutineuiv(Shadertype :: enum(), Location :: i()) -> {i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i()}.
getUniformSubroutineuiv(Shadertype :: enum(), Location :: i()) ->
{i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i()}.
gl:getUniformSubroutine() retrieves the value of the subroutine uniform sitting at location Location for the shader stage Shadertype of the current program. But there's a limit, bestie ๐ง Location must be less than the value of ?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the shader currently in use at shader stage Shadertype. And the value of the subroutine uniform? Returned in Values, all sixteen slots of it.
External documentation.
๐ getUniformuiv(Program :: i(), Location :: i()) -> {i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i()}.
getUniformuiv(Program :: i(), Location :: i()) ->
{i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i(),
i()}.
gl:getUniform() and glGetnUniform return, in Params, the value(s) of the specified uniform variable. And how many values is it gonna be? That depends on the type of the uniform variable specified by Location โ she does the math for you:
- boolean,
int, orfloatโ a single value comes back. vec2,ivec2, orbvec2โ two values.vec3,ivec3, orbvec3โ three values, and so on, you get it.
Now, for the tricky parts ๐ซถ To query values stored in uniform variables declared as arrays, you call gl:getUniform() for each element of the array. To query values stored in uniform variables declared as structures, you call gl:getUniform() for each field in the structure. And uniform variables declared as a matrix? Those values get returned in column major order. noted ๐
External documentation.
๐ getVertexAttribiv(Index :: i(), Pname :: enum()) -> {i(), i(), i(), i()}.
getVertexAttribiv(Index :: i(), Pname :: enum()) ->
{i(), i(), i(), i()}.
gl:getVertexAttrib() returns, in Params, the value of a generic vertex attribute parameter. The generic vertex attribute being queried is picked by Index, and the actual parameter you're asking about is picked by Pname. Two args, one answer, we love a minimal queen โจ
External documentation.
๐
hint(Target :: enum(), Mode :: enum()) -> ok.
hint(Target :: enum(), Mode :: enum()) -> ok.
So certain aspects of GL behavior, when there's room for interpretation, can be controlled with hints. A hint gets specified with two arguments: Target is a symbolic constant that indicates the behavior to be controlled, and Mode is another symbolic constant indicating the desired behavior.
The initial value for each Target is ?GL_DONT_CARE. And Mode can be one of the following:
External documentation.
๐ง histogram(Target :: enum(), Width :: i(), Internalformat :: enum(), Sink :: 0 | 1) -> ok.
histogram(Target :: enum(),
Width :: i(),
Internalformat :: enum(),
Sink :: 0 | 1) ->
ok.
okay so when ?GL_HISTOGRAM is enabled, RGBA color components get converted to histogram table indices by clamping to the range [0,1], multiplying by the width of the histogram table, and rounding to the nearest integer. Then the table entries selected by those RGBA indices get incremented. (If the internal format of the histogram table includes luminance, then the index derived from the R color component determines the luminance table entry to be incremented.) ๐
โ ๏ธ If a histogram table entry is incremented beyond its maximum value, then its value becomes undefined. (This is not an error.) yes bestie it's canonically unspecified, don't @ me ๐
External documentation.
๐ indexMask(Mask :: i()) -> ok.
indexMask(Mask :: i()) -> ok.
gl:indexMask/1 controls the writing of individual bits in the color index buffers. Here's the tea โ the least significant n bits of Mask, where n is the number of bits in a color index buffer, specify a mask. Where a 1 (one) appears in the mask, it's possible to write to the corresponding bit in the color index buffer (or buffers). Where a 0 (zero) appears, the corresponding bit is write-protected. bit by bit, we stan ๐
External documentation.
๐ฆ indexPointer(Type :: enum(), Stride :: i(), Ptr :: offset() | mem()) -> ok.
indexPointer(Type :: enum(),
Stride :: i(),
Ptr :: offset() | mem()) ->
ok.
gl:indexPointer/3 specifies the location and data format of an array of color indexes to use when rendering. Type specifies the data type of each color index, and Stride specifies the byte stride from one color index to the next โ which lets vertices and attributes be packed into a single array or stored in separate arrays. your call, your layout ๐
External documentation.
๐ indexubv({C :: i()}) -> ok.
indexubv({C :: i()}) -> ok.
gl:index() updates the current (single-valued) color index. It takes one argument, the new value for the current color index. one in, one out, no drama โจ
External documentation.
๐ initNames() -> ok.
initNames() -> ok.
The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers. And gl:initNames/0? It causes the name stack to be initialized to its default empty state. clean slate energy ๐ธ
External documentation.
๐ interleavedArrays(Format :: enum(), Stride :: i(), Pointer :: offset() | mem()) -> ok.
interleavedArrays(Format :: enum(),
Stride :: i(),
Pointer :: offset() | mem()) ->
ok.
gl:interleavedArrays/3 lets you specify and enable individual color, normal, texture and vertex arrays whose elements are part of a larger aggregate array element. For some implementations, this is more efficient than specifying the arrays separately. efficiency queen, she ate ๐ฅ
External documentation.
๐ invalidateBufferData(Buffer :: i()) -> ok.
invalidateBufferData(Buffer :: i()) -> ok.
gl:invalidateBufferData/1 invalidates all of the content of the data store of a buffer object.
โ ๏ธ After invalidation, the content of the buffer's data store becomes undefined. like, it's gone bestie, do not look for it ๐ญ
External documentation.
invalidateBufferSubData(Buffer :: i(), Offset :: i(), Length :: i()) -> okโ okay sogl:invalidateBufferSubData/3invalidates all or part of the content of a buffer object's data store. And after that invalidation happens? The content of that specified range of the buffer's data store is literally undefined, bestie. ๐ The start of the range isOffset, its size isLength, and both of those are measured in basic machine units.
External documentation. ๐
invalidateFramebuffer(Target :: enum(), Attachments :: [enum()]) -> okโgl:invalidateFramebuffer/2andglInvalidateNamedFramebufferDatainvalidate the entire contents of a specified set of attachments of a framebuffer. That's it, that's the whole vibe. โจ
External documentation. ๐
invalidateSubFramebuffer(Target :: enum(), Attachments :: [enum()], X :: i(), Y :: i(), Width :: i(), Height :: i()) -> okโgl:invalidateSubFramebuffer/6andglInvalidateNamedFramebufferSubDatainvalidate the contents of a specified region of a specified set of attachments of a framebuffer. So like, not the whole thing โ just the little rectangle you picked. ๐ฏ
External documentation. ๐
invalidateTexImage(Texture :: i(), Level :: i()) -> okโgl:invalidateTexSubImage/8invalidates all of a texture image.TextureandLevelindicate which texture image is being invalidated. After this command, data in the texture image has undefined values. ๐
External documentation. ๐
invalidateTexSubImage(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth) -> ok
when
Texture :: i(),
Level :: i(),
Xoffset :: i(),
Yoffset :: i(),
Zoffset :: i(),
Width :: i(),
Height :: i(),
Depth :: i()
gl:invalidateTexSubImage/8 invalidates all or part of a texture image. Texture and Level indicate which texture image is being invalidated. After this command, data in that subregion has undefined values. Xoffset, Yoffset, Zoffset, Width, Height, and Depth are interpreted as they are in gl:texSubImage3D/11. For texture targets that don't have certain dimensions, this command treats those dimensions as having a size of 1. For example, to invalidate a portion of a two-dimensional texture, the application would use Zoffset equal to zero and Depth equal to one. Cube map textures are treated as an array of six slices in the z-dimension, where a value of Zoffset is interpreted as specifying face ?GL_TEXTURE_CUBE_MAP_POSITIVE_X + Zoffset. ๐ (yes it's giving very specific, but that's the whole thing, no cap)
External documentation. ๐
isBuffer(Buffer :: i()) -> 0 | 1โgl:isBuffer/1returns?GL_TRUEifBufferis currently the name of a buffer object. And ifBufferis zero, or is a non-zero value that is not currently the name of a buffer object, or if an error occurs?gl:isBuffer/1returns?GL_FALSE. Simple as. ๐
External documentation. ๐
isEnabledi(Target :: enum(), Index :: i()) -> 0 | 1โgl:isEnabled/1returns?GL_TRUEifCapis an enabled capability, and?GL_FALSEotherwise. Boolean states that are indexed can be tested withgl:isEnabledi/2. Forgl:isEnabledi/2,Indexspecifies the index of the capability to test.Indexmust be between zero and the count of indexed capabilities forCap. Initially all capabilities except?GL_DITHERare disabled โ?GL_DITHERis initially enabled, main character behavior tbh. ๐
External documentation. ๐
isFramebuffer(Framebuffer :: i()) -> 0 | 1โgl:isFramebuffer/1returns?GL_TRUEifFramebufferis currently the name of a framebuffer object. IfFramebufferis zero, or if?framebufferis not the name of a framebuffer object, or if an error occurs,gl:isFramebuffer/1returns?GL_FALSE. And heads up bestie โ ifFramebufferis a name returned bygl:genFramebuffers/1, but that has not yet been bound through a call togl:bindFramebuffer/2, then the name is not a framebuffer object andgl:isFramebuffer/1returns?GL_FALSE. ๐จ
External documentation. ๐
isList(List :: i()) -> 0 | 1โgl:isList/1returns?GL_TRUEifListis the name of a display list, and returns?GL_FALSEif it is not, or if an error occurs.
External documentation. ๐
isProgram(Program :: i()) -> 0 | 1โgl:isProgram/1returns?GL_TRUEifProgramis the name of a program object previously created withgl:createProgram/0and not yet deleted withgl:deleteProgram/1. IfProgramis zero or a non-zero value that is not the name of a program object, or if an error occurs,gl:isProgram/1returns?GL_FALSE.
External documentation. ๐
isProgramPipeline(Pipeline :: i()) -> 0 | 1โgl:isProgramPipeline/1returns?GL_TRUEifPipelineis currently the name of a program pipeline object. IfPipelineis zero, or if?pipelineis not the name of a program pipeline object, or if an error occurs,gl:isProgramPipeline/1returns?GL_FALSE. IfPipelineis a name returned bygl:genProgramPipelines/1, but that has not yet been bound through a call togl:bindProgramPipeline/1, then the name is not a program pipeline object andgl:isProgramPipeline/1returns?GL_FALSE. Same energy as the framebuffer one, fr fr. ๐ซถ
External documentation. ๐
isQuery(Id :: i()) -> 0 | 1โgl:isQuery/1returns?GL_TRUEifIdis currently the name of a query object. IfIdis zero, or is a non-zero value that is not currently the name of a query object, or if an error occurs,gl:isQuery/1returns?GL_FALSE.
External documentation. ๐
isRenderbuffer(Renderbuffer :: i()) -> 0 | 1โgl:isRenderbuffer/1returns?GL_TRUEifRenderbufferis currently the name of a renderbuffer object. IfRenderbufferis zero, or ifRenderbufferis not the name of a renderbuffer object, or if an error occurs,gl:isRenderbuffer/1returns?GL_FALSE. IfRenderbufferis a name returned bygl:genRenderbuffers/1, but that has not yet been bound through a call togl:bindRenderbuffer/2orgl:framebufferRenderbuffer/4, then the name is not a renderbuffer object andgl:isRenderbuffer/1returns?GL_FALSE.
External documentation. ๐
isSampler(Sampler :: i()) -> 0 | 1โgl:isSampler/1returns?GL_TRUEifIdis currently the name of a sampler object. IfIdis zero, or is a non-zero value that is not currently the name of a sampler object, or if an error occurs,gl:isSampler/1returns?GL_FALSE.
External documentation. ๐
isShader(Shader :: i()) -> 0 | 1โgl:isShader/1returns?GL_TRUEifShaderis the name of a shader object previously created withgl:createShader/1and not yet deleted withgl:deleteShader/1. IfShaderis zero or a non-zero value that is not the name of a shader object, or if an error occurs,glIsShaderreturns?GL_FALSE.
External documentation. ๐
isSync(Sync :: i()) -> 0 | 1โgl:isSync/1returns?GL_TRUEifSyncis currently the name of a sync object. IfSyncis not the name of a sync object, or if an error occurs,gl:isSync/1returns?GL_FALSE. And note bestie, zero is not the name of a sync object. ๐
External documentation. ๐
isTexture(Texture :: i()) -> 0 | 1โgl:isTexture/1returns?GL_TRUEifTextureis currently the name of a texture. IfTextureis zero, or is a non-zero value that is not currently the name of a texture, or if an error occurs,gl:isTexture/1returns?GL_FALSE.
External documentation. ๐
isTransformFeedback(Id :: i()) -> 0 | 1โgl:isTransformFeedback/1returns?GL_TRUEifIdis currently the name of a transform feedback object. IfIdis zero, or if?idis not the name of a transform feedback object, or if an error occurs,gl:isTransformFeedback/1returns?GL_FALSE. IfIdis a name returned bygl:genTransformFeedbacks/1, but that has not yet been bound through a call togl:bindTransformFeedback/2, then the name is not a transform feedback object andgl:isTransformFeedback/1returns?GL_FALSE.
External documentation. ๐
isVertexArray(Array :: i()) -> 0 | 1โgl:isVertexArray/1returns?GL_TRUEifArrayis currently the name of a vertex array object. IfArrayis zero, or ifArrayis not the name of a vertex array object, or if an error occurs,gl:isVertexArray/1returns?GL_FALSE. IfArrayis a name returned bygl:genVertexArrays/1, but that has not yet been bound through a call togl:bindVertexArray/1, then the name is not a vertex array object andgl:isVertexArray/1returns?GL_FALSE. Okay the pattern is so consistent at this point, the "you generated it but never bound it" thing is lowkey the plot twist of every single one of these. ๐
External documentation. ๐
lightModeliv(Pname :: enum(), Params :: tuple()) -> okโgl:lightModel()sets the lighting model parameter.Pnamenames a parameter andParamsgives the new value. There are three lighting model parameters:
External documentation. ๐
lightiv(Light :: enum(), Pname :: enum(), Params :: tuple()) -> okโgl:light()sets the values of individual light source parameters.Lightnames the light and is a symbolic name of the form?GL_LIGHT i, whereiranges from0to the value of?GL_MAX_LIGHTS - 1.Pnamespecifies one of ten light source parameters, again by symbolic name.Paramsis either a single value or a pointer to an array that contains the new values. โจ
External documentation. ๐
lineStipple(Factor :: i(), Pattern :: i()) -> okโ line stippling masks out certain fragments produced by rasterization; those fragments will not be drawn. The masking is achieved by using three parameters: the 16-bit line stipple patternPattern, the repeat countFactor, and an integer stipple counters. ๐ฉท (three params, two of them in the signature, andsjust vibing invisibly)
External documentation. ๐
lineWidth(Width :: f()) -> ok
gl:lineWidth/1 sets the rasterized width of both aliased and antialiased lines, bestie. And listen, using a line width that isn't 1 does genuinely different things depending on whether line antialiasing is turned on or not. To turn line antialiasing on and off you call gl:enable/1 and gl:disable/1 with the argument ?GL_LINE_SMOOTH. And where does line antialiasing start out? Initially disabled. ๐
๐ External documentation.
gl:linkProgram(Program :: i()) -> ok. ๐
gl:linkProgram/1 links that program object you specified with Program. Here's the tea: if any shader objects of type ?GL_VERTEX_SHADER are attached to Program, they get used to build an executable that runs on the programmable vertex processor. If any shader objects of type ?GL_GEOMETRY_SHADER are attached to Program, they get used to make an executable that runs on the programmable geometry processor. And if any shader objects of type ?GL_FRAGMENT_SHADER are attached to Program, they get used to make an executable that runs on the programmable fragment processor. Three processors, three vibes, one link. ๐
๐ External documentation.
gl:listBase(Base :: i()) -> ok. ๐
gl:callLists/1 specifies an array of offsets, okay? Display-list names get generated by adding Base to each offset. Names that reference valid display lists get executed; the others? Ignored. No notes. โจ
๐ External documentation.
gl:loadIdentity() -> ok. ๐ช
gl:loadIdentity/0 replaces the current matrix with the identity matrix. It's semantically equivalent to calling gl:loadMatrix() with the identity matrix. Same energy, shorter keyboard journey.
๐ External documentation.
gl:loadMatrixf(M :: matrix()) -> ok. ๐งฎ
gl:loadMatrix() replaces the current matrix with the one whose elements are specified by M. Which matrix is "the current matrix"? Could be the projection matrix, the modelview matrix, or the texture matrix, depending on the current matrix mode โ go peek at gl:matrixMode/1. ๐
๐ External documentation.
gl:loadName(Name :: i()) -> ok. ๐ท๏ธ
The name stack is what gets used during selection mode, so that sets of rendering commands can each be uniquely identified. It's an ordered set of unsigned integers, and it starts out empty. Literally a stack of names, main character energy.
๐ External documentation.
gl:loadTransposeMatrixf(M :: matrix()) -> ok. ๐
gl:loadTransposeMatrix() replaces the current matrix with the one whose elements are specified by M. And yeah, the current matrix here is the projection matrix, the modelview matrix, or the texture matrix โ depending on the current matrix mode (again: gl:matrixMode/1, bestie).
๐ External documentation.
gl:logicOp(Opcode :: enum()) -> ok. ๐๏ธ
gl:logicOp/1 specifies a logical operation that, once enabled, gets applied between the incoming RGBA color and the RGBA color at the corresponding location in the frame buffer. To turn the logical operation on or off, call gl:enable/1 and gl:disable/1 using the symbolic constant ?GL_COLOR_LOGIC_OP. Initial value? Disabled. ๐ซ
๐ External documentation.
gl:map1f(Target :: enum(), U1 :: f(), U2 :: f(), Stride :: i(), Order :: i(), Points :: binary()) -> ok. ๐
Evaluators are the way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values an evaluator spits out get sent to the further stages of GL processing exactly as if you'd handed them over using gl:vertex(), gl:normal(), gl:texCoord(), and gl:color() commands โ with the one big exception that the generated values do not update the current normal, texture coordinates, or color. Noted, bestie, don't @ me.
๐ External documentation.
gl:map2f(Target, U1, U2, Ustride, Uorder, V1, V2, Vstride, Vorder, Points) -> ok
when
Target :: enum(),
U1 :: f(),
U2 :: f(),
Ustride :: i(),
Uorder :: i(),
V1 :: f(),
V2 :: f(),
Vstride :: i(),
Vorder :: i(),
Points :: binary().
Same deal as always with evaluators: they're the glow-up way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. Those values get sent on to further stages of GL processing just as if they'd been presented using gl:vertex(), gl:normal(), gl:texCoord(), and gl:color() commands โ except the generated values do not update the current normal, texture coordinates, or color. ๐ซ
๐ External documentation.
gl:mapGrid2f(Un :: i(), U1 :: f(), U2 :: f(), Vn :: i(), V1 :: f(), V2 :: f()) -> ok. ๐ธ๏ธ
gl:mapGrid() and gl:evalMesh() are the iconic duo here โ you use them together to efficiently generate and evaluate a series of evenly-spaced map domain values. gl:evalMesh() steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1 and glMap2. (Yes, it says glMap1 and glMap2, italicizing-mirror-emoji, no cap.) ๐ชฉ
๐ External documentation.
gl:materialiv(Face :: enum(), Pname :: enum(), Params :: tuple()) -> ok. ๐ช
gl:material() assigns values to material parameters, and babes, there are two matched sets of them:
- the front-facing set โ used to shade points, lines, bitmaps, and all polygons (when two-sided lighting is disabled), or just front-facing polygons (when two-sided lighting is enabled)
- the back-facing set โ used to shade back-facing polygons only when two-sided lighting is enabled
Refer to the gl:lightModel() reference page for the details about one- and two-sided lighting calculations. โจ
๐ External documentation.
gl:matrixMode(Mode :: enum()) -> ok. ๐ฎ
gl:matrixMode/1 sets the current matrix mode. Mode can assume one of four values:
๐ External documentation.
gl:memoryBarrierByRegion(Barriers :: i()) -> ok. ๐ง
gl:memoryBarrier/1 defines a barrier that orders the memory transactions issued before the command relative to the ones issued after the barrier. And for the purposes of this ordering, memory transactions performed by shaders are considered to be issued by the rendering command that triggered the execution of the shader. Barriers is a bitfield indicating the set of operations that are synchronized with shader stores; the bits used in Barriers are as follows:
๐ External documentation.
gl:minSampleShading(Value :: f()) -> ok. ๐ธ
gl:minSampleShading/1 specifies the rate at which samples are shaded within a covered pixel. Sample-rate shading gets enabled by calling gl:enable/1 with the parameter ?GL_SAMPLE_SHADING. Now the important bit: 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. And at least 1 sample for each covered fragment is generated. Periodt. ๐ฏ
๐ External documentation.
gl:minmax(Target :: enum(), Internalformat :: enum(), Sink :: 0 | 1) -> ok. ๐๐
When ?GL_MINMAX is enabled, the RGBA components of incoming pixels get compared against the minimum and maximum values for each component, which live in the two-element minmax table. (First element stores the minima, second element stores the maxima โ write that down.) So:
- if a pixel component is greater than the corresponding component in the maximum element, the maximum element gets updated with that pixel component value
- if a pixel component is less than the corresponding component in the minimum element, the minimum element gets updated with that pixel component value
(In both cases, if the internal format of the minmax table includes luminance, then the R color component of incoming pixels is what's used for the comparison.) You can retrieve the contents of the minmax table later by calling gl:getMinmax/5. And the minmax operation is enabled or disabled by calling gl:enable/1 or gl:disable/1, respectively, with an argument of ?GL_MINMAX. ๐
๐ External documentation.
gl:multMatrixf(M :: matrix()) -> ok. โ๏ธ
gl:multMatrix() multiplies the current matrix with the one specified using M, and replaces the current matrix with the product. Simple. Iconic. Math. ๐ง
๐ External documentation.
gl:multTransposeMatrixf(M :: matrix()) -> ok. โ๏ธ๐
gl:multTransposeMatrix() multiplies the current matrix with the one specified using M, and replaces the current matrix with the product. Yes, it's the same sentence, it's a different function, that's just the way it is bestie. ๐
๐ External documentation.
gl:multiDrawArrays(Mode :: enum(), First :: [integer()] | mem(), Count :: [integer()] | mem()) -> ok. ๐จ
gl:multiDrawArrays/3 specifies multiple sets of geometric primitives with very few subroutine calls โ which is the whole point, lowkey. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call to gl:multiDrawArrays/3. Efficiency queen. ๐
๐ External documentation.
gl:multiDrawArraysIndirect(Mode :: enum(), Indirect :: offset() | mem(), Drawcount :: i(), Stride :: i()) -> ok. ๐
gl:multiDrawArraysIndirect/4 specifies multiple geometric primitives with very few subroutine calls, same energy as above. It behaves similarly to a whole multitude of calls to gl:drawArraysInstancedBaseInstance/5, except that the parameters to each call to gl:drawArraysInstancedBaseInstance/5 are stored in an array in memory at the address given by Indirect, separated by the stride (in basic machine units) specified by Stride. And if Stride is zero, then the array is assumed to be tightly packed in memory. Snug. ๐ซถ
๐ External documentation.
multiDrawArraysIndirectCount
multiDrawArraysIndirectCount(Mode, Indirect, Drawcount,
Maxdrawcount, Stride) ->
ok
when
Mode :: enum(),
Indirect :: offset() | mem(),
Drawcount :: i(),
Maxdrawcount :: i(),
Stride :: i().
No documentation available. ๐ bestie we got nothing here, the doc cupboard is empty, moving on.
multiTexCoord4sv
multiTexCoord4sv(Target :: enum(),
{S :: i(), T :: i(), R :: i(), Q :: i()}) -> ok.
Okay so gl:multiTexCoord() is the one that sets up your texture coordinates in one, two, three, or four dimensions ๐ธ. gl:multiTexCoord1() drops the current texture coords to (s 0 0 1), and calling gl:multiTexCoord2() sets them to (s t 0 1). Same energy for gl:multiTexCoord3(), which lays down the texture coords as (s t r 1), and gl:multiTexCoord4() serves all four components explicitly as (s t r q) ๐
.
External documentation. ๐
newList
newList(List :: i(), Mode :: enum()) -> ok.
Display lists are literally groups of GL commands that got stored up for later execution, no cap ๐. You create them with gl:newList/2. After that, every subsequent command gets placed into the display list, in the order it was issued, all the way until gl:endList/0 gets called. Periodt.
External documentation. ๐
normal3sv
normal3sv({Nx :: i(), Ny :: i(), Nz :: i()}) -> ok.
The current normal gets set to the given coordinates whenever gl:normal() is issued. Byte, short, or integer args get converted to floating-point format with a linear mapping that maps the most positive representable integer value to 1.0 and the most negative representable integer value to -1.0 ๐. Math is giving, fr fr.
External documentation. ๐
normalPointer
normalPointer(Type :: enum(),
Stride :: i(),
Ptr :: offset() | mem()) ->
ok.
gl:normalPointer/3 specifies the location and data format of an array of normals to use when rendering โจ. Type says the data type of each normal coordinate, and Stride says the byte stride from one normal to the next โ that's what lets vertices and attributes get packed into a single array or stored in separate arrays (single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3) ๐.
External documentation. ๐
objectPtrLabel
objectPtrLabel(Ptr :: offset() | mem(),
Length :: i(),
Label :: string()) ->
ok.
gl:objectPtrLabel/3 labels the sync object identified by Ptr ๐ท๏ธ. That's it, that's the whole vibe.
External documentation. ๐
ortho
ortho(Left :: f(),
Right :: f(),
Bottom :: f(),
Top :: f(),
Near_val :: f(),
Far_val :: f()) ->
ok.
gl:ortho/6 describes a transformation that produces a parallel projection ๐ซ. The current matrix (see gl:matrixMode/1) gets multiplied by this matrix and the result replaces the current matrix, as if gl:multMatrix() were called with the following matrix as its argument:
External documentation. ๐
passThrough
passThrough(Token :: f()) -> ok.
External documentation. ๐ (glow up unconfirmed, only external docs to peek at ๐)
patchParameteri
patchParameteri(Pname :: enum(), Value :: i()) -> ok.
gl:patchParameter() specifies the parameters that will be used for patch primitives ๐ฆ. Pname specifies the parameter to modify and must be either ?GL_PATCH_VERTICES, ?GL_PATCH_DEFAULT_OUTER_LEVEL or ?GL_PATCH_DEFAULT_INNER_LEVEL. For gl:patchParameteri/2, Value specifies the new value for the parameter specified by Pname. For gl:patchParameterfv/2, Values specifies the address of an array containing the new values for the parameter specified by Pname.
External documentation. ๐
pauseTransformFeedback
pauseTransformFeedback() -> ok.
gl:pauseTransformFeedback/0 pauses transform feedback operations on the currently active transform feedback object โธ๏ธ. When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the object results in an error ๐. However, a new transform feedback object may be bound while transform feedback is paused. Classic "on a break but still together" situation, iykyk.
External documentation. ๐
pixelMapusv
pixelMapusv(Map :: enum(), Mapsize :: i(), Values :: binary()) ->
ok.
gl:pixelMap() sets up translation tables, aka maps, used by gl:copyPixels/5, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, gl:copyTexSubImage3D/9, gl:drawPixels/5, gl:readPixels/7, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, and gl:texSubImage3D/11 ๐. Additionally, if the ARB_imaging subset is supported, the routines gl:colorTable/6, gl:colorSubTable/6, gl:convolutionFilter1D/6, gl:convolutionFilter2D/7, gl:histogram/4, gl:minmax/3, and gl:separableFilter2D/8. Use of these maps is described completely in the gl:pixelTransfer() reference page, and partly in the reference pages for the pixel and texture image commands. Only the specification of the maps is described in this reference page ๐.
External documentation. ๐
pixelStorei
pixelStorei(Pname :: enum(), Param :: i()) -> ok.
gl:pixelStore() sets pixel storage modes that affect the operation of subsequent gl:readPixels/7 as well as the unpacking of texture patterns (see gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, gl:texSubImage3D/11), gl:compressedTexImage1D/7, gl:compressedTexImage2D/8, gl:compressedTexImage3D/9, gl:compressedTexSubImage1D/7, gl:compressedTexSubImage2D/9 or gl:compressedTexSubImage1D/7 ๐ธ.
External documentation. ๐
pixelTransferi
pixelTransferi(Pname :: enum(), Param :: i()) -> ok.
gl:pixelTransfer() sets pixel transfer modes that affect the operation of subsequent gl:copyPixels/5, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, gl:copyTexSubImage3D/9, gl:drawPixels/5, gl:readPixels/7, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, and gl:texSubImage3D/11 commands ๐ฆ. Additionally, if the ARB_imaging subset is supported, the routines gl:colorTable/6, gl:colorSubTable/6, gl:convolutionFilter1D/6, gl:convolutionFilter2D/7, gl:histogram/4, gl:minmax/3, and gl:separableFilter2D/8 are also affected. The algorithms that are specified by pixel transfer modes operate on pixels after they are read from the frame buffer (gl:copyPixels/5gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, gl:copyTexSubImage3D/9, and gl:readPixels/7), or unpacked from client memory (gl:drawPixels/5, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, and gl:texSubImage3D/11). Pixel transfer operations happen in the same order, and in the same manner, regardless of the command that resulted in the pixel operation ๐ฅ. Pixel storage modes (see gl:pixelStore()) control the unpacking of pixels being read from client memory and the packing of pixels being written back into client memory.
External documentation. ๐
pixelZoom
pixelZoom(Xfactor :: f(), Yfactor :: f()) -> ok.
gl:pixelZoom/2 specifies values for the x and y zoom factors ๐
. During the execution of gl:drawPixels/5 or gl:copyPixels/5, if (xr, yr) is the current raster position, and a given element is in the mth row and nth column of the pixel rectangle, then pixels whose centers are in the rectangle with corners at
External documentation. ๐
pointParameteriv
pointParameteriv(Pname :: enum(), Params :: tuple()) -> ok.
The following values are accepted for Pname:
External documentation. ๐
pointSize
pointSize(Size :: f()) -> ok.
gl:pointSize/1 specifies the rasterized diameter of points ๐. If point size mode is disabled (see gl:enable/1 with parameter ?GL_PROGRAM_POINT_SIZE), this value will be used to rasterize points. Otherwise, the value written to the shading language built-in variable gl_PointSize will be used. So basically the shading language gets main character energy once it's enabled, periodt ๐.
External documentation. ๐
polygonMode
polygonMode(Face :: enum(), Mode :: enum()) -> ok.
gl:polygonMode/2 controls the interpretation of polygons for rasterization ๐. Face describes which polygons Mode applies to: both front and back-facing polygons (?GL_FRONT_AND_BACK). The polygon mode affects only the final rasterization of polygons. In particular, a polygon's vertices are lit and the polygon is clipped and possibly culled before these modes are applied โ so it's giving "last step only," no cap.
External documentation. ๐
polygonOffset
polygonOffset(Factor :: f(), Units :: f()) -> ok.
When ?GL_POLYGON_OFFSET_FILL, ?GL_POLYGON_OFFSET_LINE, or ?GL_POLYGON_OFFSET_POINT is enabled, each fragment's depth value will be offset after it is interpolated from the depth values of the appropriate vertices ๐ฆ. The value of the offset is factorรDZ+rรunits, where DZ is a measurement of the change in depth relative to the screen area of the polygon, and r is the smallest value that is guaranteed to produce a resolvable offset for a given implementation. The offset is added before the depth test is performed and before the value is written into the depth buffer โจ.
External documentation. ๐
polygonOffsetClamp
polygonOffsetClamp(Factor :: f(), Units :: f(), Clamp :: f()) ->
ok.
No documentation available. ๐ (the void stares back, bestie)
polygonStipple
polygonStipple(Mask :: binary()) -> ok.
Polygon stippling, like line stippling (see gl:lineStipple/2), masks out certain fragments produced by rasterization, creating a pattern ๐. Stippling is independent of polygon antialiasing. Two separate vibes, fr fr.
External documentation. ๐
primitiveRestartIndex
primitiveRestartIndex(Index :: i()) -> ok.
gl:primitiveRestartIndex/1 specifies a vertex array element that is treated specially when primitive restarting is enabled ๐ฅ. This is known as the primitive restart index. Iconic behavior.
External documentation. ๐
prioritizeTextures
prioritizeTextures(Textures :: [i()], Priorities :: [clamp()]) ->
ok.
so gl:prioritizeTextures/2 is the one that takes the N texture priorities you hand it in Priorities and slaps them onto the N textures named in Textures. matching pairs, one-to-one, no leftovers. ๐
External documentation.
gl:programBinary/3
programBinary(Program :: i(),
BinaryFormat :: enum(),
Binary :: binary()) ->
ok.
okay so gl:programBinary/3 loads a program object back up from a program binary that a previous gl:getProgramBinary/2 handed you earlier. ๐ธ
Here's the tea, and it's a strict one: BinaryFormat and Binary must be exactly what a previous call to gl:getProgramBinary/2 gave you, and Length must be the length that gl:getProgramBinary/2 returned, or the length you'd get from gl:getProgram() when you call it with Pname set to ?GL_PROGRAM_BINARY_LENGTH. ๐
๐ and if those conditions are not met? the load just fails, andProgram's?GL_LINK_STATUSgets set to?GL_FALSE. no warning, no drama, just a sad little flag.
External documentation.
gl:programParameteri/3
programParameteri(Program :: i(), Pname :: enum(), Value :: i()) ->
ok.
gl:programParameter() specifies a brand new value for the parameter nameed by Pname for the program object Program. ๐
External documentation.
gl:programUniformMatrix4x3fv/4
programUniformMatrix4x3fv(Program, Location, Transpose, Value) ->
ok
when
Program :: i(),
Location :: i(),
Transpose :: 0 | 1,
Value ::
[{f(),
f(),
f(),
f(),
f(),
f(),
f(),
f(),
f(),
f(),
f(),
f()}].
gl:programUniform() modifies the value of a uniform variable, or a whole uniform variable array if that's the vibe. โจ The location of the uniform variable you're touching is specified by Location, which should be a value that gl:getUniformLocation/2 returned to you. And gl:programUniform() operates on the program object specified by Program. very "know your address before you redecorate".
External documentation.
gl:provokingVertex/1
provokingVertex(Mode :: enum()) -> ok.
Flatshading a vertex shader varying output means assigning all the vetices of the primitive the same value for that output. and the vertex that value gets derived from? that's the provoking vertex, bestie. gl:provokingVertex/1 specifies which vertex gets to be the source of data for flat shaded varyings. main character vertex energy, honestly. ๐
External documentation.
gl:pushAttrib/1
pushAttrib(Mask :: i()) -> ok.
gl:pushAttrib/1 takes one argument: a mask that says which groups of state variables to save on the attribute stack. ๐ Symbolic constants are used to set bits in the mask, and Mask is typically built by specifying the bitwise-or of several of those constants together. And there's a special mask, ?GL_ALL_ATTRIB_BITS, that saves all stackable states. yes ma'am, the everything bagel of masks. ๐ฅฏ
External documentation.
gl:pushClientAttrib/1
pushClientAttrib(Mask :: i()) -> ok.
gl:pushClientAttrib/1 takes one argument: a mask telling it which groups of client-state variables to save on the client attribute stack. ๐ฆ Same deal โ symbolic constants set the bits, and Mask is usually the bitwise-or of several constants smooshed together. The special mask ?GL_CLIENT_ALL_ATTRIB_BITS saves all stackable client state. ๐
External documentation.
gl:pushDebugGroup/4
pushDebugGroup(Source :: enum(),
Id :: i(),
Length :: i(),
Message :: string()) ->
ok.
gl:pushDebugGroup/4 pushes a debug group, described by the string Message, into the command stream. ๐ฃ
Id specifies the ID of messages generated, and Length holds the number of characters in Message. If Length is negative, it's implied that Message contains a null terminated string. ๐ธ
The message ends up with the specified Source and Id, the type ?GL_DEBUG_TYPE_PUSH_GROUP, and severity ?GL_DEBUG_SEVERITY_NOTIFICATION. Then the GL puts a new debug group on top of the debug group stack โ and that new group inherits the control of the volume of debug output of whatever debug group was previously sitting on top of the debug group stack. ๐
Because debug groups are strictly hierarchical, any extra control over the debug output volume only applies within the active debug group, and the debug groups pushed on top of the active debug group. it's giving corporate org chart but for debug output. ๐
External documentation.
gl:pushMatrix/0
pushMatrix() -> ok.
There's a stack of matrices for each of the matrix modes. ๐ In ?GL_MODELVIEW mode the stack depth is at least 32. In the other modes โ ?GL_COLOR, ?GL_PROJECTION, and ?GL_TEXTURE โ the depth is at least 2. And the current matrix in any mode is just the matrix sitting on top of the stack for that mode. it's the top of the pile, always. ๐
External documentation.
gl:pushName/1
pushName(Name :: i()) -> ok.
The name stack is what selection mode uses so that sets of rendering commands can each be uniquely identified. ๐ท๏ธ It's an ordered set of unsigned integers, and it starts out completely empty. yes, an empty stack, iconic, we love a blank slate. ๐
External documentation.
gl:queryCounter/2
queryCounter(Id :: i(), Target :: enum()) -> ok.
gl:queryCounter/2 makes the GL record the current time into the query object named Id. โฐ Target must be ?GL_TIMESTAMP. The time gets recorded after all previous commands on the GL client and server state and the framebuffer have been fully realized. Once the time is recorded, the query result for that object is marked available. โ
fun detail: gl:queryCounter/2 timer queries can be used inside a gl:beginQuery/2 / gl:endQuery/1 block where the target is ?GL_TIME_ELAPSED, and it does not affect the result of that query object. multitasking icon. โจ
External documentation.
gl:rasterPos4sv/1
rasterPos4sv({X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.
The GL keeps a 3D position in window coordinates, bestie. That position is called the raster position, and it's what positions pixel and bitmap write operations. ๐ It's maintained with subpixel accuracy. See gl:bitmap/7, gl:drawPixels/5, and gl:copyPixels/5 if you wanna see it in action. ๐ฆ
External documentation.
gl:readBuffer/1
readBuffer(Mode :: enum()) -> ok.
gl:readBuffer/1 picks a color buffer to be the source for all the subsequent gl:readPixels/7, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, and gl:copyTexSubImage3D/9 commands. ๐ฏ
Mode accepts one of twelve or more predefined values. In a fully configured system: ?GL_FRONT, ?GL_LEFT, and ?GL_FRONT_LEFT all name the front left buffer; ?GL_FRONT_RIGHT and ?GL_RIGHT name the front right buffer; and ?GL_BACK_LEFT and ?GL_BACK name the back left buffer. ๐
Further more, the constants ?GL_COLOR_ATTACHMENTi may be used to indicate the ith color attachment, where i ranges from zero to the value of ?GL_MAX_COLOR_ATTACHMENTS minus one. ๐
External documentation.
gl:readPixels/7
readPixels(X, Y, Width, Height, Format, Type, Pixels) -> ok
when
X :: i(),
Y :: i(),
Width :: i(),
Height :: i(),
Format :: enum(),
Type :: enum(),
Pixels :: mem().
gl:readPixels/7 and glReadnPixels pull pixel data out of the frame buffer, starting with the pixel whose lower left corner is at location (X, Y), and drop it into client memory starting at location Data. ๐ซถ
Several parameters control the processing of that pixel data before it lands in client memory โ those are set with gl:pixelStore(). And this reference page describes the effects on gl:readPixels/7 and glReadnPixels of most, but not all, of the parameters specified by these three commands. so, y'know, most. ๐
External documentation.
gl:rectsv/2
rectsv(V1 :: {i(), i()}, V2 :: {i(), i()}) -> ok.
gl:rect() supports efficient specification of rectangles as two corner points. ๐ Each rectangle command takes four arguments, organized either as two consecutive pairs of (x y) coordinates, or as two pointers to arrays, each containing an (x y) pair. The resulting rectangle is defined in the z=0 plane. flat queen. โจ
External documentation.
gl:releaseShaderCompiler/0
releaseShaderCompiler() -> ok.
gl:releaseShaderCompiler/0 provides a hint to the implementation that it may free internal resources associated with its shader compiler. ๐งน And that's a hint, not a command โ gl:compileShader/1 may be called afterwards, and the implementation may at that time reallocate the resources it previously freed thanks to your gl:releaseShaderCompiler/0 call. it's giving "clean your room, but I might dump everything back out, who's to say." ๐
External documentation.
gl:renderMode/1
renderMode(Mode :: enum()) -> i().
gl:renderMode/1 sets the rasterization mode. It takes one argument, Mode, which can assume one of three predefined values:
External documentation.
gl:renderbufferStorage/4
renderbufferStorage(Target :: enum(),
Internalformat :: enum(),
Width :: i(),
Height :: i()) ->
ok.
gl:renderbufferStorage/4 is equivalent to calling gl:renderbufferStorageMultisample/5 with the Samples set to zero. and glNamedRenderbufferStorage is equivalent to calling glNamedRenderbufferStorageMultisample with the samples set to zero. symmetry, bestie, we love to see it. ๐
External documentation.
gl:renderbufferStorageMultisample/5
renderbufferStorageMultisample(Target :: enum(),
Samples :: i(),
Internalformat :: enum(),
Width :: i(),
Height :: i()) ->
ok.
gl:renderbufferStorageMultisample/5 and glNamedRenderbufferStorageMultisample establish the data storage, format, dimensions, and number of samples of a renderbuffer object's image. ๐ฆ all the essentials, set in one go. ๐
External documentation.
gl:resetHistogram/1
resetHistogram(Target :: enum()) -> ok.
gl:resetHistogram/1 resets all the elements of the current histogram table to zero. Zero, zip, nada. ๐
External documentation. โจ
resetMinmax
resetMinmax(Target :: enum()) -> ok.
gl:resetMinmax/1 resets the elements of the current minmax table to their initial values. So the maximum element gets the minimum possible component values, and the minimum element gets the maximum possible component values. Yes, it's giving opposites attract. ๐
External documentation. ๐
resumeTransformFeedback
resumeTransformFeedback() -> ok.
gl:resumeTransformFeedback/0 resumes transform feedback operations on the currently active transform feedback object. When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the object results in an error. But plot twist: a new transform feedback object may be bound while transform feedback is paused. So you can swap, just can't touch. ๐ซถ
External documentation. โจ
rotatef
rotatef(Angle :: f(), X :: f(), Y :: f(), Z :: f()) -> ok.
gl:rotate() produces a rotation of Angle degrees around the vector (x y z). The current matrix (see gl:matrixMode/1) is multiplied by a rotation matrix, with the product replacing the current matrix, as if gl:multMatrix() were called with the following matrix as its argument:
External documentation. ๐
sampleCoverage
sampleCoverage(Value :: clamp(), Invert :: 0 | 1) -> ok.
Multisampling samples a pixel multiple times at various implementation-dependent subpixel locations to generate antialiasing effects. And it transparently antialiases points, lines, polygons, and images if it is enabled. It's giving smooth operator. ๐
External documentation. โจ
sampleMaski
sampleMaski(MaskNumber :: i(), Mask :: i()) -> ok.
gl:sampleMaski/2 sets one 32-bit sub-word of the multi-word sample mask, aka ?GL_SAMPLE_MASK_VALUE. One sub-word at a time, slay. ๐
External documentation. ๐
samplerParameteriv
samplerParameteriv(Sampler :: i(),
Pname :: enum(),
Param :: [i()]) ->
ok.
gl:samplerParameter() assigns the value or values in Params to the sampler parameter specified as Pname. Sampler specifies the sampler object to be modified, and it must be the name of a sampler object previously returned from a call to gl:genSamplers/1. The following symbols are accepted in Pname:
External documentation. ๐
scalef
scalef(X :: f(), Y :: f(), Z :: f()) -> ok.
gl:scale() produces a nonuniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of the three axes. So you can stretch it, squash it, make it โจfabulousโจ. ๐
External documentation. ๐
scissor
scissor(X :: i(), Y :: i(), Width :: i(), Height :: i()) -> ok.
gl:scissor/4 defines a rectangle, called the scissor box, in window coordinates. The first two arguments, X and Y, specify the lower left corner of the box. Width and Height specify the width and height of the box. Snip snip. โ๏ธ
External documentation. โจ
scissorArrayv
scissorArrayv(First :: i(), V :: [{i(), i(), i(), i()}]) -> ok.
gl:scissorArrayv/2 defines rectangles, called scissor boxes, in window coordinates for each viewport. First specifies the index of the first scissor box to modify and Count specifies the number of scissor boxes to modify. First must be less than the value of ?GL_MAX_VIEWPORTS, and First + Count must be less than or equal to the value of ?GL_MAX_VIEWPORTS. V specifies the address of an array containing integers specifying the lower left corner of the scissor boxes, and the width and height of the scissor boxes, in that order. So many boxes, so little time. ๐ฆ
External documentation. ๐
scissorIndexedv
scissorIndexedv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.
gl:scissorIndexed/5 defines the scissor box for a specified viewport. Index specifies the index of scissor box to modify. Index must be less than the value of ?GL_MAX_VIEWPORTS. For gl:scissorIndexed/5, Left, Bottom, Width and Height specify the left, bottom, width and height of the scissor box, in pixels, respectively. For gl:scissorIndexedv/2, V specifies the address of an array containing integers specifying the lower left corner of the scissor box, and the width and height of the scissor box, in that order. Indexed but make it fashion. ๐
External documentation. โจ
secondaryColor3usv
secondaryColor3usv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.
The GL stores both a primary four-valued RGBA color and a secondary four-valued RGBA color (where alpha is always set to 0.0) that is associated with every vertex. Two colors? It's giving double trouble. ๐จ
External documentation. ๐
secondaryColorPointer
secondaryColorPointer(Size :: i(),
Type :: enum(),
Stride :: i(),
Pointer :: offset() | mem()) ->
ok.
gl:secondaryColorPointer/4 specifies the location and data format of an array of color components to use when rendering. Size specifies the number of components per color, and must be 3. Type specifies the data type of each color component, and Stride specifies the byte stride from one color to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. Pack it up, pack it in. ๐
External documentation. โจ
selectBuffer
selectBuffer(Size :: i(), Buffer :: mem()) -> ok.
gl:selectBuffer/2 has two arguments: Buffer is a pointer to an array of unsigned integers, and Size indicates the size of the array. Buffer returns values from the name stack (see gl:initNames/0, gl:loadName/1, gl:pushName/1) when the rendering mode is ?GL_SELECT (see gl:renderMode/1). gl:selectBuffer/2 must be issued before selection mode is enabled, and it must not be issued while the rendering mode is ?GL_SELECT. So don't play yourself. โ ๏ธ
External documentation. ๐
separableFilter2D
separableFilter2D(Target, Internalformat, Width, Height, Format,
Type, Row, Column) ->
ok
when
Target :: enum(),
Internalformat :: enum(),
Width :: i(),
Height :: i(),
Format :: enum(),
Type :: enum(),
Row :: offset() | mem(),
Column :: offset() | mem().
gl:separableFilter2D/8 builds a two-dimensional separable convolution filter kernel from two arrays of pixels. Filter it, bestie. โจ
External documentation. ๐
shadeModel
shadeModel(Mode :: enum()) -> ok.
GL primitives can have either flat or smooth shading. Smooth shading, the default, causes the computed colors of vertices to be interpolated as the primitive is rasterized, typically assigning different colors to each resulting pixel fragment. Flat shading selects the computed color of just one vertex and assigns it to all the pixel fragments generated by rasterizing a single primitive. In either case, the computed color of a vertex is the result of lighting if lighting is enabled, or it is the current color at the time the vertex was specified if lighting is disabled. Smooth like butter, or flat like a pancake. ๐ฅ
External documentation. โจ
shaderBinary
shaderBinary(Shaders :: [i()],
Binaryformat :: enum(),
Binary :: binary()) ->
ok.
gl:shaderBinary/3 loads pre-compiled shader binary code into the Count shader objects whose handles are given in Shaders. Binary points to Length bytes of binary shader code stored in client memory. BinaryFormat specifies the format of the pre-compiled code. Pre-compiled? We love efficiency. โก
External documentation. ๐
shaderSource
shaderSource(Shader :: i(), String :: [unicode:chardata()]) -> ok.
gl:shaderSource/2 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. Copy paste, but make it GL. ๐
External documentation. โจ
shaderStorageBlockBinding
shaderStorageBlockBinding(Program :: i(),
StorageBlockIndex :: i(),
StorageBlockBinding :: i()) ->
ok.
gl:shaderStorageBlockBinding/3 changes the active shader storage block with an assigned index of StorageBlockIndex in program object Program. StorageBlockIndex must be an active shader storage block index in Program. StorageBlockBinding must be less than the value of ?GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS. If successful, gl:shaderStorageBlockBinding/3 specifies that Program will use the data store of the buffer object bound to the binding point StorageBlockBinding to read and write the values of the buffer variables in the shader storage block identified by StorageBlockIndex. Bind it, bestie. ๐
External documentation. ๐
stencilFunc
stencilFunc(Func :: enum(), Ref :: i(), Mask :: i()) -> ok.
Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. Stencil planes are first drawn into using GL drawing primitives, then geometry and images are rendered using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. It's giving stencil chic. ๐ญ
External documentation. โจ
stencilFuncSeparate
stencilFuncSeparate(Face :: enum(),
Func :: enum(),
Ref :: i(),
Mask :: i()) ->
ok.
Stenciling, okay, is literally depth-buffering's bestie ๐ โ it enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then you 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. It's giving "art class but make it pixels" ๐จโจ
External documentation.
๐ stencilMask
stencilMask(Mask :: i()) -> ok.
gl:stencilMask/1 controls the writing of individual bits in the stencil planes, no cap. 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, that corresponding bit is write-protected ๐. Initially, all bits are enabled for writing.
External documentation.
๐ฆ stencilMaskSeparate
stencilMaskSeparate(Face :: enum(), Mask :: i()) -> ok.
gl:stencilMaskSeparate/2 also controls the writing of individual bits in the stencil planes โ same energy, but per-Face now ๐ซ. 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.
External documentation.
๐ stencilOp
stencilOp(Fail :: enum(), Zfail :: enum(), Zpass :: enum()) -> ok.
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.
External documentation.
๐ธ stencilOpSeparate
stencilOpSeparate(Face :: enum(),
Sfail :: enum(),
Dpfail :: enum(),
Dppass :: enum()) ->
ok.
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.
External documentation.
โญ texCoord4sv
texCoord4sv({S :: i(), T :: i(), R :: i(), Q :: i()}) -> ok.
gl:texCoord() specifies texture coordinates in one, two, three, or four dimensions, bestie ๐. gl:texCoord1() sets the current texture coordinates to (s 0 0 1); a call to gl:texCoord2() sets them to (s t 0 1). Similarly, gl:texCoord3() specifies the texture coordinates as (s t r 1), and gl:texCoord4() defines all four components explicitly as (s t r q). The way that the missing ones just default to 0 and 1?? iconic โจ
External documentation.
๐ง texCoordPointer
texCoordPointer(Size :: i(),
Type :: enum(),
Stride :: i(),
Ptr :: offset() | mem()) ->
ok.
gl:texCoordPointer/4 specifies the location and data format of an array of texture coordinates to use when rendering ๐ซถ. Size specifies the number of coordinates per texture coordinate set, and must be 1, 2, 3, or 4. Type specifies the data type of each texture coordinate, and Stride specifies the byte stride from one texture coordinate set to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.) iykyk ๐
External documentation.
๐ texEnviv
texEnviv(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.
A texture environment specifies how texture values are interpreted when a fragment is textured ๐. When Target is ?GL_TEXTURE_FILTER_CONTROL, Pname must be ?GL_TEXTURE_LOD_BIAS. When Target is ?GL_TEXTURE_ENV, Pname can be ?GL_TEXTURE_ENV_MODE, ?GL_TEXTURE_ENV_COLOR, ?GL_COMBINE_RGB, ?GL_COMBINE_ALPHA, ?GL_RGB_SCALE, ?GL_ALPHA_SCALE, ?GL_SRC0_RGB, ?GL_SRC1_RGB, ?GL_SRC2_RGB, ?GL_SRC0_ALPHA, ?GL_SRC1_ALPHA, or ?GL_SRC2_ALPHA. That's the whole menu, no substitutions ๐ฅ
External documentation.
๐ texGeniv
texGeniv(Coord :: enum(), Pname :: enum(), Params :: tuple()) -> ok.
gl:texGen() selects a texture-coordinate generation function or supplies coefficients for one of the functions, lowkey magic โจ. Coord names one of the (s, t, r, q) texture coordinates; it must be one of the symbols ?GL_S, ?GL_T, ?GL_R, or ?GL_Q. Pname must be one of three symbolic constants: ?GL_TEXTURE_GEN_MODE, ?GL_OBJECT_PLANE, or ?GL_EYE_PLANE. If Pname is ?GL_TEXTURE_GEN_MODE, then Params chooses a mode, one of ?GL_OBJECT_LINEAR, ?GL_EYE_LINEAR, ?GL_SPHERE_MAP, ?GL_NORMAL_MAP, or ?GL_REFLECTION_MAP. If Pname is either ?GL_OBJECT_PLANE or ?GL_EYE_PLANE, Params contains coefficients for the corresponding texture generation function.
External documentation.
๐ texImage1D
texImage1D(Target, Level, InternalFormat, Width, Border, Format,
Type, Pixels) ->
ok
when
Target :: enum(),
Level :: i(),
InternalFormat :: i(),
Width :: i(),
Border :: i(),
Format :: enum(),
Type :: enum(),
Pixels :: offset() | mem().
Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled ๐. To enable and disable one-dimensional texturing, call gl:enable/1 and gl:disable/1 with argument ?GL_TEXTURE_1D.
External documentation.
๐ธ texImage2D
texImage2D(Target, Level, InternalFormat, Width, Height, Border,
Format, Type, Pixels) ->
ok
when
Target :: enum(),
Level :: i(),
InternalFormat :: i(),
Width :: i(),
Height :: i(),
Border :: i(),
Format :: enum(),
Type :: enum(),
Pixels :: offset() | mem().
Texturing allows elements of an image array to be read by shaders ๐. That's the whole vibe of this one, bestie.
External documentation.
๐ฆ texImage2DMultisample
texImage2DMultisample(Target, Samples, Internalformat, Width,
Height, Fixedsamplelocations) ->
ok
when
Target :: enum(),
Samples :: i(),
Internalformat :: enum(),
Width :: i(),
Height :: i(),
Fixedsamplelocations :: 0 | 1.
gl:texImage2DMultisample/6 establishes the data storage, format, dimensions and number of samples of a multisample texture's image ๐
.
External documentation.
๐ texImage3D
texImage3D(Target, Level, InternalFormat, Width, Height, Depth,
Border, Format, Type, Pixels) ->
ok
when
Target :: enum(),
Level :: i(),
InternalFormat :: i(),
Width :: i(),
Height :: i(),
Depth :: i(),
Border :: i(),
Format :: enum(),
Type :: enum(),
Pixels :: offset() | mem().
Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled ๐. To enable and disable three-dimensional texturing, call gl:enable/1 and gl:disable/1 with argument ?GL_TEXTURE_3D.
External documentation.
โญ texImage3DMultisample
texImage3DMultisample(Target, Samples, Internalformat, Width,
Height, Depth, Fixedsamplelocations) ->
ok
when
Target :: enum(),
Samples :: i(),
Internalformat :: enum(),
Width :: i(),
Height :: i(),
Depth :: i(),
Fixedsamplelocations :: 0 | 1.
gl:texImage3DMultisample/7 establishes the data storage, format, dimensions and number of samples of a multisample texture's image ๐ซถ. (Yes, it's the 3D sibling of the one above, and yes, it ate ๐)
External documentation.
๐ texParameteriv
texParameteriv(Target :: enum(),
Pname :: enum(),
Params :: tuple()) ->
ok.
gl:texParameter() and gl:textureParameter() assign the value or values in Params to the texture parameter specified as Pname โจ. For gl:texParameter(), Target defines the target texture, either ?GL_TEXTURE_1D, ?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_2D, ?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_2D_MULTISAMPLE, ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY, ?GL_TEXTURE_3D, ?GL_TEXTURE_CUBE_MAP, ?GL_TEXTURE_CUBE_MAP_ARRAY, or ?GL_TEXTURE_RECTANGLE. The following symbols are accepted in Pname:
External documentation.
๐ texStorage1D
texStorage1D(Target :: enum(),
Levels :: i(),
Internalformat :: enum(),
Width :: i()) ->
ok.
...gl:texStorage1D/4 and gl:textureStorage1D() are literally giving you the storage requirements for every single level of a one-dimensional texture, all at once. Bestie, once you've specified a texture with this call, the format and dimensions of all levels become immutable โ unless it's a proxy texture, obviously. The contents of the image? Still totally editable. Its storage requirements though? Nope, those cannot change. A texture like this gets called an immutable-format texture, and it's kind of iconic for that. ๐
External documentation.
๐ฆ texStorage2D
texStorage2D(Target :: enum(),
Levels :: i(),
Internalformat :: enum(),
Width :: i(),
Height :: i()) ->
ok.
gl:texStorage2D/5 and gl:textureStorage2D() specify the storage requirements for all levels of a two-dimensional texture or a one-dimensional texture array, simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture. โจ
External documentation.
๐ธ texStorage2DMultisample
texStorage2DMultisample(Target, Samples, Internalformat, Width,
Height, Fixedsamplelocations) ->
ok
when
Target :: enum(),
Samples :: i(),
Internalformat :: enum(),
Width :: i(),
Height :: i(),
Fixedsamplelocations :: 0 | 1.
gl:texStorage2DMultisample/6 and gl:textureStorage2DMultisample() set the storage requirements for a two-dimensional multisample texture. Once a texture is specified with this command, its format and dimensions become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture. ๐
External documentation.
๐ซ texStorage3D
texStorage3D(Target, Levels, Internalformat, Width, Height, Depth) ->
ok
when
Target :: enum(),
Levels :: i(),
Internalformat :: enum(),
Width :: i(),
Height :: i(),
Depth :: i().
gl:texStorage3D/6 and gl:textureStorage3D() specify the storage requirements for all levels of a three-dimensional, two-dimensional array or cube-map array texture simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture. ๐
External documentation.
๐ซถ texStorage3DMultisample
texStorage3DMultisample(Target, Samples, Internalformat, Width,
Height, Depth, Fixedsamplelocations) ->
ok
when
Target :: enum(),
Samples :: i(),
Internalformat :: enum(),
Width :: i(),
Height :: i(),
Depth :: i(),
Fixedsamplelocations :: 0 | 1.
gl:texStorage3DMultisample/7 and gl:textureStorage3DMultisample() specify the storage requirements for a two-dimensional multisample array texture. Once a texture is specified with this command, its format and dimensions become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture. ๐
External documentation.
๐ texSubImage1D
texSubImage1D(Target, Level, Xoffset, Width, Format, Type, Pixels) ->
ok
when
Target :: enum(),
Level :: i(),
Xoffset :: i(),
Width :: i(),
Format :: enum(),
Type :: enum(),
Pixels :: offset() | mem().
Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable or disable one-dimensional texturing, call gl:enable/1 and gl:disable/1 with argument ?GL_TEXTURE_1D. ๐ง
External documentation.
๐ texSubImage2D
texSubImage2D(Target, Level, Xoffset, Yoffset, Width, Height,
Format, Type, Pixels) ->
ok
when
Target :: enum(),
Level :: i(),
Xoffset :: i(),
Yoffset :: i(),
Width :: i(),
Height :: i(),
Format :: enum(),
Type :: enum(),
Pixels :: offset() | mem().
Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. ๐
External documentation.
๐ texSubImage3D
texSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, Width,
Height, Depth, Format, Type, Pixels) ->
ok
when
Target :: enum(),
Level :: i(),
Xoffset :: i(),
Yoffset :: i(),
Zoffset :: i(),
Width :: i(),
Height :: i(),
Depth :: i(),
Format :: enum(),
Type :: enum(),
Pixels :: offset() | mem().
Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. โจ
External documentation.
๐ฅ textureBarrier
textureBarrier() -> ok.
Okay so this one is important, listen up. The values of rendered fragments are undefined when a shader stage fetches texels and the same texels are written via fragment shader outputs โ even if the reads and writes are not in the same drawing command. To safely read the result of a written texel via a texel fetch in a subsequent drawing command, call gl:textureBarrier/0 between the two drawing commands. That guarantees writes have completed and caches have been invalidated before subsequent drawing commands are executed. No barrier, no vibes. ๐
External documentation.
๐ textureBuffer
textureBuffer(Texture :: i(),
Internalformat :: enum(),
Buffer :: i()) ->
ok.
gl:texBuffer/3 and gl:textureBuffer/3 attach the data store of a specified buffer object to a specified texture object, and specify the storage format for the texture image found in the buffer object. The texture object must be a buffer texture. Periodt. ๐
External documentation.
๐ธ textureBufferRange
textureBufferRange(Texture :: i(),
Internalformat :: enum(),
Buffer :: i(),
Offset :: i(),
Size :: i()) ->
ok.
gl:texBufferRange/5 and gl:textureBufferRange/5 attach a range of the data store of a specified buffer object to a specified texture object, and specify the storage format for the texture image found in the buffer object. The texture object must be a buffer texture. ๐ท
External documentation.
๐ฆ textureView
textureView(Texture, Target, Origtexture, Internalformat,
Minlevel, Numlevels, Minlayer, Numlayers) ->
ok
when
Texture :: i(),
Target :: enum(),
Origtexture :: i(),
Internalformat :: enum(),
Minlevel :: i(),
Numlevels :: i(),
Minlayer :: i(),
Numlayers :: i().
gl:textureView/8 initializes a texture object as an alias, or view of another texture object, sharing some or all of the parent texture's data store with the initialized texture. Texture specifies a name previously reserved by a successful call to gl:genTextures/1 but that has not yet been bound or given a target. Target specifies the target for the newly initialized texture and must be compatible with the target of the parent texture, given in Origtexture as specified in the following table: ๐
External documentation.
โญ transformFeedbackBufferBase
transformFeedbackBufferBase(Xfb :: i(),
Index :: i(),
Buffer :: i()) ->
ok.
gl:transformFeedbackBufferBase/3 binds the buffer object Buffer to the binding point at index Index of the transform feedback object Xfb. ๐
External documentation.
๐ transformFeedbackBufferRange
transformFeedbackBufferRange(Xfb :: i(),
Index :: i(),
Buffer :: i(),
Offset :: i(),
Size :: i()) ->
ok.
gl:transformFeedbackBufferRange/5 binds a range of the buffer object Buffer โ represented by Offset and Size โ to the binding point at index Index of the transform feedback object Xfb. ๐ซถ
External documentation.
๐ transformFeedbackVaryings
transformFeedbackVaryings(Program :: i(),
Varyings :: [unicode:chardata()],
BufferMode :: enum()) ->
ok.
Okay so the names of the vertex or geometry shader outputs to be recorded in transform feedback mode? They are specified using gl:transformFeedbackVaryings/3. 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. Periodt. โจ
External documentation. ๐ฆ
translatef(X :: f(), Y :: f(), Z :: f()) -> ok.
gl:translate() produces a translation by (x y z). The current matrix (see gl:matrixMode/1) is multiplied by this translation matrix, with the product replacing the current matrix, as if gl:multMatrix() were called with the following matrix for its argument: (iykyk, the matrix is giving external docs energy)
External documentation. ๐
uniformBlockBinding(Program :: i(),
UniformBlockIndex :: i(),
UniformBlockBinding :: i()) ->
ok.
Binding points for active uniform blocks are assigned using gl:uniformBlockBinding/3. Each of a program's active uniform blocks has a corresponding uniform buffer binding point. Program is the name of a program object for which the command gl:linkProgram/1 has been issued in the past. No cap, that's the whole vibe. ๐
External documentation. โจ
uniformMatrix4x3fv(Location, Transpose, Value) -> ok
when
Location :: i(),
Transpose :: 0 | 1,
Value ::
[{f(),
f(),
f(),
f(),
f(),
f(),
f(),
f(),
f(),
f(),
f(),
f()}].
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. Slay. ๐
External documentation. ๐ฆ
uniformSubroutinesuiv(Shadertype :: enum(), Indices :: [i()]) ->
ok.
gl:uniformSubroutines() loads all active subroutine uniforms for shader stage Shadertype of the current program with subroutine indices from Indices, storing Indices[i] into the uniform at location I. Count must be equal to the value of ?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the program currently in use at shader stage Shadertype. Furthermore, all values in Indices must be less than the value of ?GL_ACTIVE_SUBROUTINES for the shader stage. That's a hard vibe check, bestie. โญ
External documentation. ๐
useProgram(Program :: i()) -> ok.
gl:useProgram/1 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. It's giving main character energy. ๐
External documentation. โจ
useProgramStages(Pipeline :: i(), Stages :: i(), Program :: i()) ->
ok.
gl:useProgramStages/3 binds executables from a program object associated with a specified set of shader stages to the program pipeline object given by Pipeline. Pipeline specifies the program pipeline object to which to bind the executables. Stages contains a logical combination of bits indicating the shader stages to use within Program with the program pipeline object Pipeline. Stages must be a logical combination of ?GL_VERTEX_SHADER_BIT, ?GL_TESS_CONTROL_SHADER_BIT, ?GL_TESS_EVALUATION_SHADER_BIT, ?GL_GEOMETRY_SHADER_BIT, ?GL_FRAGMENT_SHADER_BIT and ?GL_COMPUTE_SHADER_BIT. Additionally, the special value ?GL_ALL_SHADER_BITS may be specified to indicate that all executables contained in Program should be installed in Pipeline. No cap, that's the whole bitwise situation. ๐
External documentation. ๐ฆ
validateProgram(Program :: i()) -> ok.
gl:validateProgram/1 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. Literally the vibe check for your shaders. ๐ฅ
External documentation. ๐
validateProgramPipeline(Pipeline :: i()) -> ok.
gl:validateProgramPipeline/1 instructs the implementation to validate the shader executables contained in Pipeline against the current GL state. The implementation may use this as an opportunity to perform any internal shader modifications that may be required to ensure correct operation of the installed shaders given the current GL state. Obsessed with a good validation moment. โจ
External documentation. ๐
vertex4sv({X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.
gl:vertex() commands are used within gl:'begin'/1/gl:'end'/0 pairs to specify point, line, and polygon vertices. The current color, normal, texture coordinates, and fog coordinate are associated with the vertex when gl:vertex() is called. It's giving old-school immediate mode realness. ๐
External documentation. ๐
vertexArrayElementBuffer(Vaobj :: i(), Buffer :: i()) -> ok.
gl:vertexArrayElementBuffer/2 binds a buffer object with id Buffer to the element array buffer bind point of a vertex array object with id Vaobj. If Buffer is zero, any existing element array buffer binding to Vaobj is removed. Zero means unbind, bestie. Periodt. ๐ฆ
External documentation. โจ
vertexArrayVertexBuffer(Vaobj :: i(),
Bindingindex :: i(),
Buffer :: i(),
Offset :: i(),
Stride :: i()) ->
ok.
gl:bindVertexBuffer/4 and gl:vertexArrayVertexBuffer/5 bind the buffer named Buffer to the vertex buffer binding point whose index is given by Bindingindex. gl:bindVertexBuffer/4 modifies the binding of the currently bound vertex array object, whereas gl:vertexArrayVertexBuffer/5 allows the caller to specify ID of the vertex array object with an argument named Vaobj, for which the binding should be modified. Offset and Stride specify the offset of the first element within the buffer and the distance between elements within the buffer, respectively, and are both measured in basic machine units. Bindingindex must be less than the value of ?GL_MAX_VERTEX_ATTRIB_BINDINGS. Offset and Stride must be greater than or equal to zero. If Buffer is zero, then any buffer currently bound to the specified binding point is unbound. No cap, that's a lot of binding lore. ๐
External documentation. ๐ฆ
vertexArrayVertexBuffers(Vaobj :: i(),
First :: i(),
Buffers :: [i()],
Offsets :: [i()],
Strides :: [i()]) ->
ok.
gl:bindVertexBuffers/4 and gl:vertexArrayVertexBuffers/5 bind storage from an array of existing buffer objects to a specified number of consecutive vertex buffer binding points units in a vertex array object. For gl:bindVertexBuffers/4, the vertex array object is the currently bound vertex array object. For gl:vertexArrayVertexBuffers/5, Vaobj is the name of the vertex array object. It's giving bulk bind energy. โจ
External documentation. ๐
vertexAttribBinding(Attribindex :: i(), Bindingindex :: i()) -> ok.
gl:vertexAttribBinding/2 and gl:vertexArrayAttribBinding/3 establishes an association between the generic vertex attribute of a vertex array object whose index is given by Attribindex, and a vertex buffer binding whose index is given by Bindingindex. For gl:vertexAttribBinding/2, the vertex array object affected is that currently bound. For gl:vertexArrayAttribBinding/3, Vaobj is the name of the vertex array object. Lowkey the matchmaker of attributes and bindings. ๐
External documentation. ๐
vertexAttribDivisor(Index :: i(), Divisor :: i()) -> ok.
gl:vertexAttribDivisor/2 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. Instancing? We love her. ๐ฅ
External documentation. ๐ฆ
vertexAttribL4dv(Index :: i(),
{X :: f(), Y :: f(), Z :: f(), W :: f()}) ->
ok.
The gl:vertexAttrib() family of entry points allows an application to pass generic vertex attributes in numbered locations. Simple. Clean. Iconic. โจ
External documentation. ๐
vertexAttribLPointer(Index :: i(),
Size :: i(),
Type :: enum(),
Stride :: i(),
Pointer :: offset() | mem()) ->
ok.
gl:vertexAttribFormat/5, gl:vertexAttribIFormat/4 and gl:vertexAttribLFormat/4, as well as gl:vertexArrayAttribFormat/6, gl:vertexArrayAttribIFormat/5 and gl:vertexArrayAttribLFormat/5 are the ones that specify the organization of data in vertex arrays. The first three calls operate on the bound vertex array object, whereas the last three ones modify the state of a vertex array object with ID Vaobj. Attribindex specifies the index of the generic vertex attribute array whose data layout is being described, and must be less than the value of ?GL_MAX_VERTEX_ATTRIBS.
External documentation. ๐
vertexAttribPointer(Index, Size, Type, Normalized, Stride,
Pointer) ->
ok
when
Index :: i(),
Size :: i(),
Type :: enum(),
Normalized :: 0 | 1,
Stride :: i(),
Pointer :: offset() | mem().
gl:vertexAttribPointer/6, gl:vertexAttribIPointer/5 and gl:vertexAttribLPointer/5 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.
External documentation. โจ
vertexBindingDivisor(Bindingindex :: i(), Divisor :: i()) -> ok.
gl:vertexBindingDivisor/2 and gl:vertexArrayBindingDivisor/3 modify the rate at which generic vertex attributes advance when rendering multiple instances of primitives in a single draw command. If Divisor is zero, the attributes using the buffer bound to Bindingindex advance once per vertex. If Divisor is non-zero, the attributes advance once per Divisor instances of the set(s) of vertices being rendered. An attribute is referred to as instanced if the corresponding Divisor value is non-zero.
External documentation. ๐ฆ
vertexPointer(Size :: i(),
Type :: enum(),
Stride :: i(),
Ptr :: offset() | mem()) ->
ok.
gl:vertexPointer/4 specifies the location and data format of an array of vertex coordinates to use when rendering. Size specifies the number of coordinates per vertex, and must be 2, 3, or 4. Type specifies the data type of each coordinate, and Stride specifies the byte stride from one vertex to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.)
External documentation. ๐ธ
viewport(X :: i(), Y :: i(), Width :: i(), Height :: i()) -> ok.
gl:viewport/4 specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows:
External documentation. ๐
viewportArrayv(First :: i(), V :: [{f(), f(), f(), f()}]) -> ok.
gl:viewportArrayv/2 specifies the parameters for multiple viewports simulataneously. First specifies the index of the first viewport to modify and Count specifies the number of viewports to modify. First must be less than the value of ?GL_MAX_VIEWPORTS, and First + Count must be less than or equal to the value of ?GL_MAX_VIEWPORTS. Viewports whose indices lie outside the range [First, First + Count) are not modified. V contains the address of an array of floating point values specifying the left ( x), bottom ( y), width ( w), and height ( h) of each viewport, in that order. x and y give the location of the viewport's lower left corner, and w and h give the width and height of the viewport, respectively. The viewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows:
External documentation. ๐
viewportIndexedfv(Index :: i(), V :: {f(), f(), f(), f()}) -> ok.
gl:viewportIndexedf/5 and gl:viewportIndexedfv/2 specify the parameters for a single viewport. Index specifies the index of the viewport to modify. Index must be less than the value of ?GL_MAX_VIEWPORTS. For gl:viewportIndexedf/5, X, Y, W, and H specify the left, bottom, width and height of the viewport in pixels, respectively. For gl:viewportIndexedfv/2, V contains the address of an array of floating point values specifying the left ( x), bottom ( y), width ( w), and height ( h) of each viewport, in that order. x and y give the location of the viewport's lower left corner, and w and h give the width and height of the viewport, respectively. The viewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows:
External documentation. ๐ง
waitSync(Sync :: i(), Flags :: i(), Timeout :: i()) -> ok.
gl:waitSync/3 causes the GL server to block and wait until Sync becomes signaled. Sync is the name of an existing sync object upon which to wait. Flags and Timeout are currently not used and must be set to zero and the special value ?GL_TIMEOUT_IGNORED, respectively
Flags and Timeout are placeholders for anticipated future extensions of sync object capabilities. They must have these reserved values in order that existing code calling gl:waitSync/3 operate properly in the presence of such extensions.
External documentation. ๐ฅ
windowPos3sv({X :: i(), Y :: i(), Z :: i()}) -> ok.
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.
External documentation. โญ
That's a wrap, bestie! This page was brought to you by Ericsson AB, version wx 2.6, and the one and only gl(3). No date listed, but it's giving timeless. ๐โจ
๐ฆ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms