UNPKG

webgl-gltf

Version:
27 lines (26 loc) 712 B
import { Model } from './types/model'; declare type GLContext = WebGLRenderingContext | WebGL2RenderingContext; export interface Buffer { data: Float32Array | Int16Array; size: number; type: string; componentType: BufferType; glBuffer: WebGLBuffer; } export declare enum BufferType { Float = 5126, Short = 5123 } /** * Loads a GLTF model and its assets * @param gl Web GL context * @param uri URI to model */ declare const loadModel: (gl: GLContext, uri: string) => Promise<Model>; /** * Deletes GL buffers and textures * @param gl Web GL context * @param model Model to dispose */ declare const dispose: (gl: GLContext, model: Model) => void; export { loadModel, dispose, };