import { GLTexture } from './GLTexture'; import { GLCubemap } from './GLCubemap'; export declare class GLFramebuffer { private readonly drawBuffers; private gl; private width; private height; private framebuffer; private renderbuffer; private _textures; constructor(gl: WebGL2RenderingContext, width?: number, height?: number); checkStatus(): boolean; /** * Creates a frame buffer with a texture containing the given data * * @static * @param {WebGL2RenderingContext} gl - The current WebGL rendering context * @param {number} width - the width of the drawing area of the frame buffer * @param {number} height - the height of the drawing area of the frame buffer * @param {number} textureID - texture target * @param {number} attachment - COLOR_ATTACHMENT * @param {number} internalformat * @param {number} format * @param {number} type * @return {GLFramebuffer} The new framebuffer. */ static createRGBA(gl: WebGL2RenderingContext, width: number, height: number, textureID?: number, attachment?: number, internalformat?: number, format?: number, type?: number): GLFramebuffer; /** * Creates a frame buffer with a texture containing the given data * * @static * @param {WebGL2RenderingContext} gl - The current WebGL rendering context * @param {number} width - the width of the drawing area of the frame buffer * @param {number} height - the height of the drawing area of the frame buffer * @param {ArrayBuffer|SharedArrayBuffer|ArrayBufferView} data - an array of data * @param {number} textureID - texture target * @param {number} attachment - COLOR_ATTACHMENT * @param {number} internalformat * @param {number} format * @param {number} type * @return {GLFramebuffer} The new framebuffer. */ static createFloat32(gl: WebGL2RenderingContext, width: number, height: number, data: any, textureID?: number, attachment?: number, internalformat?: number, format?: number, type?: number): GLFramebuffer; /** * Adds a texture to the framebuffer. * @param {GLTexture} texture - the texture to add. * @param {Number} attachment - COLOR_ATTACHMENT * @param {Number} face if used for 3d Textures * @param {Boolean} setDrawBuffer - adds the attachment to the drawBuffer */ addTargetTexture(texture?: GLTexture | GLCubemap, attachment?: number, face?: number, setDrawBuffer?: boolean): GLFramebuffer; setDrawBuffer(drawBuffers?: Array): void; /** * Initialises the stencil buffer */ createRenderbuffer(): GLFramebuffer; /** * Erases the drawing area and fills it with a colour * * @param {number} r - the red value of the clearing colour * @param {number} g - the green value of the clearing colour * @param {number} b - the blue value of the clearing colour * @param {number} a - the alpha value of the clearing colour * @param {boolean} depthBuffer - clear DepthBuffer default: false * @param {boolean} stencilBuffer - clear StencilBuffer default: false */ clear(r?: number, g?: number, b?: number, a?: number, depthBuffer?: boolean, stencilBuffer?: boolean): GLFramebuffer; /** * Binds the frame buffer to the WebGL context */ bind(target?: number): GLFramebuffer; /** * Unbinds the frame buffer to the WebGL context */ unbind(target?: number): GLFramebuffer; /** * Resizes the drawing area of the buffer to the given width and height * * @param {number} width - the new width * @param {number} height - the new height */ resize(width: number, height: number): GLFramebuffer; /** * Destroys this buffer */ destroy(): void; getTexture(idx?: number): GLTexture | GLCubemap; setTexture(value: GLTexture | GLCubemap, idx?: number): void; texture: GLTexture | GLCubemap; textures: Array; }