import { GLsizei2 } from './tuples'; import { Bindable } from './bindable'; import { AbstractObject } from './object'; /** * WebGL Renderbuffer implementation providing size accessors and requiring for bind, unbind, resize, validity, and * initialization implementations. * ``` * @todo add usage example * ``` */ export declare class Renderbuffer extends AbstractObject implements Bindable { /** * Default renderbuffer, e.g., used for unbind. */ static readonly DEFAULT_RENDER_BUFFER: undefined; /** @see {@link width} */ protected _width: GLsizei; /** @see {@link height} */ protected _height: GLsizei; /** * Cached internal format of the renderbuffer for efficient resize. */ protected _internalFormat: GLenum | undefined; /** * Cached sample count for multisampling. */ protected _samples: GLsizei; /** * Create a renderbuffer object on the GPU. * @param width - Initial width of the renderbuffer. * @param height - Initial height of the renderbuffer. * @param internalFormat - Internal format of the renderbuffer data. */ protected create(width: GLsizei, height: GLsizei, internalFormat: GLenum, samples?: number): WebGLRenderbuffer | undefined; /** * Delete the renderbuffer object on the GPU. This should have the reverse effect of `create`. */ protected delete(): void; /** * Bind the renderbuffer object. */ bind(): void; /** * Unbind the renderbuffer object. */ unbind(): void; /** * This should be used to implement efficient resize for all attachments. * @param width - Targeted/new width of the renderbuffer in px. * @param height - Targeted/new height of the renderbuffer in px. * @param bind - Allows to skip binding the renderbuffer (e.g., when binding is handled outside). * @param unbind - Allows to skip unbinding the renderbuffer (e.g., when binding is handled outside). */ resize(width: GLsizei, height: GLsizei, bind?: boolean, unbind?: boolean): void; /** * Returns the number of bytes this object approximately allocates on the GPU. */ get bytes(): GLsizei; /** * Readonly access to the internal format of the renderbuffer object. This can only be changed by re-initialization. */ get internalFormat(): GLenum; /** * Convenience accessor: returns the width of the texture object. */ get width(): GLsizei; /** * Convenience accessor: returns the height of the texture object. */ get height(): GLsizei; /** * Convenience accessor: sample count for multisampling. */ get samples(): GLsizei; /** * Convenience accessor: if multisampling is enabled. */ get multisampling(): boolean; /** * Convenience getter for the 2-tuple containing the render buffer's width and height. * @see {@link width} * @see {@link heigth} */ get size(): GLsizei2; }