xl-pano
Version:
一个基于 Typescript 的,同时支持立方体和球体场景的轻量开源库。
17 lines (16 loc) • 837 B
TypeScript
import { WebGLRenderingContextWithProgram } from "../types/index";
/**
* 把 TypedArray 传递给顶点着色器
* @param {WebGLRenderingContextWithProgram} gl WebGL 上下文
* @param {Float32Array} data 传递进着色器的数据
* @param {number} size 指定从 data 中给每个顶点取数据时取几个,vertexAttribPointer 函数用的
* @param {GLenum} type 数据类型,指明 WebGL 程序取数据时的内存长度
* @param {string} attribute 着色器中定义的变量名
* */
export declare function initArrayBuffer(gl: WebGLRenderingContextWithProgram, data: Float32Array, size: number, type: GLenum, attribute: string): void;
/**
* 加载图片
* @param {string} src 图片地址
* @return Promise<TexImageSource> 图像资源
* */
export declare function loadImage(src: string): Promise<TexImageSource>;