import { WebGLRenderingContext } from "https://deno.land/x/gluten@0.1.9/src/webgl/mod.ts";
Provides an interface to the OpenGL ES 2.0 graphics rendering context for the drawing surface of a dwm window.
Constructors
Properties
Represents the actual height of the current drawing buffer. It should match the height attribute of the window associated with this context, but might differ if the implementation is not able to provide the requested height.
Represents the actual width of the current drawing buffer. It should match the width attribute of the window associated with this context, but might differ if the implementation is not able to provide the requested width.
Methods
Specifies which texture unit to make active.
Attaches either a fragment or vertex WebGLShader to a WebGLProgram.
Binds a given WebGLBuffer to a target.
Bind the given WebGLFramebuffer object to the given binding point (target), which must be FRAMEBUFFER. If framebuffer is null, the default framebuffer provided by the context is bound and attempts to modify or query state on target FRAMEBUFFER will generate an INVALID_OPERATION error. An attempt to bind an object marked for deletion will generate an INVALID_OPERATION error, and the current binding will remain untouched.
Bind the given WebGLRenderbuffer object to the given binding point (target), which must be RENDERBUFFER. If renderbuffer is null the renderbuffer object currently bound to this target is unbound. An attempt to bind an object marked for deletion will generate an INVALID_OPERATION error, and the current binding will remain untouched.
Sets the source and destination blending factors.
Sets both the RGB blend equation and alpha blend equation to a single equation.
Sets the RGB blend equation and alpha blend equation separately.
Defines which function is used for blending pixel arithmetic.
Defines which function is used for blending pixel arithmetic for RGB and alpha components separately.
Initializes and creates the buffer object's data store.
Clears buffers to preset values.
Specifies the color values used when clearing color buffers.
Specifies the clear value for the depth buffer.
Specifies the clear value for the stencil buffer.
Sets which color components to enable or to disable when drawing or rendering to a WebGLFramebuffer.
Compiles a GLSL shader into binary data so that it can be used by a WebGLProgram.
Creates and initializes a WebGLBuffer storing data such as vertices or colors.
Creates and initializes a WebGLFramebuffer object.
Creates and initializes a WebGLProgram object.
Create a WebGLRenderbuffer object and initialize it with a renderbuffer object name as if by calling glGenRenderbuffers.
Creates a WebGLShader that can then be configured further using WebGLRenderingContext.shaderSource() and WebGLRenderingContext.compileShader().
Specifies whether or not front- and/or back-facing polygons can be culled.
Deletes a given WebGLBuffer. This method has no effect if the buffer has already been deleted.
Deletes a given WebGLFramebuffer object. This method has no effect if the frame buffer has already been deleted.
Mark for deletion the program object contained in the passed WebGLProgram, as if by calling glDeleteProgram. If the object has already been marked for deletion, the call has no effect. Note that underlying GL object will be automatically marked for deletion when the JS object is destroyed, however this method allows authors to mark an object for deletion early.
Mark for deletion the shader object contained in the passed WebGLShader, as if by calling glDeleteShader. If the object has already been marked for deletion, the call has no effect. Note that underlying GL object will be automatically marked for deletion when the JS object is destroyed, however this method allows authors to mark an object for deletion early.
Specifies a function that compares incoming pixel depth to the current depth buffer value.
Sets whether writing into the depth buffer is enabled or disabled.
Specifies the depth range mapping from normalized device coordinates to window or viewport coordinates.
Disables specific WebGL capabilities for this context.
Disable the vertex attribute at index as an array. WebGL imposes additional rules beyond OpenGL ES 2.0 regarding enabled vertex attributes
Renders primitives from array data.
Draw using the currently bound element array buffer. The given offset is in bytes, and must be a valid multiple of the size of the given type or an INVALID_OPERATION error will be generated; in addition the offset must be non-negative or an INVALID_VALUE error will be generated; see Buffer Offset and Stride Requirements. If count is greater than zero, then a non-null WebGLBuffer must be bound to the ELEMENT_ARRAY_BUFFER binding point or an INVALID_OPERATION error will be generated.
Enables specific WebGL capabilities for this context.
Turns on the generic vertex attribute array at the specified index into the list of attribute arrays.
Attaches a WebGLRenderbuffer object to a WebGLFramebuffer object.
Attaches a texture to a WebGLFramebuffer.
Specifies whether polygons are front- or back-facing by setting a winding orientation.
Returns a new WebGLActiveInfo object describing the size, type and name of the vertex attribute at the passed index of the passed program object. If the passed index is out of range, generates an INVALID_VALUE error and returns null. Returns null if any OpenGL errors are generated during the execution of this function.
Returns a new WebGLActiveInfo object describing the size, type and name of the uniform at the passed index of the passed program object. If the passed index is out of range, generates an INVALID_VALUE error and returns null. Returns null if any OpenGL errors are generated during the execution of this function.
Returns the location of an attribute variable in a given WebGLProgram.
Returns a WebGLContextAttributes object that contains the actual context parameters. Might return null, if the context is lost.
Returns error information.
Returns an object if, and only if, name is an ASCII case-insensitive match [HTML] for one of the names returned from getSupportedExtensions; otherwise, returns null. The object returned from getExtension contains any constants or functions provided by the extension. A returned object may have no constants or functions if the extension does not define any, but a unique object must still be returned. That object is used to indicate that the extension has been enabled.
Returns a value for the passed parameter name.
If program was generated by a different WebGLRenderingContext than this one, generates an INVALID_OPERATION error. Returns null if any OpenGL errors are generated during the execution of this function.
Return the value for the passed pname given the passed program. The type returned is the natural type for the requested pname.
Returns the information log for a shader object.
Returns information about the given shader.
Return a new WebGLShaderPrecisionFormat describing the range and precision for the specified shader numeric format. The shadertype value can be FRAGMENT_SHADER or VERTEX_SHADER. The precisiontype value can be LOW_FLOAT, MEDIUM_FLOAT, HIGH_FLOAT, LOW_INT, MEDIUM_INT or HIGH_INT. Returns null if any OpenGL errors are generated during the execution of this function.
Returns a list of all the supported WebGL extensions.
Return a new WebGLUniformLocation that represents the location of a specific uniform variable within a program object. The return value is null if name does not correspond to an active uniform variable in the passed program.
Specifies hints for certain behaviors. The interpretation of these hints depend on the implementation.
Tests whether a specific WebGL capability is enabled or not for this context.
Sets the line width of rasterized lines.
Links a given WebGLProgram, completing the process of preparing the GPU code for the program's fragment and vertex shaders.
Specifies the pixel storage modes.
Specifies the scale factors and units to calculate depth values. The offset is added before the depth test is performed and before the value is written into the depth buffer.
Pixels in the current framebuffer are read back into an ArrayBufferView object. Fills pixels with the pixel data in the specified rectangle of the frame buffer. The data returned from readPixels must be up-to-date as of the most recently sent drawing command.
Specifies multi-sample coverage parameters for anti-aliasing effects.
Sets a scissor box, which limits the drawing to a specified rectangle.
Sets the source code of a WebGLShader.
Sets the front and back function and reference value for stencil testing.
Sets the front and/or back function and reference value for stencil testing.
Controls enabling and disabling of both the front and back writing of individual bits in the stencil planes.
controls enabling and disabling of front and/or back writing of individual bits in the stencil planes. The WebGLRenderingContext.stencilMask() method can set both, the front and back stencil writemasks to one value at the same time.
Sets both the front and back-facing stencil test actions.
Sets the front and/or back-facing stencil test actions.
Sets the specified WebGLProgram as part of the current rendering state.
Specify constant values for generic vertex attributes.
Sets the viewport, which specifies the affine transformation of x and y from normalized device coordinates to window coordinates.