Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Sep 8, 2024
1 parent 9ccb1c8 commit 25f6e51
Show file tree
Hide file tree
Showing 28 changed files with 1,096 additions and 30 deletions.
52 changes: 52 additions & 0 deletions dist/6.x/twgl-full.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,24 @@ export type CubemapReadyCallback = (err: any, tex: WebGLTexture, imgs: HTMLImage
* @memberOf module:twgl
*/
export type ThreeDReadyCallback = (err: any, tex: WebGLTexture, imgs: HTMLImageElement[]) => void;
/**
* Value returned by createTextureAsync
*
* @typedef {Object} CreateTextureInfo
* @param {WebGLTexture} texture the texture.
* @param {TextureSrc} source image(s) used to as the src for the texture
* @memberOf module:twgl
*/
export type CreateTextureInfo = any;
/**
* Value returned by createTextureAsync
*
* @typedef {Object} CreateTexturesInfo
* @param {Object.<string, WebGLTexture>} textures the created textures by name. Same as returned by {@link createTextures}.
* @param {Object.<string, TextureSrc>} sources the image(s) used for the texture by name.
* @memberOf module:twgl
*/
export type CreateTexturesInfo = any;
/**
* Check if context is WebGL 2.0
* @param {WebGLRenderingContext} gl A WebGLRenderingContext
Expand Down Expand Up @@ -3028,6 +3046,22 @@ export function setEmptyTexture(gl: WebGLRenderingContext, tex: WebGLTexture, op
* @memberOf module:twgl/textures
*/
export function createTexture(gl: WebGLRenderingContext, options?: TextureOptions, callback?: TextureReadyCallback): WebGLTexture;
/**
* Creates a texture based on the options passed in.
*
* see {@link createTexture}.
* The only difference is this function returns a promise
* where as the other returns a texture and takes a callback.
*
* Note: this is here for completeness. It is probably better to use
* the non-async version as it returns a usable texture immediately
* where as this one you have to wait for it to load.
*
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
* @param {TextureOptions} [options] A TextureOptions object with whatever parameters you want set.
* @return {Promise<CreateTextureInfo>} The created texture and source.
*/
export function createTextureAsync(gl: WebGLRenderingContext, options?: TextureOptions): Promise<CreateTextureInfo>;
/**
* Resizes a texture based on the options passed in.
*
Expand Down Expand Up @@ -3126,6 +3160,24 @@ export function createTextures(gl: WebGLRenderingContext, options: {
}, callback?: TexturesReadyCallback): {
[key: string]: WebGLTexture;
};
/**
* Creates textures based on the options passed in.
*
* see {@link createTextures}.
* The only difference is this function returns a promise
* where as the other returns a texture and takes a callback.
*
* Note: this is here for completeness. It is probably better to use
* the non-async version as it returns usable textures immediately
* where as this one you have to wait for them to load.
*
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
* @param {Object.<string,TextureOptions>} options A object of TextureOptions one per texture.
* @return {Promise<CreateTexturesInfo>} The created textures and sources.
*/
export function createTexturesAsync(gl: WebGLRenderingContext, options: {
[key: string]: TextureOptions;
}): Promise<CreateTexturesInfo>;


/**
Expand Down
67 changes: 66 additions & 1 deletion dist/6.x/twgl-full.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/6.x/twgl-full.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/6.x/twgl-full.min.js

Large diffs are not rendered by default.

65 changes: 63 additions & 2 deletions dist/6.x/twgl-full.module.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* @license twgl.js 6.0.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
/* @license twgl.js 6.1.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
Available via the MIT license.
see: http://github.com/greggman/twgl.js for details */
/*
Expand Down Expand Up @@ -6684,6 +6684,30 @@ function createTexture(gl, options, callback) {
return tex;
}

/**
* Value returned by createTextureAsync
*
* @typedef {Object} CreateTextureInfo
* @param {WebGLTexture} texture the texture.
* @param {module:twgl.TextureSrc} source image(s) used to as the src for the texture
* @memberOf module:twgl
*/

/**
* Creates a texture based on the options passed in.
*
* see {@link module:twgl/textures.createTexture}.
* The only difference is this function returns a promise
* where as the other returns a texture and takes a callback.
*
* Note: this is here for completeness. It is probably better to use
* the non-async version as it returns a usable texture immediately
* where as this one you have to wait for it to load.
*
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
* @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set.
* @return {Promise<CreateTextureInfo>} The created texture and source.
*/
function createTextureAsync(gl, options) {
return new Promise((resolve, reject) => {
createTexture(gl, options, (err, texture, source) => {
Expand Down Expand Up @@ -6872,6 +6896,42 @@ function createTextures(gl, textureOptions, callback) {
return textures;
}

/**
* Value returned by createTextureAsync
*
* @typedef {Object} CreateTexturesInfo
* @param {Object.<string, WebGLTexture>} textures the created textures by name. Same as returned by {@link module:twgl.createTextures}.
* @param {Object.<string, module:twgl.TextureSrc>} sources the image(s) used for the texture by name.
* @memberOf module:twgl
*/

/**
* Creates textures based on the options passed in.
*
* see {@link module:twgl/textures.createTextures}.
* The only difference is this function returns a promise
* where as the other returns a texture and takes a callback.
*
* Note: this is here for completeness. It is probably better to use
* the non-async version as it returns usable textures immediately
* where as this one you have to wait for them to load.
*
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
* @param {Object.<string,module:twgl.TextureOptions>} options A object of TextureOptions one per texture.
* @return {Promise<CreateTexturesInfo>} The created textures and sources.
*/
function createTexturesAsync(gl, options) {
return new Promise((resolve, reject) => {
createTexture(gl, options, (err, textures, sources) => {
if (err) {
reject(err);
} else {
resolve({ textures, sources });
}
});
});
}

var textures = /*#__PURE__*/Object.freeze({
__proto__: null,
setTextureDefaults_: setDefaults$1,
Expand All @@ -6888,6 +6948,7 @@ var textures = /*#__PURE__*/Object.freeze({
setTextureParameters: setTextureParameters,
setDefaultTextureColor: setDefaultTextureColor,
createTextures: createTextures,
createTexturesAsync: createTexturesAsync,
resizeTexture: resizeTexture,
canGenerateMipmap: canGenerateMipmap,
canFilter: canFilter,
Expand Down Expand Up @@ -10198,4 +10259,4 @@ function resizeCanvasToDisplaySize(canvas, multiplier) {
return false;
}

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 };
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 };
52 changes: 52 additions & 0 deletions dist/6.x/twgl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,24 @@ export type CubemapReadyCallback = (err: any, tex: WebGLTexture, imgs: HTMLImage
* @memberOf module:twgl
*/
export type ThreeDReadyCallback = (err: any, tex: WebGLTexture, imgs: HTMLImageElement[]) => void;
/**
* Value returned by createTextureAsync
*
* @typedef {Object} CreateTextureInfo
* @param {WebGLTexture} texture the texture.
* @param {TextureSrc} source image(s) used to as the src for the texture
* @memberOf module:twgl
*/
export type CreateTextureInfo = any;
/**
* Value returned by createTextureAsync
*
* @typedef {Object} CreateTexturesInfo
* @param {Object.<string, WebGLTexture>} textures the created textures by name. Same as returned by {@link createTextures}.
* @param {Object.<string, TextureSrc>} sources the image(s) used for the texture by name.
* @memberOf module:twgl
*/
export type CreateTexturesInfo = any;
/**
* Check if context is WebGL 2.0
* @param {WebGLRenderingContext} gl A WebGLRenderingContext
Expand Down Expand Up @@ -3028,6 +3046,22 @@ export function setEmptyTexture(gl: WebGLRenderingContext, tex: WebGLTexture, op
* @memberOf module:twgl/textures
*/
export function createTexture(gl: WebGLRenderingContext, options?: TextureOptions, callback?: TextureReadyCallback): WebGLTexture;
/**
* Creates a texture based on the options passed in.
*
* see {@link createTexture}.
* The only difference is this function returns a promise
* where as the other returns a texture and takes a callback.
*
* Note: this is here for completeness. It is probably better to use
* the non-async version as it returns a usable texture immediately
* where as this one you have to wait for it to load.
*
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
* @param {TextureOptions} [options] A TextureOptions object with whatever parameters you want set.
* @return {Promise<CreateTextureInfo>} The created texture and source.
*/
export function createTextureAsync(gl: WebGLRenderingContext, options?: TextureOptions): Promise<CreateTextureInfo>;
/**
* Resizes a texture based on the options passed in.
*
Expand Down Expand Up @@ -3126,6 +3160,24 @@ export function createTextures(gl: WebGLRenderingContext, options: {
}, callback?: TexturesReadyCallback): {
[key: string]: WebGLTexture;
};
/**
* Creates textures based on the options passed in.
*
* see {@link createTextures}.
* The only difference is this function returns a promise
* where as the other returns a texture and takes a callback.
*
* Note: this is here for completeness. It is probably better to use
* the non-async version as it returns usable textures immediately
* where as this one you have to wait for them to load.
*
* @param {WebGLRenderingContext} gl the WebGLRenderingContext
* @param {Object.<string,TextureOptions>} options A object of TextureOptions one per texture.
* @return {Promise<CreateTexturesInfo>} The created textures and sources.
*/
export function createTexturesAsync(gl: WebGLRenderingContext, options: {
[key: string]: TextureOptions;
}): Promise<CreateTexturesInfo>;


/**
Expand Down
Loading

0 comments on commit 25f6e51

Please sign in to comment.