export declare function compileShader(gl: WebGL2RenderingContext, shaderSource: string, shaderType: WebGL2RenderingContext['FRAGMENT_SHADER'] | WebGL2RenderingContext['VERTEX_SHADER']): WebGLShader; export declare function uploadQuadBuffer(gl: WebGL2RenderingContext): WebGLBuffer; export declare function bindQuadBuffer(gl: WebGL2RenderingContext, program: WebGLProgram, quadBuffer: WebGLBuffer): void; export type GrowableBuffer = { buffer: WebGLBuffer; capacity: number; lastUploaded: ArrayBufferView | null; }; export declare function createGrowableBuffer(gl: WebGL2RenderingContext): GrowableBuffer; /** * Uploads `data` into `target.buffer`. Reuses the existing GPU allocation via * `bufferSubData` while the size fits, only re-allocating with `bufferData` when * the data grows past the previous high-water mark. Skips the upload entirely * when the same typed-array reference is passed twice in a row. */ export declare function uploadGrowableBuffer(gl: WebGL2RenderingContext, target: GrowableBuffer, data: ArrayBufferView): void; /** * Logs WebGL errors to the console in development mode. */ export declare function logWebGLErrors(gl: WebGL2RenderingContext): void; /** Enables the standard non-premultiplied src-alpha blending used by all premium WebGL renderers. */ export declare function setupStandardBlending(gl: WebGL2RenderingContext): void; /** * Returns `existing` when it's large enough to hold `length` elements, otherwise * allocates a fresh typed array via `Ctor`. Lets consumers keep one ref per * pool and short-circuit growth checks inline. */ export declare function ensurePool(existing: T | null | undefined, length: number, Ctor: new (length: number) => T): T; export interface LinkedProgram { program: WebGLProgram; /** The vertex + fragment shaders that were attached. Hold them so dispose() can delete them. */ shaders: WebGLShader[]; } /** * Compiles vertex + fragment shaders, attaches them, links the program, and returns * both the program and its shaders. Logs link/compile diagnostics in dev when linking fails. */ export declare function linkProgram(gl: WebGL2RenderingContext, vertexShaderSource: string, fragmentShaderSource: string): LinkedProgram;