import { GLBuffer } from './GLBuffer'; import { GLAttribute } from './shader/GLAttribute'; export interface Attribute { buffer: GLBuffer; attribute: GLAttribute; size: number; type: number; normalized: boolean; stride: number; offset: number; initialize: boolean; } export declare class GLVertexArrayObject { private gl; private vao; private attributes; private indexBuffer; private dirty; constructor(gl: WebGL2RenderingContext); /** * Binds the VAO, if its dirty it will initialize the attributes for the data */ bind(): GLVertexArrayObject; /** * Activates the vao, * binds the data and applies the Attributes */ protected activate(): this; /** * Deactivates the non native VertexArrayObject */ protected deactivate(): this; /** * Unbind the VAO */ unbind(force?: boolean): this; addAttribute(buffer: GLBuffer, attribute: GLAttribute, size: number, type: number, normalized: boolean, stride: number, offset: number, initialize?: boolean): GLVertexArrayObject; setIndexBuffer(buffer: GLBuffer): GLVertexArrayObject; draw(mode: number, size: number, type: number, offset: number): GLVertexArrayObject; /** * Removes all attributes from this vao * and deactivates the GLAttributes */ clear(): void; /** * Clears the buffer the removes all references * making it free for gc */ destroy(): void; static setVertexAttribArrays(gl: WebGL2RenderingContext, attributes: Array, unbind?: boolean): void; static setVertexAttribArray(gl: WebGL2RenderingContext, attribute: Attribute, unbind?: boolean): void; }