import { Bindable } from './bindable'; import { Buffer } from './buffer'; import { Initializable } from './initializable'; import { Context } from './context'; import { VertexArray } from './vertexarray'; /** * Geometry that extends Initializable and Bindable by a draw method, a getter for buffers, as well as a getter for the * vertex array object. This is used as generic interface for one or more buffer objects associated to a single vertex * array object intended for drawing (often also referred to as 'drawable'). */ export declare abstract class Geometry extends Initializable implements Bindable { /** * Vertex array used for binding the rectangle's buffer(s). */ protected _vertexArray: VertexArray; /** * Various buffers required for this geometry (e.g., vertex buffer). */ protected _buffers: Buffer[]; /** * Creates the geometry and a vertex array instance. Please note that inheritors are expected to create the buffer. * @param context - Valid context to create the object for. * @param identifier - Meaningful name for identification of this instances VAO and VBOs. */ constructor(context: Context, identifier?: string); /** * Binds all buffer object(s) to their associated attribute binding points (pre-defined index/indices). This * function is passed to the initialization of this geometries vertex array object. * @param indices - Indices passed on geometry initialization by inheritor (sequence as in buffers). */ protected abstract bindBuffers(indices: Array): void; /** * Unbinds all buffer objects and disables their binding points. This function is passed to the uninitialization * of this geometries vertex array object. * @param indices - Indices passed on geometry initialization by inheritor (sequence as in buffers). */ protected abstract unbindBuffers(indices: Array): void; /** * Initializes all buffer objects and the vertex array. Please note that implicit arguments are used in order to * enable custom initialization signatures for inheritors. * @param targets - Targets to initialize the buffers for. * @param indices - Binding points that are passed to the inheritors (un)bind buffer methods. */ initialize(...args: Array): boolean; /** * Uninitialize the vertex array object and the rectangle. */ uninitialize(): void; /** * Binds the vertex array object. */ bind(): void; /** * Unbinds the vertex array object. */ unbind(): void; abstract draw(): void; /** * Read-only access to the buffer(s) associated to this instances vertex array object. */ get buffers(): Array; /** * Read-only access to the buffers' and vertex array's context. */ get context(): Context; /** * Read-only access to the vertex array. */ get vertexArray(): VertexArray; }