UNPKG

@tolokoban/tgd

Version:

ToloGameDev library for WebGL2

38 lines 1.67 kB
import { WebglMagFilter, WebglMinFilter, WebglWrap } from "../../types"; import { WebglTextureFormat, WebglTextureInternalFormat, WebglTextureType } from "./types"; export interface WebglTextureParameters { wrapS?: WebglWrap; wrapT?: WebglWrap; wrapR?: WebglWrap; minFilter?: WebglMinFilter; magFilter?: WebglMagFilter; } export interface WebglTexture2DCreateFromArrayOptions extends WebglTextureParameters { width: number; height: number; /** Mipmap level */ level?: number; /** Offset to apply on the `data` to skip the beginning */ offset?: number; /** /what unit to store the texture in */ unit?: number; /** * Should we flip the texture vertically when storing it? * * By default the UV coordinates are (0,0) at the bottom/left * and (1,1) at the top/right. */ flipY?: boolean; /** Format into which WebGL will convert the texture */ internalFormat?: WebglTextureInternalFormat; /** Format of the source */ format?: WebglTextureFormat; type?: WebglTextureType; } export declare function webglTextureCreate(gl: WebGL2RenderingContext): WebGLTexture; /** * This is applied to the last binded texture. */ export declare function webglTextureParametersSet(gl: WebGL2RenderingContext, { wrapS, wrapT, wrapR, minFilter, magFilter }: WebglTextureParameters): void; export declare function webglTextureCreate2DFromArray(gl: WebGL2RenderingContext, data: Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array, options: WebglTexture2DCreateFromArrayOptions): WebGLTexture; //# sourceMappingURL=texture2d.d.ts.map