Skip to content

Commit 25f6e51

Browse files
committed
build
1 parent 9ccb1c8 commit 25f6e51

28 files changed

+1096
-30
lines changed

dist/6.x/twgl-full.d.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,24 @@ export type CubemapReadyCallback = (err: any, tex: WebGLTexture, imgs: HTMLImage
840840
* @memberOf module:twgl
841841
*/
842842
export type ThreeDReadyCallback = (err: any, tex: WebGLTexture, imgs: HTMLImageElement[]) => void;
843+
/**
844+
* Value returned by createTextureAsync
845+
*
846+
* @typedef {Object} CreateTextureInfo
847+
* @param {WebGLTexture} texture the texture.
848+
* @param {TextureSrc} source image(s) used to as the src for the texture
849+
* @memberOf module:twgl
850+
*/
851+
export type CreateTextureInfo = any;
852+
/**
853+
* Value returned by createTextureAsync
854+
*
855+
* @typedef {Object} CreateTexturesInfo
856+
* @param {Object.<string, WebGLTexture>} textures the created textures by name. Same as returned by {@link createTextures}.
857+
* @param {Object.<string, TextureSrc>} sources the image(s) used for the texture by name.
858+
* @memberOf module:twgl
859+
*/
860+
export type CreateTexturesInfo = any;
843861
/**
844862
* Check if context is WebGL 2.0
845863
* @param {WebGLRenderingContext} gl A WebGLRenderingContext
@@ -3028,6 +3046,22 @@ export function setEmptyTexture(gl: WebGLRenderingContext, tex: WebGLTexture, op
30283046
* @memberOf module:twgl/textures
30293047
*/
30303048
export function createTexture(gl: WebGLRenderingContext, options?: TextureOptions, callback?: TextureReadyCallback): WebGLTexture;
3049+
/**
3050+
* Creates a texture based on the options passed in.
3051+
*
3052+
* see {@link createTexture}.
3053+
* The only difference is this function returns a promise
3054+
* where as the other returns a texture and takes a callback.
3055+
*
3056+
* Note: this is here for completeness. It is probably better to use
3057+
* the non-async version as it returns a usable texture immediately
3058+
* where as this one you have to wait for it to load.
3059+
*
3060+
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
3061+
* @param {TextureOptions} [options] A TextureOptions object with whatever parameters you want set.
3062+
* @return {Promise<CreateTextureInfo>} The created texture and source.
3063+
*/
3064+
export function createTextureAsync(gl: WebGLRenderingContext, options?: TextureOptions): Promise<CreateTextureInfo>;
30313065
/**
30323066
* Resizes a texture based on the options passed in.
30333067
*
@@ -3126,6 +3160,24 @@ export function createTextures(gl: WebGLRenderingContext, options: {
31263160
}, callback?: TexturesReadyCallback): {
31273161
[key: string]: WebGLTexture;
31283162
};
3163+
/**
3164+
* Creates textures based on the options passed in.
3165+
*
3166+
* see {@link createTextures}.
3167+
* The only difference is this function returns a promise
3168+
* where as the other returns a texture and takes a callback.
3169+
*
3170+
* Note: this is here for completeness. It is probably better to use
3171+
* the non-async version as it returns usable textures immediately
3172+
* where as this one you have to wait for them to load.
3173+
*
3174+
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
3175+
* @param {Object.<string,TextureOptions>} options A object of TextureOptions one per texture.
3176+
* @return {Promise<CreateTexturesInfo>} The created textures and sources.
3177+
*/
3178+
export function createTexturesAsync(gl: WebGLRenderingContext, options: {
3179+
[key: string]: TextureOptions;
3180+
}): Promise<CreateTexturesInfo>;
31293181

31303182

31313183
/**

dist/6.x/twgl-full.js

Lines changed: 66 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/6.x/twgl-full.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/6.x/twgl-full.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/6.x/twgl-full.module.js

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @license twgl.js 6.0.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
1+
/* @license twgl.js 6.1.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
22
Available via the MIT license.
33
see: http://github.com/greggman/twgl.js for details */
44
/*
@@ -6684,6 +6684,30 @@ function createTexture(gl, options, callback) {
66846684
return tex;
66856685
}
66866686

6687+
/**
6688+
* Value returned by createTextureAsync
6689+
*
6690+
* @typedef {Object} CreateTextureInfo
6691+
* @param {WebGLTexture} texture the texture.
6692+
* @param {module:twgl.TextureSrc} source image(s) used to as the src for the texture
6693+
* @memberOf module:twgl
6694+
*/
6695+
6696+
/**
6697+
* Creates a texture based on the options passed in.
6698+
*
6699+
* see {@link module:twgl/textures.createTexture}.
6700+
* The only difference is this function returns a promise
6701+
* where as the other returns a texture and takes a callback.
6702+
*
6703+
* Note: this is here for completeness. It is probably better to use
6704+
* the non-async version as it returns a usable texture immediately
6705+
* where as this one you have to wait for it to load.
6706+
*
6707+
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
6708+
* @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set.
6709+
* @return {Promise<CreateTextureInfo>} The created texture and source.
6710+
*/
66876711
function createTextureAsync(gl, options) {
66886712
return new Promise((resolve, reject) => {
66896713
createTexture(gl, options, (err, texture, source) => {
@@ -6872,6 +6896,42 @@ function createTextures(gl, textureOptions, callback) {
68726896
return textures;
68736897
}
68746898

6899+
/**
6900+
* Value returned by createTextureAsync
6901+
*
6902+
* @typedef {Object} CreateTexturesInfo
6903+
* @param {Object.<string, WebGLTexture>} textures the created textures by name. Same as returned by {@link module:twgl.createTextures}.
6904+
* @param {Object.<string, module:twgl.TextureSrc>} sources the image(s) used for the texture by name.
6905+
* @memberOf module:twgl
6906+
*/
6907+
6908+
/**
6909+
* Creates textures based on the options passed in.
6910+
*
6911+
* see {@link module:twgl/textures.createTextures}.
6912+
* The only difference is this function returns a promise
6913+
* where as the other returns a texture and takes a callback.
6914+
*
6915+
* Note: this is here for completeness. It is probably better to use
6916+
* the non-async version as it returns usable textures immediately
6917+
* where as this one you have to wait for them to load.
6918+
*
6919+
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
6920+
* @param {Object.<string,module:twgl.TextureOptions>} options A object of TextureOptions one per texture.
6921+
* @return {Promise<CreateTexturesInfo>} The created textures and sources.
6922+
*/
6923+
function createTexturesAsync(gl, options) {
6924+
return new Promise((resolve, reject) => {
6925+
createTexture(gl, options, (err, textures, sources) => {
6926+
if (err) {
6927+
reject(err);
6928+
} else {
6929+
resolve({ textures, sources });
6930+
}
6931+
});
6932+
});
6933+
}
6934+
68756935
var textures = /*#__PURE__*/Object.freeze({
68766936
__proto__: null,
68776937
setTextureDefaults_: setDefaults$1,
@@ -6888,6 +6948,7 @@ var textures = /*#__PURE__*/Object.freeze({
68886948
setTextureParameters: setTextureParameters,
68896949
setDefaultTextureColor: setDefaultTextureColor,
68906950
createTextures: createTextures,
6951+
createTexturesAsync: createTexturesAsync,
68916952
resizeTexture: resizeTexture,
68926953
canGenerateMipmap: canGenerateMipmap,
68936954
canFilter: canFilter,
@@ -10198,4 +10259,4 @@ function resizeCanvasToDisplaySize(canvas, multiplier) {
1019810259
return false;
1019910260
}
1020010261

10201-
export { addExtensionsToContext, attributes, bindFramebufferInfo, bindTransformFeedbackInfo, bindUniformBlock, canFilter, canGenerateMipmap, createAttribsFromArrays, createAttributeSetters, createBufferFromArray, createBufferFromTypedArray, createBufferInfoFromArrays, createBuffersFromArrays, createFramebufferInfo, createProgram, createProgramAsync, createProgramFromScripts, createProgramFromSources, createProgramInfo, createProgramInfoAsync, createProgramInfoFromProgram, createProgramInfos, createProgramInfosAsync, createPrograms, createProgramsAsync, createSampler, createSamplers, createTexture, createTextureAsync, createTextures, createTransformFeedback, createTransformFeedbackInfo, createUniformBlockInfo, createUniformBlockInfoFromProgram, createUniformBlockSpecFromProgram, createUniformSetters, createVAOAndSetAttributes, createVAOFromBufferInfo, createVertexArrayInfo, draw, drawBufferInfo, drawObjectList, framebuffers, getArray$1 as getArray_, getBytesPerElementForInternalFormat, getContext, getFormatAndTypeForInternalFormat, getGLTypeForTypedArray, getGLTypeForTypedArrayType, getNumComponentsForFormat, getNumComponents$1 as getNumComponents_, getTypedArrayTypeForGLType, getWebGLContext, glEnumToString, isArrayBuffer$1 as isArrayBuffer, isWebGL1, isWebGL2, loadTextureFromUrl, m4, primitives, programs, resizeCanvasToDisplaySize, resizeFramebufferInfo, resizeTexture, setAttribInfoBufferFromArray, setDefaults$2 as setAttributeDefaults_, setAttributePrefix, setAttributes, setBlockUniforms, setBuffersAndAttributes, setDefaultTextureColor, setDefaults, setEmptyTexture, setSamplerParameters, setDefaults$1 as setTextureDefaults_, setTextureFilteringForSize, setTextureFromArray, setTextureFromElement, setTextureParameters, setUniformBlock, setUniforms, setUniformsAndBindTextures, textures, typedarrays, utils, v3, vertexArrays };
10262+
export { addExtensionsToContext, attributes, bindFramebufferInfo, bindTransformFeedbackInfo, bindUniformBlock, canFilter, canGenerateMipmap, createAttribsFromArrays, createAttributeSetters, createBufferFromArray, createBufferFromTypedArray, createBufferInfoFromArrays, createBuffersFromArrays, createFramebufferInfo, createProgram, createProgramAsync, createProgramFromScripts, createProgramFromSources, createProgramInfo, createProgramInfoAsync, createProgramInfoFromProgram, createProgramInfos, createProgramInfosAsync, createPrograms, createProgramsAsync, createSampler, createSamplers, createTexture, createTextureAsync, createTextures, createTexturesAsync, createTransformFeedback, createTransformFeedbackInfo, createUniformBlockInfo, createUniformBlockInfoFromProgram, createUniformBlockSpecFromProgram, createUniformSetters, createVAOAndSetAttributes, createVAOFromBufferInfo, createVertexArrayInfo, draw, drawBufferInfo, drawObjectList, framebuffers, getArray$1 as getArray_, getBytesPerElementForInternalFormat, getContext, getFormatAndTypeForInternalFormat, getGLTypeForTypedArray, getGLTypeForTypedArrayType, getNumComponentsForFormat, getNumComponents$1 as getNumComponents_, getTypedArrayTypeForGLType, getWebGLContext, glEnumToString, isArrayBuffer$1 as isArrayBuffer, isWebGL1, isWebGL2, loadTextureFromUrl, m4, primitives, programs, resizeCanvasToDisplaySize, resizeFramebufferInfo, resizeTexture, setAttribInfoBufferFromArray, setDefaults$2 as setAttributeDefaults_, setAttributePrefix, setAttributes, setBlockUniforms, setBuffersAndAttributes, setDefaultTextureColor, setDefaults, setEmptyTexture, setSamplerParameters, setDefaults$1 as setTextureDefaults_, setTextureFilteringForSize, setTextureFromArray, setTextureFromElement, setTextureParameters, setUniformBlock, setUniforms, setUniformsAndBindTextures, textures, typedarrays, utils, v3, vertexArrays };

dist/6.x/twgl.d.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,24 @@ export type CubemapReadyCallback = (err: any, tex: WebGLTexture, imgs: HTMLImage
840840
* @memberOf module:twgl
841841
*/
842842
export type ThreeDReadyCallback = (err: any, tex: WebGLTexture, imgs: HTMLImageElement[]) => void;
843+
/**
844+
* Value returned by createTextureAsync
845+
*
846+
* @typedef {Object} CreateTextureInfo
847+
* @param {WebGLTexture} texture the texture.
848+
* @param {TextureSrc} source image(s) used to as the src for the texture
849+
* @memberOf module:twgl
850+
*/
851+
export type CreateTextureInfo = any;
852+
/**
853+
* Value returned by createTextureAsync
854+
*
855+
* @typedef {Object} CreateTexturesInfo
856+
* @param {Object.<string, WebGLTexture>} textures the created textures by name. Same as returned by {@link createTextures}.
857+
* @param {Object.<string, TextureSrc>} sources the image(s) used for the texture by name.
858+
* @memberOf module:twgl
859+
*/
860+
export type CreateTexturesInfo = any;
843861
/**
844862
* Check if context is WebGL 2.0
845863
* @param {WebGLRenderingContext} gl A WebGLRenderingContext
@@ -3028,6 +3046,22 @@ export function setEmptyTexture(gl: WebGLRenderingContext, tex: WebGLTexture, op
30283046
* @memberOf module:twgl/textures
30293047
*/
30303048
export function createTexture(gl: WebGLRenderingContext, options?: TextureOptions, callback?: TextureReadyCallback): WebGLTexture;
3049+
/**
3050+
* Creates a texture based on the options passed in.
3051+
*
3052+
* see {@link createTexture}.
3053+
* The only difference is this function returns a promise
3054+
* where as the other returns a texture and takes a callback.
3055+
*
3056+
* Note: this is here for completeness. It is probably better to use
3057+
* the non-async version as it returns a usable texture immediately
3058+
* where as this one you have to wait for it to load.
3059+
*
3060+
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
3061+
* @param {TextureOptions} [options] A TextureOptions object with whatever parameters you want set.
3062+
* @return {Promise<CreateTextureInfo>} The created texture and source.
3063+
*/
3064+
export function createTextureAsync(gl: WebGLRenderingContext, options?: TextureOptions): Promise<CreateTextureInfo>;
30313065
/**
30323066
* Resizes a texture based on the options passed in.
30333067
*
@@ -3126,6 +3160,24 @@ export function createTextures(gl: WebGLRenderingContext, options: {
31263160
}, callback?: TexturesReadyCallback): {
31273161
[key: string]: WebGLTexture;
31283162
};
3163+
/**
3164+
* Creates textures based on the options passed in.
3165+
*
3166+
* see {@link createTextures}.
3167+
* The only difference is this function returns a promise
3168+
* where as the other returns a texture and takes a callback.
3169+
*
3170+
* Note: this is here for completeness. It is probably better to use
3171+
* the non-async version as it returns usable textures immediately
3172+
* where as this one you have to wait for them to load.
3173+
*
3174+
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
3175+
* @param {Object.<string,TextureOptions>} options A object of TextureOptions one per texture.
3176+
* @return {Promise<CreateTexturesInfo>} The created textures and sources.
3177+
*/
3178+
export function createTexturesAsync(gl: WebGLRenderingContext, options: {
3179+
[key: string]: TextureOptions;
3180+
}): Promise<CreateTexturesInfo>;
31293181

31303182

31313183
/**

0 commit comments

Comments
 (0)