import { Context } from './context'; export type TexImage2DData = GLintptr | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | ImageData | ArrayBufferView | undefined; export type TexImage3DData = GLintptr | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | ImageData | ArrayBufferView | undefined; /** * A WebGL 2 facade, simplifying the access to gl functions that are either not available, exposed via extension or * supported directly, e.g., in webgl2. All gl features/interfaces handled by this facade are mandatory. */ export declare class GL2Facade { /** * @param context - Wrapped gl context for function resolution. */ constructor(context: Context); /** * Stores the HALF_FLOAT enum if supported. @see {@link HALF_FLOAT} */ protected _halfFloat: GLenum; /** * The HALF_FLOAT format enum. Is `undefined` if not supported. */ get HALF_FLOAT(): GLenum; /** * For WebGL1 the HALF_FLOAT enum needs to be saved via the extension object. */ protected queryHalfFloatSupport(context: Context): void; /** * Stores the lowest color attachment identifier. */ protected _colorAttachmentMin: GLenum; /** * The lowest color attachment identifier format enum. */ get COLOR_ATTACHMENT_MIN(): GLenum; /** * Stores the highest supported color attachment identifier. */ protected _colorAttachmentMax: GLenum; /** * Stores all context/backend sepcific color attachment identifier for COLOR_ATTACHMENT# getter. */ protected _colorAttachments: Array; /** * The lowest color attachment identifier format enum. * Is at least `COLOR_ATTACHMENT_MIN`. */ get COLOR_ATTACHMENT_MAX(): GLenum; get COLOR_ATTACHMENT0(): GLenum; get COLOR_ATTACHMENT1(): GLenum; get COLOR_ATTACHMENT2(): GLenum; get COLOR_ATTACHMENT3(): GLenum; get COLOR_ATTACHMENT4(): GLenum; get COLOR_ATTACHMENT5(): GLenum; get COLOR_ATTACHMENT6(): GLenum; get COLOR_ATTACHMENT7(): GLenum; get COLOR_ATTACHMENT8(): GLenum; get COLOR_ATTACHMENT9(): GLenum; get COLOR_ATTACHMENT10(): GLenum; get COLOR_ATTACHMENT11(): GLenum; get COLOR_ATTACHMENT12(): GLenum; get COLOR_ATTACHMENT13(): GLenum; get COLOR_ATTACHMENT14(): GLenum; get COLOR_ATTACHMENT15(): GLenum; /** * Queries the valid range of color attachments and provides an interface for convenience. */ protected queryColorAttachments(context: Context): void; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE */ drawArraysInstanced: (mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) => void; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/drawElementsInstancedANGLE */ drawElementsInstanced: (mode: GLenum, count: GLint, type: GLsizei, offset: GLintptr, primcount: GLsizei) => void; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/vertexAttribDivisorANGLE */ vertexAttribDivisor: (index: GLuint, divisor: GLuint) => void; /** * Evaluate whether or not ANGLE_instanced_arrays is supported (either by extension or in WebGL2 by default) and, if * supported, binds the associated functions. * @param context - WebGL context to query extension support in */ protected queryInstancedArraySupport(context: Context): void; /** * Stores the MAX_DRAW_BUFFERS enum if supported. @see {@link MAX_DRAW_BUFFERS} */ protected _maxDrawBuffers: GLenum; /** * The MAX_DRAW_BUFFERS format enum. Is `undefined` if not supported. */ get MAX_DRAW_BUFFERS(): GLenum; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_draw_buffers/drawBuffersWEBGL */ drawBuffers: ((buffers: Array) => void) | undefined; /** * Evaluate whether or not WEBGL_draw_buffers is supported (either by extension or in WebGL2 by default) and, if * supported, binds the associated functions. * @param context - WebGL context to query extension support in. */ protected queryDrawBuffersSupport(context: Context): void; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/createVertexArray */ createVertexArray: () => any; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/createVertexArray */ deleteVertexArray: (arrayObject: any) => void; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/isVertexArray */ isVertexArray: (arrayObject: any) => GLboolean; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bindVertexArray */ bindVertexArray: (arrayObject: any) => void; protected queryVertexArrayObjectSupport(context: Context): void; /** @see {@link maxUniformVec3Components} */ protected _maxUniformVec3Components: GLint | undefined; /** * The maximum number of floats, integers, or booleans that can be in storage for a vertex shader. */ get maxUniformVec3Components(): GLint | undefined; /** * Query and store the maximum number of floats, integers, or booleans that can be in storage for a vertex shader. * @param context - WebGL context to query the value in. */ protected queryMaxUniformVec3Components(context: Context): void; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferSubData */ bufferSubData: (target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView | ArrayBuffer, srcOffset: GLuint, length: GLuint) => void; protected queryBufferSubDataInterface(context: Context): void; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D */ texImage2D: (target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source?: TexImage2DData, offset?: GLintptr) => void; /** * @link https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D */ texImage3D: (target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source?: TexImage3DData, offset?: GLintptr) => void; protected queryTexImageInterface(context: Context): void; }