twgl.js 4.22.1 → 4.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/4.x/twgl-full.d.ts +5 -10
- package/dist/4.x/twgl-full.js +358 -60
- package/dist/4.x/twgl-full.module.js +271 -65
- package/dist/4.x/twgl.d.ts +4 -10
- package/dist/4.x/twgl.js +347 -60
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
TWGL: A Tiny WebGL helper Library<div id="pronounce" style="font-size: xx-small;">[rhymes with wiggle]</div>
|
|
2
2
|
=====================================================
|
|
3
3
|
|
|
4
|
-
[](https://github.com/greggman/twgl.js/actions/workflows/test.yml)
|
|
5
5
|
|
|
6
6
|
This library's sole purpose is to make using the WebGL API less verbose.
|
|
7
7
|
|
package/dist/4.x/twgl-full.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export type Defaults = {
|
|
|
7
7
|
};
|
|
8
8
|
export function setDefaults(newDefaults: Defaults): void;
|
|
9
9
|
export function addExtensionsToContext(gl: WebGLRenderingContext): void;
|
|
10
|
-
export function getWebGLContext(canvas: HTMLCanvasElement, opt_attribs?: WebGLContextAttributes): WebGLRenderingContext;
|
|
11
10
|
export function createContext(canvas: HTMLCanvasElement): WebGLRenderingContext;
|
|
12
11
|
export function getContext(canvas: HTMLCanvasElement, opt_attribs?: WebGLContextAttributes): WebGLRenderingContext;
|
|
13
12
|
export function resizeCanvasToDisplaySize(canvas: HTMLCanvasElement, multiplier?: number): boolean;
|
|
@@ -89,6 +88,7 @@ export type ProgramOptions = {
|
|
|
89
88
|
[key: string]: AttribInfo;
|
|
90
89
|
} | string[];
|
|
91
90
|
transformFeedbackMode?: number;
|
|
91
|
+
callback?: ProgramCallback;
|
|
92
92
|
};
|
|
93
93
|
export type TransformFeedbackInfo = {
|
|
94
94
|
index: number;
|
|
@@ -255,8 +255,10 @@ export function resizeFramebufferInfo(gl: WebGLRenderingContext, framebufferInfo
|
|
|
255
255
|
export function bindFramebufferInfo(gl: WebGLRenderingContext, framebufferInfo?: FramebufferInfo | null, target?: number): void;
|
|
256
256
|
|
|
257
257
|
|
|
258
|
-
export
|
|
258
|
+
export type ProgramCallback = (err?: string, result?: WebGLProgram | ProgramInfo) => void;
|
|
259
259
|
export function createProgram(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
|
|
260
|
+
export function createProgramAsync(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<WebGLProgram>;
|
|
261
|
+
export function createProgramInfoAsync(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<ProgramInfo>;
|
|
260
262
|
export function createProgramFromScripts(gl: WebGLRenderingContext, shaderScriptIds: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
|
|
261
263
|
export function createProgramFromSources(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
|
|
262
264
|
export function createUniformSetters(gl: WebGLRenderingContext, program: WebGLProgram): {
|
|
@@ -283,11 +285,6 @@ export function setUniformsAndBindTextures(setters: ProgramInfo | {
|
|
|
283
285
|
export function createAttributeSetters(gl: WebGLRenderingContext, program: WebGLProgram): {
|
|
284
286
|
[key: string]: (...params: any[]) => any;
|
|
285
287
|
};
|
|
286
|
-
export function setAttributes(setters: {
|
|
287
|
-
[key: string]: (...params: any[]) => any;
|
|
288
|
-
}, buffers: {
|
|
289
|
-
[key: string]: AttribInfo;
|
|
290
|
-
}): void;
|
|
291
288
|
export function setBuffersAndAttributes(gl: WebGLRenderingContext, setters: ProgramInfo | {
|
|
292
289
|
[key: string]: (...params: any[]) => any;
|
|
293
290
|
}, buffers: BufferInfo | VertexArrayInfo): void;
|
|
@@ -309,10 +306,7 @@ export function setTextureParameters(gl: WebGLRenderingContext, tex: WebGLTextur
|
|
|
309
306
|
export function setSamplerParameters(gl: WebGLRenderingContext, sampler: WebGLSampler, options: TextureOptions): void;
|
|
310
307
|
export function setTextureFilteringForSize(gl: WebGLRenderingContext, tex: WebGLTexture, options?: TextureOptions, width?: number, height?: number, internalFormat?: number): void;
|
|
311
308
|
export function setTextureFromElement(gl: WebGLRenderingContext, tex: WebGLTexture, element: HTMLElement, options?: TextureOptions): void;
|
|
312
|
-
export function setTextureTo1PixelColor(gl: WebGLRenderingContext, tex: WebGLTexture, options?: TextureOptions): void;
|
|
313
309
|
export function loadTextureFromUrl(gl: WebGLRenderingContext, tex: WebGLTexture, options?: TextureOptions, callback?: TextureReadyCallback): HTMLImageElement;
|
|
314
|
-
export function loadCubemapFromUrls(gl: WebGLRenderingContext, tex: WebGLTexture, options: TextureOptions, callback?: CubemapReadyCallback): void;
|
|
315
|
-
export function loadSlicesFromUrls(gl: WebGLRenderingContext, tex: WebGLTexture, options: TextureOptions, callback?: ThreeDReadyCallback): void;
|
|
316
310
|
export function setTextureFromArray(gl: WebGLRenderingContext, tex: WebGLTexture, src: number[] | ArrayBufferView, options?: TextureOptions): void;
|
|
317
311
|
export function setEmptyTexture(gl: WebGLRenderingContext, tex: WebGLTexture, options: TextureOptions): void;
|
|
318
312
|
export function createTexture(gl: WebGLRenderingContext, options?: TextureOptions, callback?: TextureReadyCallback): WebGLTexture;
|
|
@@ -367,6 +361,7 @@ declare module m4 {
|
|
|
367
361
|
export type Mat4 = number[] | Float32Array;
|
|
368
362
|
export function setDefaultType(ctor: Function): Function;
|
|
369
363
|
export function negate(m: m4.Mat4, dst?: m4.Mat4): m4.Mat4;
|
|
364
|
+
export function create(): m4.Mat4;
|
|
370
365
|
export function copy(m: m4.Mat4, dst?: m4.Mat4): m4.Mat4;
|
|
371
366
|
export function identity(dst?: m4.Mat4): m4.Mat4;
|
|
372
367
|
export function transpose(m: m4.Mat4, dst?: m4.Mat4): m4.Mat4;
|