Skip to content

Commit

Permalink
stop exporting private functions
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jun 13, 2022
1 parent 9a355d5 commit e3a8d0e
Show file tree
Hide file tree
Showing 24 changed files with 55 additions and 1,387 deletions.
11 changes: 0 additions & 11 deletions dist/4.x/twgl-full.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export type Defaults = {
};
export function setDefaults(newDefaults: Defaults): void;
export function addExtensionsToContext(gl: WebGLRenderingContext): void;
export function getWebGLContext(canvas: HTMLCanvasElement, opt_attribs?: WebGLContextAttributes): WebGLRenderingContext;
export function createContext(canvas: HTMLCanvasElement): WebGLRenderingContext;
export function getContext(canvas: HTMLCanvasElement, opt_attribs?: WebGLContextAttributes): WebGLRenderingContext;
export function resizeCanvasToDisplaySize(canvas: HTMLCanvasElement, multiplier?: number): boolean;
Expand Down Expand Up @@ -256,9 +255,7 @@ export function resizeFramebufferInfo(gl: WebGLRenderingContext, framebufferInfo
export function bindFramebufferInfo(gl: WebGLRenderingContext, framebufferInfo?: FramebufferInfo | null, target?: number): void;


export function getBindPointForSamplerType(): void;
export type ProgramCallback = (err?: string, result?: WebGLProgram | ProgramInfo) => void;
export function prepShaderSource(shaderSource: string): any;
export function createProgram(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
export function createProgramAsync(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<WebGLProgram>;
export function createProgramInfoAsync(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<ProgramInfo>;
Expand Down Expand Up @@ -288,11 +285,6 @@ export function setUniformsAndBindTextures(setters: ProgramInfo | {
export function createAttributeSetters(gl: WebGLRenderingContext, program: WebGLProgram): {
[key: string]: (...params: any[]) => any;
};
export function setAttributes(setters: {
[key: string]: (...params: any[]) => any;
}, buffers: {
[key: string]: AttribInfo;
}): void;
export function setBuffersAndAttributes(gl: WebGLRenderingContext, setters: ProgramInfo | {
[key: string]: (...params: any[]) => any;
}, buffers: BufferInfo | VertexArrayInfo): void;
Expand All @@ -314,10 +306,7 @@ export function setTextureParameters(gl: WebGLRenderingContext, tex: WebGLTextur
export function setSamplerParameters(gl: WebGLRenderingContext, sampler: WebGLSampler, options: TextureOptions): void;
export function setTextureFilteringForSize(gl: WebGLRenderingContext, tex: WebGLTexture, options?: TextureOptions, width?: number, height?: number, internalFormat?: number): void;
export function setTextureFromElement(gl: WebGLRenderingContext, tex: WebGLTexture, element: HTMLElement, options?: TextureOptions): void;
export function setTextureTo1PixelColor(gl: WebGLRenderingContext, tex: WebGLTexture, options?: TextureOptions): void;
export function loadTextureFromUrl(gl: WebGLRenderingContext, tex: WebGLTexture, options?: TextureOptions, callback?: TextureReadyCallback): HTMLImageElement;
export function loadCubemapFromUrls(gl: WebGLRenderingContext, tex: WebGLTexture, options: TextureOptions, callback?: CubemapReadyCallback): void;
export function loadSlicesFromUrls(gl: WebGLRenderingContext, tex: WebGLTexture, options: TextureOptions, callback?: ThreeDReadyCallback): void;
export function setTextureFromArray(gl: WebGLRenderingContext, tex: WebGLTexture, src: number[] | ArrayBufferView, options?: TextureOptions): void;
export function setEmptyTexture(gl: WebGLRenderingContext, tex: WebGLTexture, options: TextureOptions): void;
export function createTexture(gl: WebGLRenderingContext, options?: TextureOptions, callback?: TextureReadyCallback): WebGLTexture;
Expand Down
8 changes: 8 additions & 0 deletions dist/4.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/4.x/twgl-full.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions dist/4.x/twgl-full.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -6088,6 +6088,7 @@ function loadAndUseImage(obj, crossOrigin, callback) {
* @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set.
* This is often the same options you passed in when you created the texture.
* @memberOf module:twgl/textures
* @private
*/
function setTextureTo1PixelColor(gl, tex, options) {
options = options || defaults$1.textureOptions;
Expand Down Expand Up @@ -6197,6 +6198,7 @@ function loadTextureFromUrl(gl, tex, options, callback) {
* @param {module:twgl.CubemapReadyCallback} [callback] A function to be called when all the images have finished loading. err will
* be non null if there was an error.
* @memberOf module:twgl/textures
* @private
*/
function loadCubemapFromUrls(gl, tex, options, callback) {
callback = callback || noop;
Expand Down Expand Up @@ -6280,6 +6282,7 @@ function loadCubemapFromUrls(gl, tex, options, callback) {
* @param {module:twgl.ThreeDReadyCallback} [callback] A function to be called when all the images have finished loading. err will
* be non null if there was an error.
* @memberOf module:twgl/textures
* @private
*/
function loadSlicesFromUrls(gl, tex, options, callback) {
callback = callback || noop;
Expand Down Expand Up @@ -6858,6 +6861,7 @@ const typeMap = {};

/**
* Returns the corresponding bind point for a given sampler type
* @private
*/
function getBindPointForSamplerType(gl, type) {
return typeMap[type].bindPoint;
Expand Down Expand Up @@ -7276,6 +7280,7 @@ const spaceRE = /^[ \t]*\n/;
*
* @param {string} shaderSource The source of the shader
* @returns {{shaderSource: string, lineOffset: number}}
* @private
*/
function prepShaderSource(shaderSource) {
let lineOffset = 0;
Expand Down Expand Up @@ -8649,6 +8654,7 @@ function createAttributeSetters(gl, program) {
* @param {Object.<string, module:twgl.AttribInfo>} buffers AttribInfos mapped by attribute name.
* @memberOf module:twgl/programs
* @deprecated use {@link module:twgl.setBuffersAndAttributes}
* @private
*/
function setAttributes(setters, buffers) {
for (const name in buffers) {
Expand Down Expand Up @@ -9776,6 +9782,8 @@ function create3DContext(canvas, opt_attribs) {
* @param {WebGLContextAttributes} [opt_attribs] optional webgl context creation attributes
* @return {WebGLRenderingContext} The created context.
* @memberOf module:twgl
* @deprecated
* @private
*/
function getWebGLContext(canvas, opt_attribs) {
const gl = create3DContext(canvas, opt_attribs);
Expand Down
11 changes: 0 additions & 11 deletions dist/4.x/twgl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export type Defaults = {
};
export function setDefaults(newDefaults: Defaults): void;
export function addExtensionsToContext(gl: WebGLRenderingContext): void;
export function getWebGLContext(canvas: HTMLCanvasElement, opt_attribs?: WebGLContextAttributes): WebGLRenderingContext;
export function createContext(canvas: HTMLCanvasElement): WebGLRenderingContext;
export function getContext(canvas: HTMLCanvasElement, opt_attribs?: WebGLContextAttributes): WebGLRenderingContext;
export function resizeCanvasToDisplaySize(canvas: HTMLCanvasElement, multiplier?: number): boolean;
Expand Down Expand Up @@ -256,9 +255,7 @@ export function resizeFramebufferInfo(gl: WebGLRenderingContext, framebufferInfo
export function bindFramebufferInfo(gl: WebGLRenderingContext, framebufferInfo?: FramebufferInfo | null, target?: number): void;


export function getBindPointForSamplerType(): void;
export type ProgramCallback = (err?: string, result?: WebGLProgram | ProgramInfo) => void;
export function prepShaderSource(shaderSource: string): any;
export function createProgram(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
export function createProgramAsync(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<WebGLProgram>;
export function createProgramInfoAsync(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<ProgramInfo>;
Expand Down Expand Up @@ -288,11 +285,6 @@ export function setUniformsAndBindTextures(setters: ProgramInfo | {
export function createAttributeSetters(gl: WebGLRenderingContext, program: WebGLProgram): {
[key: string]: (...params: any[]) => any;
};
export function setAttributes(setters: {
[key: string]: (...params: any[]) => any;
}, buffers: {
[key: string]: AttribInfo;
}): void;
export function setBuffersAndAttributes(gl: WebGLRenderingContext, setters: ProgramInfo | {
[key: string]: (...params: any[]) => any;
}, buffers: BufferInfo | VertexArrayInfo): void;
Expand All @@ -314,10 +306,7 @@ export function setTextureParameters(gl: WebGLRenderingContext, tex: WebGLTextur
export function setSamplerParameters(gl: WebGLRenderingContext, sampler: WebGLSampler, options: TextureOptions): void;
export function setTextureFilteringForSize(gl: WebGLRenderingContext, tex: WebGLTexture, options?: TextureOptions, width?: number, height?: number, internalFormat?: number): void;
export function setTextureFromElement(gl: WebGLRenderingContext, tex: WebGLTexture, element: HTMLElement, options?: TextureOptions): void;
export function setTextureTo1PixelColor(gl: WebGLRenderingContext, tex: WebGLTexture, options?: TextureOptions): void;
export function loadTextureFromUrl(gl: WebGLRenderingContext, tex: WebGLTexture, options?: TextureOptions, callback?: TextureReadyCallback): HTMLImageElement;
export function loadCubemapFromUrls(gl: WebGLRenderingContext, tex: WebGLTexture, options: TextureOptions, callback?: CubemapReadyCallback): void;
export function loadSlicesFromUrls(gl: WebGLRenderingContext, tex: WebGLTexture, options: TextureOptions, callback?: ThreeDReadyCallback): void;
export function setTextureFromArray(gl: WebGLRenderingContext, tex: WebGLTexture, src: number[] | ArrayBufferView, options?: TextureOptions): void;
export function setEmptyTexture(gl: WebGLRenderingContext, tex: WebGLTexture, options: TextureOptions): void;
export function createTexture(gl: WebGLRenderingContext, options?: TextureOptions, callback?: TextureReadyCallback): WebGLTexture;
Expand Down
8 changes: 8 additions & 0 deletions dist/4.x/twgl.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/4.x/twgl.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html

Large diffs are not rendered by default.

206 changes: 1 addition & 205 deletions docs/module-twgl.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-twgl_attributes.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-twgl_draw.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-twgl_framebuffers.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-twgl_m4.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-twgl_primitives.html

Large diffs are not rendered by default.

438 changes: 1 addition & 437 deletions docs/module-twgl_programs.html

Large diffs are not rendered by default.

712 changes: 1 addition & 711 deletions docs/module-twgl_textures.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-twgl_typedArray.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-twgl_v3.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/module-twgl_vertexArrays.html

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions npm/base/dist/4.x/twgl.js

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

2 changes: 1 addition & 1 deletion npm/base/dist/4.x/twgl.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/programs.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const typeMap = {};

/**
* Returns the corresponding bind point for a given sampler type
* @private
*/
function getBindPointForSamplerType(gl, type) {
return typeMap[type].bindPoint;
Expand Down Expand Up @@ -542,6 +543,7 @@ const spaceRE = /^[ \t]*\n/;
*
* @param {string} shaderSource The source of the shader
* @returns {{shaderSource: string, lineOffset: number}}
* @private
*/
function prepShaderSource(shaderSource) {
let lineOffset = 0;
Expand Down Expand Up @@ -1915,6 +1917,7 @@ function createAttributeSetters(gl, program) {
* @param {Object.<string, module:twgl.AttribInfo>} buffers AttribInfos mapped by attribute name.
* @memberOf module:twgl/programs
* @deprecated use {@link module:twgl.setBuffersAndAttributes}
* @private
*/
function setAttributes(setters, buffers) {
for (const name in buffers) {
Expand Down
3 changes: 3 additions & 0 deletions src/textures.js
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,7 @@ function loadAndUseImage(obj, crossOrigin, callback) {
* @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set.
* This is often the same options you passed in when you created the texture.
* @memberOf module:twgl/textures
* @private
*/
function setTextureTo1PixelColor(gl, tex, options) {
options = options || defaults.textureOptions;
Expand Down Expand Up @@ -1266,6 +1267,7 @@ function loadTextureFromUrl(gl, tex, options, callback) {
* @param {module:twgl.CubemapReadyCallback} [callback] A function to be called when all the images have finished loading. err will
* be non null if there was an error.
* @memberOf module:twgl/textures
* @private
*/
function loadCubemapFromUrls(gl, tex, options, callback) {
callback = callback || noop;
Expand Down Expand Up @@ -1349,6 +1351,7 @@ function loadCubemapFromUrls(gl, tex, options, callback) {
* @param {module:twgl.ThreeDReadyCallback} [callback] A function to be called when all the images have finished loading. err will
* be non null if there was an error.
* @memberOf module:twgl/textures
* @private
*/
function loadSlicesFromUrls(gl, tex, options, callback) {
callback = callback || noop;
Expand Down
2 changes: 2 additions & 0 deletions src/twgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ function create3DContext(canvas, opt_attribs) {
* @param {WebGLContextAttributes} [opt_attribs] optional webgl context creation attributes
* @return {WebGLRenderingContext} The created context.
* @memberOf module:twgl
* @deprecated
* @private
*/
function getWebGLContext(canvas, opt_attribs) {
const gl = create3DContext(canvas, opt_attribs);
Expand Down

0 comments on commit e3a8d0e

Please sign in to comment.