@gjsify/webgl 0.3.20 → 0.4.0
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/lib/esm/_virtual/_rolldown/runtime.js +1 -0
- package/lib/esm/conformance/attribs.spec.js +2 -2
- package/lib/esm/conformance/buffers.spec.js +1 -1
- package/lib/esm/conformance/context.spec.js +3 -3
- package/lib/esm/conformance/programs.spec.js +3 -3
- package/lib/esm/conformance/rendering-basic.spec.js +3 -3
- package/lib/esm/conformance/rendering.spec.js +6 -6
- package/lib/esm/conformance/setup.js +1 -1
- package/lib/esm/conformance/state.spec.js +1 -1
- package/lib/esm/conformance/textures.spec.js +3 -3
- package/lib/esm/conformance/uniforms.spec.js +1 -1
- package/lib/esm/conformance-test.js +1 -1
- package/lib/esm/context/buffer-binding.js +1 -0
- package/lib/esm/context/drawing.js +1 -0
- package/lib/esm/context/framebuffer.js +1 -0
- package/lib/esm/context/index.js +1 -0
- package/lib/esm/context/shader-program.js +8 -0
- package/lib/esm/context/state.js +1 -0
- package/lib/esm/context/texture-management.js +1 -0
- package/lib/esm/extensions/ext-blend-minmax.js +1 -1
- package/lib/esm/extensions/ext-color-buffer-float.js +1 -1
- package/lib/esm/extensions/ext-color-buffer-half-float.js +1 -1
- package/lib/esm/extensions/ext-texture-filter-anisotropic.js +1 -1
- package/lib/esm/extensions/oes-element-index-unit.js +1 -1
- package/lib/esm/extensions/oes-standard-derivatives.js +1 -1
- package/lib/esm/extensions/oes-texture-float-linear.js +1 -1
- package/lib/esm/extensions/oes-texture-float.js +1 -1
- package/lib/esm/extensions/oes-texture-half-float.js +1 -1
- package/lib/esm/extensions/stackgl-destroy-context.js +1 -1
- package/lib/esm/extensions/stackgl-resize-drawing-buffer.js +1 -1
- package/lib/esm/html-canvas-element.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/linkable.js +1 -1
- package/lib/esm/test-utils.js +4 -4
- package/lib/esm/test.js +1 -1
- package/lib/esm/utils.js +1 -1
- package/lib/esm/webgl-active-info.js +1 -1
- package/lib/esm/webgl-bridge.js +1 -1
- package/lib/esm/webgl-buffer.js +1 -1
- package/lib/esm/webgl-context-attributes.js +1 -1
- package/lib/esm/webgl-context-base.js +1 -8
- package/lib/esm/webgl-drawing-buffer-wrapper.js +1 -1
- package/lib/esm/webgl-framebuffer.js +1 -1
- package/lib/esm/webgl-program.js +1 -1
- package/lib/esm/webgl-query.js +1 -1
- package/lib/esm/webgl-renderbuffer.js +1 -1
- package/lib/esm/webgl-rendering-context.js +1 -1
- package/lib/esm/webgl-sampler.js +1 -1
- package/lib/esm/webgl-shader-precision-format.js +1 -1
- package/lib/esm/webgl-shader.js +1 -1
- package/lib/esm/webgl-sync.js +1 -1
- package/lib/esm/webgl-texture-unit.js +1 -1
- package/lib/esm/webgl-texture.js +1 -1
- package/lib/esm/webgl-transform-feedback.js +1 -1
- package/lib/esm/webgl-uniform-location.js +1 -1
- package/lib/esm/webgl-vertex-array-object.js +1 -1
- package/lib/esm/webgl-vertex-attribute.js +1 -1
- package/lib/esm/webgl1.spec.js +10 -10
- package/lib/esm/webgl2-rendering-context.js +1 -1
- package/lib/esm/webgl2.spec.js +22 -22
- package/lib/types/context/buffer-binding.d.ts +17 -0
- package/lib/types/context/drawing.d.ts +29 -0
- package/lib/types/context/framebuffer.d.ts +33 -0
- package/lib/types/context/index.d.ts +7 -0
- package/lib/types/context/shader-program.d.ts +67 -0
- package/lib/types/context/state.d.ts +60 -0
- package/lib/types/context/texture-management.d.ts +39 -0
- package/lib/types/index.d.ts +11 -0
- package/lib/types/webgl-context-base.d.ts +41 -198
- package/lib/types/webgl2-rendering-context.d.ts +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TypedArray } from '../types/index.js';
|
|
2
|
+
export interface DrawingMethods {
|
|
3
|
+
drawArrays(mode?: GLenum, first?: GLint, count?: GLsizei): void;
|
|
4
|
+
drawElements(mode?: GLenum, count?: GLsizei, type?: GLenum, ioffset?: GLintptr): void;
|
|
5
|
+
viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
|
6
|
+
scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
|
7
|
+
readPixels(x: GLint | undefined, y: GLint | undefined, width: GLsizei | undefined, height: GLsizei | undefined, format: GLenum | undefined, type: GLenum | undefined, pixels: TypedArray | null): void;
|
|
8
|
+
enableVertexAttribArray(index: GLuint): void;
|
|
9
|
+
disableVertexAttribArray(index?: GLuint): void;
|
|
10
|
+
vertexAttrib1f(index: GLuint, x: GLfloat): void;
|
|
11
|
+
vertexAttrib1fv(index: GLuint, values: Float32List): void;
|
|
12
|
+
vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void;
|
|
13
|
+
vertexAttrib2fv(index: GLuint, values: Float32List): void;
|
|
14
|
+
vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void;
|
|
15
|
+
vertexAttrib3fv(index: GLuint, values: Float32List): void;
|
|
16
|
+
vertexAttrib4f(index: GLuint | undefined, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
|
|
17
|
+
vertexAttrib4fv(index: GLuint, values: Float32List): void;
|
|
18
|
+
vertexAttribPointer(index?: GLuint, size?: GLint, type?: GLenum, normalized?: GLboolean, stride?: GLsizei, offset?: GLintptr): void;
|
|
19
|
+
getVertexAttrib(index?: GLuint, pname?: GLenum): unknown;
|
|
20
|
+
getVertexAttribOffset(index?: GLuint, pname?: GLenum): GLintptr;
|
|
21
|
+
_checkVertexAttribState(maxIndex: number): boolean;
|
|
22
|
+
_checkVertexIndex(index: number): boolean;
|
|
23
|
+
}
|
|
24
|
+
declare module '../webgl-context-base.js' {
|
|
25
|
+
interface WebGLContextBase extends DrawingMethods {
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** Install drawing methods on the given prototype. Called from webgl-context-base.ts. */
|
|
29
|
+
export declare function installDrawingMethods(proto: object): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { WebGLFramebuffer } from '../webgl-framebuffer.js';
|
|
2
|
+
import { WebGLRenderbuffer } from '../webgl-renderbuffer.js';
|
|
3
|
+
import { WebGLTexture } from '../webgl-texture.js';
|
|
4
|
+
export interface FramebufferMethods {
|
|
5
|
+
bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null): void;
|
|
6
|
+
bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
|
|
7
|
+
framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbufferTarget: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
|
|
8
|
+
framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level?: GLint): void;
|
|
9
|
+
createFramebuffer(): WebGLFramebuffer | null;
|
|
10
|
+
deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;
|
|
11
|
+
createRenderbuffer(): WebGLRenderbuffer | null;
|
|
12
|
+
deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;
|
|
13
|
+
renderbufferStorage(target?: GLenum, internalFormat?: GLenum, width?: GLsizei, height?: GLsizei): void;
|
|
14
|
+
getFramebufferAttachmentParameter(target?: GLenum, attachment?: GLenum, pname?: GLenum): unknown;
|
|
15
|
+
getRenderbufferParameter(target?: GLenum, pname?: GLenum): unknown;
|
|
16
|
+
checkFramebufferStatus(target: GLenum): GLenum;
|
|
17
|
+
_preCheckFramebufferStatus(framebuffer: WebGLFramebuffer): GLenum;
|
|
18
|
+
_framebufferOk(): boolean;
|
|
19
|
+
_validFramebufferAttachment(attachment: GLenum): boolean;
|
|
20
|
+
_updateFramebufferAttachments(framebuffer: WebGLFramebuffer | null): void;
|
|
21
|
+
_tryDetachFramebuffer(framebuffer: WebGLFramebuffer | null, renderbuffer: WebGLRenderbuffer): void;
|
|
22
|
+
_getAttachments(): number[];
|
|
23
|
+
_getColorAttachments(): number[];
|
|
24
|
+
_resizeDrawingBuffer(width: number, height: number): void;
|
|
25
|
+
_allocateDrawingBuffer(width: number, height: number): void;
|
|
26
|
+
resize(width?: number, height?: number): void;
|
|
27
|
+
}
|
|
28
|
+
declare module '../webgl-context-base.js' {
|
|
29
|
+
interface WebGLContextBase extends FramebufferMethods {
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Install framebuffer methods on the given prototype. Called from webgl-context-base.ts. */
|
|
33
|
+
export declare function installFramebufferMethods(proto: object): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { StateMethods } from './state.js';
|
|
2
|
+
export type { BufferBindingMethods } from './buffer-binding.js';
|
|
3
|
+
export type { TextureManagementMethods } from './texture-management.js';
|
|
4
|
+
export type { FramebufferMethods } from './framebuffer.js';
|
|
5
|
+
export type { ShaderProgramMethods } from './shader-program.js';
|
|
6
|
+
export type { DrawingMethods } from './drawing.js';
|
|
7
|
+
export declare function installAllContextMethods(proto: object): void;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { WebGLActiveInfo } from '../webgl-active-info.js';
|
|
2
|
+
import { WebGLProgram } from '../webgl-program.js';
|
|
3
|
+
import { WebGLShader } from '../webgl-shader.js';
|
|
4
|
+
import { WebGLShaderPrecisionFormat } from '../webgl-shader-precision-format.js';
|
|
5
|
+
import { WebGLUniformLocation } from '../webgl-uniform-location.js';
|
|
6
|
+
export interface ShaderProgramMethods {
|
|
7
|
+
createShader(type?: GLenum): WebGLShader | null;
|
|
8
|
+
deleteShader(shader: WebGLShader | null): void;
|
|
9
|
+
compileShader(shader: WebGLShader): void;
|
|
10
|
+
shaderSource(shader: WebGLShader, source: string): void;
|
|
11
|
+
getShaderInfoLog(shader: WebGLShader): string | null;
|
|
12
|
+
getShaderParameter(shader: WebGLShader, pname?: GLenum): unknown;
|
|
13
|
+
getShaderPrecisionFormat(shaderType?: GLenum, precisionType?: GLenum): WebGLShaderPrecisionFormat | null;
|
|
14
|
+
getShaderSource(shader: WebGLShader): string | null;
|
|
15
|
+
attachShader(program: WebGLProgram, shader: WebGLShader): void;
|
|
16
|
+
detachShader(program: WebGLProgram, shader: WebGLShader): void;
|
|
17
|
+
bindAttribLocation(program: WebGLProgram, index: GLuint, name: string): void;
|
|
18
|
+
createProgram(): WebGLProgram | null;
|
|
19
|
+
deleteProgram(program: WebGLProgram | null): void;
|
|
20
|
+
useProgram(program: WebGLProgram): void;
|
|
21
|
+
linkProgram(program: WebGLProgram): void;
|
|
22
|
+
validateProgram(program: WebGLProgram): void;
|
|
23
|
+
getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
|
|
24
|
+
getActiveUniform(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
|
|
25
|
+
getAttachedShaders(program: WebGLProgram): WebGLShader[] | null;
|
|
26
|
+
getAttribLocation(program: WebGLProgram, name: string): GLint;
|
|
27
|
+
getUniform(program: WebGLProgram, location: WebGLUniformLocation): unknown;
|
|
28
|
+
getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation | null;
|
|
29
|
+
getProgramInfoLog(program: WebGLProgram): string | null;
|
|
30
|
+
getProgramParameter(program: WebGLProgram, pname?: GLenum): unknown;
|
|
31
|
+
uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void;
|
|
32
|
+
uniform1i(location: WebGLUniformLocation | null, x: GLint): void;
|
|
33
|
+
uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat): void;
|
|
34
|
+
uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void;
|
|
35
|
+
uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void;
|
|
36
|
+
uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void;
|
|
37
|
+
uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
|
|
38
|
+
uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void;
|
|
39
|
+
uniform1fv(location: WebGLUniformLocation | null, value: Float32List | Int32List): void;
|
|
40
|
+
uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
41
|
+
uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void;
|
|
42
|
+
uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
43
|
+
uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void;
|
|
44
|
+
uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
45
|
+
uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void;
|
|
46
|
+
uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
47
|
+
uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
|
48
|
+
uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
|
49
|
+
uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
|
50
|
+
_checkLocation(location: WebGLUniformLocation | null): boolean;
|
|
51
|
+
_checkLocationActive(location: WebGLUniformLocation | null): boolean;
|
|
52
|
+
_checkUniformValid(location: WebGLUniformLocation | null, v0: GLfloat, name: string, count: number, type: string): boolean;
|
|
53
|
+
_checkUniformValueValid(location: WebGLUniformLocation | null, value: Float32List | Int32List, name: string, count: number, type: string): boolean;
|
|
54
|
+
_checkUniformMatrix(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List, name: string, count: number): boolean;
|
|
55
|
+
_checkShaderSource(shader: WebGLShader): boolean;
|
|
56
|
+
_wrapShader(type: GLenum, source: string): string;
|
|
57
|
+
_switchActiveProgram(active: WebGLProgram | null): void;
|
|
58
|
+
_fixupLink(program: WebGLProgram): boolean;
|
|
59
|
+
_deleteLinkable(name: 'deleteProgram', object: WebGLProgram | null, Type: typeof WebGLProgram): void;
|
|
60
|
+
_deleteLinkable(name: 'deleteShader', object: WebGLShader | null, Type: typeof WebGLShader): void;
|
|
61
|
+
}
|
|
62
|
+
declare module '../webgl-context-base.js' {
|
|
63
|
+
interface WebGLContextBase extends ShaderProgramMethods {
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Install shader/program methods on the given prototype. Called from webgl-context-base.ts. */
|
|
67
|
+
export declare function installShaderProgramMethods(proto: object): void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { WebGLBuffer } from '../webgl-buffer.js';
|
|
2
|
+
import { WebGLFramebuffer } from '../webgl-framebuffer.js';
|
|
3
|
+
import { WebGLProgram } from '../webgl-program.js';
|
|
4
|
+
import { WebGLRenderbuffer } from '../webgl-renderbuffer.js';
|
|
5
|
+
import { WebGLShader } from '../webgl-shader.js';
|
|
6
|
+
import { WebGLTexture } from '../webgl-texture.js';
|
|
7
|
+
/** Type-only interface that augments WebGLContextBase with the methods this module installs. */
|
|
8
|
+
export interface StateMethods {
|
|
9
|
+
enable(cap?: GLenum): void;
|
|
10
|
+
disable(cap?: GLenum): void;
|
|
11
|
+
cullFace(mode: GLenum): void;
|
|
12
|
+
depthFunc(func: GLenum): void;
|
|
13
|
+
depthMask(flag: GLboolean): void;
|
|
14
|
+
depthRange(zNear: GLclampf, zFar: GLclampf): void;
|
|
15
|
+
frontFace(mode?: GLenum): void;
|
|
16
|
+
lineWidth(width: GLfloat): void;
|
|
17
|
+
polygonOffset(factor: GLfloat, units: GLfloat): void;
|
|
18
|
+
sampleCoverage(value: GLclampf, invert: GLboolean): void;
|
|
19
|
+
hint(target?: GLenum, mode?: GLenum): void;
|
|
20
|
+
finish(): void;
|
|
21
|
+
flush(): void;
|
|
22
|
+
blendColor(red?: GLclampf, green?: GLclampf, blue?: GLclampf, alpha?: GLclampf): void;
|
|
23
|
+
blendEquation(mode?: GLenum): void;
|
|
24
|
+
blendEquationSeparate(modeRGB?: GLenum, modeAlpha?: GLenum): void;
|
|
25
|
+
blendFunc(sfactor?: GLenum, dfactor?: GLenum): void;
|
|
26
|
+
blendFuncSeparate(srcRGB?: GLenum, dstRGB?: GLenum, srcAlpha?: GLenum, dstAlpha?: GLenum): void;
|
|
27
|
+
clear(mask?: GLbitfield): void;
|
|
28
|
+
clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;
|
|
29
|
+
clearDepth(depth: GLclampf): void;
|
|
30
|
+
clearStencil(s?: GLint): void;
|
|
31
|
+
colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean): void;
|
|
32
|
+
stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void;
|
|
33
|
+
stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint): void;
|
|
34
|
+
stencilMask(mask: GLuint): void;
|
|
35
|
+
stencilMaskSeparate(face: GLenum, mask: GLuint): void;
|
|
36
|
+
stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void;
|
|
37
|
+
stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum): void;
|
|
38
|
+
isEnabled(cap?: GLenum): GLboolean;
|
|
39
|
+
isContextLost(): boolean;
|
|
40
|
+
getError(): GLenum;
|
|
41
|
+
setError(error: GLenum): void;
|
|
42
|
+
isBuffer(buffer: WebGLBuffer): GLboolean;
|
|
43
|
+
isFramebuffer(framebuffer: WebGLFramebuffer): GLboolean;
|
|
44
|
+
isProgram(program: WebGLProgram): GLboolean;
|
|
45
|
+
isRenderbuffer(renderbuffer: WebGLRenderbuffer): GLboolean;
|
|
46
|
+
isShader(shader: WebGLShader): GLboolean;
|
|
47
|
+
isTexture(texture: WebGLTexture): GLboolean;
|
|
48
|
+
generateMipmap(target?: GLenum): void;
|
|
49
|
+
_validBlendFunc(factor: GLenum): boolean;
|
|
50
|
+
_validBlendMode(mode: GLenum): boolean;
|
|
51
|
+
_isConstantBlendFunc(factor: GLenum): boolean;
|
|
52
|
+
_saveError(): void;
|
|
53
|
+
_restoreError(lastError: GLenum): void;
|
|
54
|
+
}
|
|
55
|
+
declare module '../webgl-context-base.js' {
|
|
56
|
+
interface WebGLContextBase extends StateMethods {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** Install state methods on the given prototype. Called from webgl-context-base.ts. */
|
|
60
|
+
export declare function installStateMethods(proto: object): void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
|
|
2
|
+
import { WebGLTexture } from '../webgl-texture.js';
|
|
3
|
+
import { WebGLTextureUnit } from '../webgl-texture-unit.js';
|
|
4
|
+
import type { TypedArray } from '../types/index.js';
|
|
5
|
+
export interface TextureManagementMethods {
|
|
6
|
+
activeTexture(texture?: GLenum): void;
|
|
7
|
+
bindTexture(target: GLenum | undefined, texture: WebGLTexture | null): void;
|
|
8
|
+
createTexture(): WebGLTexture | null;
|
|
9
|
+
deleteTexture(texture: WebGLTexture | null): void;
|
|
10
|
+
pixelStorei(pname?: GLenum, param?: GLint | GLboolean): void;
|
|
11
|
+
texImage2D(target: GLenum, level: GLint, internalFormat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
|
|
12
|
+
texImage2D(target: GLenum, level: GLint, internalFormat: GLint, format: GLenum, type: GLenum, source: TexImageSource | GdkPixbuf.Pixbuf): void;
|
|
13
|
+
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
|
|
14
|
+
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource | GdkPixbuf.Pixbuf): void;
|
|
15
|
+
copyTexImage2D(target?: GLenum, level?: GLint, internalFormat?: GLenum, x?: GLint, y?: GLint, width?: GLsizei, height?: GLsizei, border?: GLint): void;
|
|
16
|
+
copyTexSubImage2D(target?: GLenum, level?: GLint, xoffset?: GLint, yoffset?: GLint, x?: GLint, y?: GLint, width?: GLsizei, height?: GLsizei): void;
|
|
17
|
+
compressedTexImage2D(target: GLenum, level: GLint, internalFormat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: TypedArray): void;
|
|
18
|
+
compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: TypedArray): void;
|
|
19
|
+
texParameterf(target?: GLenum, pname?: GLenum, param?: GLfloat): void;
|
|
20
|
+
texParameteri(target?: GLenum, pname?: GLenum, param?: GLint): void;
|
|
21
|
+
getTexParameter(target?: GLenum, pname?: GLenum): unknown;
|
|
22
|
+
_getTexParameterDirect(target?: GLenum, pname?: GLenum): unknown;
|
|
23
|
+
_getActiveTextureUnit(): WebGLTextureUnit;
|
|
24
|
+
_getActiveTexture(target: GLenum): WebGLTexture | null;
|
|
25
|
+
_getTexImage(target: GLenum): WebGLTexture | null;
|
|
26
|
+
_checkTextureTarget(target: GLenum): boolean;
|
|
27
|
+
_validTextureTarget(target: GLenum): boolean;
|
|
28
|
+
_validCubeTarget(target: GLenum): boolean;
|
|
29
|
+
_verifyTextureCompleteness(target: GLenum, pname: GLenum, param: GLenum): void;
|
|
30
|
+
_computePixelSize(type: GLenum, internalFormat: GLenum): number;
|
|
31
|
+
_computeRowStride(width: number, pixelSize: number): number;
|
|
32
|
+
_checkDimensions(target: GLenum, width: GLsizei, height: GLsizei, level: number): boolean;
|
|
33
|
+
}
|
|
34
|
+
declare module '../webgl-context-base.js' {
|
|
35
|
+
interface WebGLContextBase extends TextureManagementMethods {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** Install texture-management methods on the given prototype. Called from webgl-context-base.ts. */
|
|
39
|
+
export declare function installTextureManagementMethods(proto: object): void;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -24,3 +24,14 @@ export * from './webgl-texture-unit.js';
|
|
|
24
24
|
export * from './webgl-texture.js';
|
|
25
25
|
export * from './webgl-uniform-location.js';
|
|
26
26
|
export * from './webgl-vertex-attribute.js';
|
|
27
|
+
export * from './extensions/ext-blend-minmax.js';
|
|
28
|
+
export * from './extensions/ext-color-buffer-float.js';
|
|
29
|
+
export * from './extensions/ext-color-buffer-half-float.js';
|
|
30
|
+
export * from './extensions/ext-texture-filter-anisotropic.js';
|
|
31
|
+
export * from './extensions/oes-element-index-unit.js';
|
|
32
|
+
export * from './extensions/oes-standard-derivatives.js';
|
|
33
|
+
export * from './extensions/oes-texture-float-linear.js';
|
|
34
|
+
export * from './extensions/oes-texture-float.js';
|
|
35
|
+
export * from './extensions/oes-texture-half-float.js';
|
|
36
|
+
export * from './extensions/stackgl-destroy-context.js';
|
|
37
|
+
export * from './extensions/stackgl-resize-drawing-buffer.js';
|
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
import '@girs/gdkpixbuf-2.0';
|
|
2
2
|
import Gwebgl from '@girs/gwebgl-0.1';
|
|
3
|
-
import GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
|
|
4
3
|
import { WebGLContextAttributes } from './webgl-context-attributes.js';
|
|
5
4
|
import { HTMLCanvasElement } from './html-canvas-element.js';
|
|
6
|
-
import { WebGLActiveInfo } from './webgl-active-info.js';
|
|
7
|
-
import { WebGLFramebuffer } from './webgl-framebuffer.js';
|
|
8
5
|
import { WebGLBuffer } from './webgl-buffer.js';
|
|
9
6
|
import { WebGLDrawingBufferWrapper } from './webgl-drawing-buffer-wrapper.js';
|
|
7
|
+
import { WebGLFramebuffer } from './webgl-framebuffer.js';
|
|
10
8
|
import { WebGLProgram } from './webgl-program.js';
|
|
11
9
|
import { WebGLRenderbuffer } from './webgl-renderbuffer.js';
|
|
12
10
|
import { WebGLShader } from './webgl-shader.js';
|
|
13
|
-
import { WebGLShaderPrecisionFormat } from './webgl-shader-precision-format.js';
|
|
14
|
-
import { WebGLTextureUnit } from './webgl-texture-unit.js';
|
|
15
11
|
import { WebGLTexture } from './webgl-texture.js';
|
|
16
|
-
import {
|
|
12
|
+
import { WebGLTextureUnit } from './webgl-texture-unit.js';
|
|
17
13
|
import { WebGLVertexArrayObjectState, WebGLVertexArrayGlobalState } from './webgl-vertex-attribute.js';
|
|
18
|
-
import type {
|
|
14
|
+
import type { WebGLConstants } from './types/index.js';
|
|
15
|
+
/**
|
|
16
|
+
* Per-extension structural type. The original code typed this as `Record<string, any>`;
|
|
17
|
+
* since each extension is created by an `ExtensionFactory` and exposes a heterogenous
|
|
18
|
+
* set of GL constants and instance state, `Record<string, unknown>` plus a string index
|
|
19
|
+
* preserves "anything can be on it" without losing call-site safety entirely.
|
|
20
|
+
*/
|
|
21
|
+
type WebGLExtensionLike = Record<string, unknown>;
|
|
19
22
|
export interface WebGLContextBase extends WebGLConstants {
|
|
20
23
|
}
|
|
21
24
|
export declare abstract class WebGLContextBase {
|
|
22
25
|
canvas: HTMLCanvasElement;
|
|
23
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* STATUS.md "Open TODOs" — Web platform parity:
|
|
28
|
+
* "WebGL: drawingBufferColorSpace currently a static field; needs colorimetry
|
|
29
|
+
* plumbing into Cairo/GTK GL output to honour 'srgb' vs 'display-p3'."
|
|
30
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawingBufferColorSpace
|
|
31
|
+
*/
|
|
24
32
|
drawingBufferColorSpace: PredefinedColorSpace;
|
|
25
33
|
unpackColorSpace: PredefinedColorSpace;
|
|
26
34
|
readonly RGBA8: 32856;
|
|
@@ -32,7 +40,13 @@ export declare abstract class WebGLContextBase {
|
|
|
32
40
|
_: number;
|
|
33
41
|
abstract get _gl(): Gwebgl.WebGLRenderingContextBase;
|
|
34
42
|
_contextAttributes: WebGLContextAttributes;
|
|
35
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Map of active GL extension instances. Keys are lowercase extension names
|
|
45
|
+
* (e.g. `oes_texture_float`); values are returned by the `ExtensionFactory`
|
|
46
|
+
* for that name. Each extension has its own surface area, so we keep this
|
|
47
|
+
* loose-typed but no longer `any`.
|
|
48
|
+
*/
|
|
49
|
+
_extensions: Record<string, WebGLExtensionLike & any>;
|
|
36
50
|
_programs: Record<number, WebGLProgram>;
|
|
37
51
|
_shaders: Record<number, WebGLShader>;
|
|
38
52
|
_textures: Record<number, WebGLTexture>;
|
|
@@ -62,7 +76,7 @@ export declare abstract class WebGLContextBase {
|
|
|
62
76
|
_gtkFboId: number;
|
|
63
77
|
_textureUnits: WebGLTextureUnit[];
|
|
64
78
|
_drawingBuffer: WebGLDrawingBufferWrapper | null;
|
|
65
|
-
protected constructor(canvas: HTMLCanvasElement | null, options?:
|
|
79
|
+
protected constructor(canvas: HTMLCanvasElement | null, options?: Partial<Gwebgl.WebGLRenderingContext.ConstructorProps> & WebGLContextAttributes);
|
|
66
80
|
/**
|
|
67
81
|
* Must be called by subclass constructors AFTER setting up the native GL object
|
|
68
82
|
* so that `this._gl` is available for GL-dependent initialization.
|
|
@@ -70,199 +84,28 @@ export declare abstract class WebGLContextBase {
|
|
|
70
84
|
protected _init(): void;
|
|
71
85
|
_initGLConstants(): void;
|
|
72
86
|
_getGlslVersion(es: boolean): string;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
87
|
+
_checkOwns(object: unknown): boolean;
|
|
88
|
+
_checkValid(object: unknown, Type: {
|
|
89
|
+
new (...args: unknown[]): unknown;
|
|
90
|
+
}): boolean;
|
|
91
|
+
_checkWrapper(object: unknown, Wrapper: {
|
|
92
|
+
new (...args: unknown[]): unknown;
|
|
93
|
+
}): boolean;
|
|
94
|
+
_isObject(object: unknown, method: string, Wrapper: {
|
|
95
|
+
new (...args: unknown[]): unknown;
|
|
96
|
+
}): boolean;
|
|
78
97
|
_checkStencilState(): boolean;
|
|
79
|
-
_checkTextureTarget(target: GLenum): boolean;
|
|
80
|
-
_checkWrapper(object: any, Wrapper: any): boolean;
|
|
81
|
-
_checkValid(object: any, Type: any): boolean;
|
|
82
|
-
_checkVertexAttribState(maxIndex: number): boolean;
|
|
83
|
-
_checkVertexIndex(index: number): boolean;
|
|
84
|
-
_computePixelSize(type: GLenum, internalFormat: GLenum): 0 | 1 | 2 | 3 | 4;
|
|
85
|
-
_computeRowStride(width: number, pixelSize: number): number;
|
|
86
|
-
_fixupLink(program: WebGLProgram): boolean;
|
|
87
|
-
_framebufferOk(): boolean;
|
|
88
|
-
_getActiveBuffer(target: GLenum): WebGLBuffer;
|
|
89
|
-
_getActiveTextureUnit(): WebGLTextureUnit;
|
|
90
|
-
_getActiveTexture(target: GLenum): WebGLTexture;
|
|
91
|
-
_getAttachments(): any;
|
|
92
|
-
_getColorAttachments(): any;
|
|
93
|
-
_getParameterDirect(pname: GLenum): any;
|
|
94
|
-
_getTexImage(target: GLenum): WebGLTexture;
|
|
95
|
-
_preCheckFramebufferStatus(framebuffer: WebGLFramebuffer): GLenum;
|
|
96
|
-
_isConstantBlendFunc(factor: GLenum): factor is 32769 | 32770 | 32771 | 32772;
|
|
97
|
-
_isObject(object: any, method: any, Wrapper: any): boolean;
|
|
98
|
-
_resizeDrawingBuffer(width: number, height: number): void;
|
|
99
|
-
_restoreError(lastError: GLenum): void;
|
|
100
|
-
_saveError(): void;
|
|
101
|
-
_switchActiveProgram(active: WebGLProgram | null): void;
|
|
102
|
-
_tryDetachFramebuffer(framebuffer: WebGLFramebuffer | null, renderbuffer: WebGLRenderbuffer): void;
|
|
103
|
-
_updateFramebufferAttachments(framebuffer: WebGLFramebuffer | null): void;
|
|
104
|
-
_validBlendFunc(factor: GLenum): factor is 0 | 1 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 32769 | 32770 | 32771 | 32772;
|
|
105
|
-
_validBlendMode(mode: GLenum): boolean;
|
|
106
|
-
_validCubeTarget(target: GLenum): target is 34069 | 34070 | 34071 | 34072 | 34073 | 34074;
|
|
107
|
-
_validFramebufferAttachment(attachment: GLenum): boolean;
|
|
108
98
|
_validGLSLIdentifier(str: string): boolean;
|
|
109
|
-
|
|
110
|
-
_verifyTextureCompleteness(target: GLenum, pname: GLenum, param: GLenum): void;
|
|
111
|
-
_wrapShader(_type: GLenum, source: string): string;
|
|
112
|
-
_allocateDrawingBuffer(width: number, height: number): void;
|
|
99
|
+
_getParameterDirect(pname: GLenum): unknown;
|
|
113
100
|
/**
|
|
114
|
-
* The `WebGLRenderingContext.getContextAttributes()` method returns a `WebGLContextAttributes`
|
|
115
|
-
* Might return `null`, if the context is lost.
|
|
101
|
+
* The `WebGLRenderingContext.getContextAttributes()` method returns a `WebGLContextAttributes`
|
|
102
|
+
* object that contains the actual context parameters. Might return `null`, if the context is lost.
|
|
116
103
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getContextAttributes
|
|
117
|
-
* @returns A `WebGLContextAttributes` object that contains the actual context parameters, or `null` if the context is lost.
|
|
118
104
|
*/
|
|
119
105
|
getContextAttributes(): WebGLContextAttributes | null;
|
|
120
|
-
getExtension(name: string):
|
|
121
|
-
bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;
|
|
122
|
-
bufferData(target: GLenum, data: BufferSource | null, usage: GLenum): void;
|
|
123
|
-
bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource): void;
|
|
124
|
-
compressedTexImage2D(target: GLenum, level: GLint, internalFormat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: TypedArray): void;
|
|
125
|
-
compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: TypedArray): void;
|
|
126
|
-
readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: TypedArray | null): void;
|
|
127
|
-
texImage2D(target: GLenum, level: GLint, internalFormat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
|
|
128
|
-
texImage2D(target: GLenum, level: GLint, internalFormat: GLint, format: GLenum, type: GLenum, source: TexImageSource | GdkPixbuf.Pixbuf): void;
|
|
129
|
-
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
|
|
130
|
-
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource | GdkPixbuf.Pixbuf): void;
|
|
131
|
-
_checkUniformValid(location: WebGLUniformLocation | null, v0: GLfloat, name: string, count: number, type: string): boolean;
|
|
132
|
-
_checkUniformValueValid(location: WebGLUniformLocation | null, value: Float32List | Int32List, name: string, count: number, _type: string): boolean;
|
|
133
|
-
uniform1fv(location: WebGLUniformLocation | null, value: Float32List | Int32List): void;
|
|
134
|
-
uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
135
|
-
uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void;
|
|
136
|
-
uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
137
|
-
uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void;
|
|
138
|
-
uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
139
|
-
uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void;
|
|
140
|
-
uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
141
|
-
_checkUniformMatrix(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List, name: string, count: number): boolean;
|
|
142
|
-
uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
|
143
|
-
uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
|
144
|
-
uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
|
145
|
-
activeTexture(texture?: GLenum): void;
|
|
146
|
-
attachShader(program: WebGLProgram, shader: WebGLShader): void;
|
|
147
|
-
bindAttribLocation(program: WebGLProgram, index: GLuint, name: string): void;
|
|
148
|
-
bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void;
|
|
149
|
-
bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null): void;
|
|
150
|
-
bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
|
|
151
|
-
bindTexture(target: GLenum, texture: WebGLTexture | null): void;
|
|
152
|
-
blendColor(red?: GLclampf, green?: GLclampf, blue?: GLclampf, alpha?: GLclampf): void;
|
|
153
|
-
blendEquation(mode?: GLenum): void;
|
|
154
|
-
blendEquationSeparate(modeRGB?: GLenum, modeAlpha?: GLenum): void;
|
|
155
|
-
blendFunc(sfactor?: GLenum, dfactor?: GLenum): void;
|
|
156
|
-
blendFuncSeparate(srcRGB?: GLenum, dstRGB?: GLenum, srcAlpha?: GLenum, dstAlpha?: GLenum): void;
|
|
157
|
-
checkFramebufferStatus(target: GLenum): GLenum;
|
|
158
|
-
clear(mask?: GLbitfield): void;
|
|
159
|
-
clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;
|
|
160
|
-
clearDepth(depth: GLclampf): void;
|
|
161
|
-
clearStencil(s?: GLint): void;
|
|
162
|
-
colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean): void;
|
|
163
|
-
compileShader(shader: WebGLShader): void;
|
|
164
|
-
copyTexImage2D(target?: GLenum, level?: GLint, internalFormat?: GLenum, x?: GLint, y?: GLint, width?: GLsizei, height?: GLsizei, border?: GLint): void;
|
|
165
|
-
copyTexSubImage2D(target?: GLenum, level?: GLint, xoffset?: GLint, yoffset?: GLint, x?: GLint, y?: GLint, width?: GLsizei, height?: GLsizei): void;
|
|
166
|
-
createBuffer(): WebGLBuffer | null;
|
|
167
|
-
createFramebuffer(): WebGLFramebuffer | null;
|
|
168
|
-
createProgram(): WebGLProgram | null;
|
|
169
|
-
createRenderbuffer(): WebGLRenderbuffer | null;
|
|
170
|
-
createShader(type?: GLenum): WebGLShader | null;
|
|
171
|
-
createTexture(): WebGLTexture | null;
|
|
172
|
-
cullFace(mode: GLenum): void;
|
|
173
|
-
deleteBuffer(buffer: WebGLBuffer | null): void;
|
|
174
|
-
deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;
|
|
175
|
-
_deleteLinkable(name: 'deleteProgram', object: WebGLProgram | null, Type: typeof WebGLProgram): void;
|
|
176
|
-
_deleteLinkable(name: 'deleteShader', object: WebGLShader | null, Type: typeof WebGLShader): void;
|
|
177
|
-
deleteProgram(program: WebGLProgram | null): void;
|
|
178
|
-
deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;
|
|
179
|
-
deleteShader(shader: WebGLShader | null): void;
|
|
180
|
-
deleteTexture(texture: WebGLTexture | null): void;
|
|
181
|
-
depthFunc(func: GLenum): void;
|
|
182
|
-
depthMask(flag: GLboolean): void;
|
|
183
|
-
depthRange(zNear: GLclampf, zFar: GLclampf): void;
|
|
184
|
-
destroy(): void;
|
|
185
|
-
detachShader(program: WebGLProgram, shader: WebGLShader): void;
|
|
186
|
-
disable(cap?: GLenum): void;
|
|
187
|
-
disableVertexAttribArray(index?: GLuint): void;
|
|
188
|
-
drawArrays(mode?: GLenum, first?: GLint, count?: GLsizei): void;
|
|
189
|
-
drawElements(mode?: GLenum, count?: GLsizei, type?: GLenum, ioffset?: GLintptr): void;
|
|
190
|
-
enable(cap?: GLenum): void;
|
|
191
|
-
enableVertexAttribArray(index: GLuint): void;
|
|
192
|
-
finish(): void;
|
|
193
|
-
flush(): void;
|
|
194
|
-
framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbufferTarget: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
|
|
195
|
-
framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level?: GLint): void;
|
|
196
|
-
frontFace(mode?: GLenum): void;
|
|
197
|
-
generateMipmap(target?: GLenum): void;
|
|
198
|
-
getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
|
|
199
|
-
getActiveUniform(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
|
|
200
|
-
getAttachedShaders(program: WebGLProgram): WebGLShader[] | null;
|
|
201
|
-
getAttribLocation(program: WebGLProgram, name: string): GLint;
|
|
202
|
-
getBufferParameter(target?: GLenum, pname?: GLenum): any;
|
|
203
|
-
getError(): GLenum;
|
|
204
|
-
setError(error: GLenum): void;
|
|
205
|
-
getFramebufferAttachmentParameter(target?: GLenum, attachment?: GLenum, pname?: GLenum): any;
|
|
206
|
-
getParameter(pname?: GLenum): any;
|
|
207
|
-
getProgramInfoLog(program: WebGLProgram): string | null;
|
|
208
|
-
getProgramParameter(program: WebGLProgram, pname?: GLenum): any;
|
|
209
|
-
getRenderbufferParameter(target?: GLenum, pname?: GLenum): any;
|
|
210
|
-
getShaderInfoLog(shader: WebGLShader): string | null;
|
|
211
|
-
getShaderParameter(shader: WebGLShader, pname?: GLenum): any;
|
|
212
|
-
getShaderPrecisionFormat(shaderType?: GLenum, precisionType?: GLenum): WebGLShaderPrecisionFormat | null;
|
|
213
|
-
getShaderSource(shader: WebGLShader): string | null;
|
|
106
|
+
getExtension(name: string): unknown;
|
|
214
107
|
getSupportedExtensions(): string[];
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
getUniform(program: WebGLProgram, location: WebGLUniformLocation): any;
|
|
218
|
-
getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation | null;
|
|
219
|
-
getVertexAttrib(index?: GLuint, pname?: GLenum): any;
|
|
220
|
-
getVertexAttribOffset(index?: GLuint, pname?: GLenum): GLintptr;
|
|
221
|
-
hint(target?: GLenum, mode?: GLenum): void;
|
|
222
|
-
isBuffer(buffer: WebGLBuffer): GLboolean;
|
|
223
|
-
isContextLost(): boolean;
|
|
224
|
-
isEnabled(cap?: GLenum): GLboolean;
|
|
225
|
-
isFramebuffer(framebuffer: WebGLShader): GLboolean;
|
|
226
|
-
isProgram(program: WebGLProgram): GLboolean;
|
|
227
|
-
isRenderbuffer(renderbuffer: WebGLRenderbuffer): GLboolean;
|
|
228
|
-
isShader(shader: WebGLShader): GLboolean;
|
|
229
|
-
isTexture(texture: WebGLTexture): GLboolean;
|
|
230
|
-
lineWidth(width: GLfloat): void;
|
|
231
|
-
linkProgram(program: WebGLProgram): void;
|
|
232
|
-
/** The `WebGLRenderingContext.pixelStorei()` method of the WebGL API specifies the pixel storage modes. */
|
|
233
|
-
pixelStorei(pname?: GLenum, param?: GLint | GLboolean): void;
|
|
234
|
-
polygonOffset(factor: GLfloat, units: GLfloat): void;
|
|
235
|
-
renderbufferStorage(target?: GLenum, internalFormat?: GLenum, width?: GLsizei, height?: GLsizei): void;
|
|
236
|
-
resize(width?: number, height?: number): void;
|
|
237
|
-
sampleCoverage(value: GLclampf, invert: GLboolean): void;
|
|
238
|
-
scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
|
239
|
-
shaderSource(shader: WebGLShader, source: string): void;
|
|
240
|
-
stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void;
|
|
241
|
-
stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint): void;
|
|
242
|
-
stencilMask(mask: GLuint): void;
|
|
243
|
-
stencilMaskSeparate(face: GLenum, mask: GLuint): void;
|
|
244
|
-
stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void;
|
|
245
|
-
stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum): void;
|
|
246
|
-
texParameterf(target: GLenum, pname: GLenum, param: GLfloat): void;
|
|
247
|
-
texParameteri(target?: GLenum, pname?: GLenum, param?: GLint): void;
|
|
248
|
-
uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void;
|
|
249
|
-
uniform1i(location: WebGLUniformLocation | null, x: GLint): void;
|
|
250
|
-
uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat): void;
|
|
251
|
-
uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void;
|
|
252
|
-
uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void;
|
|
253
|
-
uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void;
|
|
254
|
-
uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
|
|
255
|
-
uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void;
|
|
256
|
-
useProgram(program: WebGLProgram): void;
|
|
257
|
-
validateProgram(program: WebGLProgram): void;
|
|
258
|
-
vertexAttrib1f(index: GLuint, x: GLfloat): void;
|
|
259
|
-
vertexAttrib1fv(index: GLuint, values: Float32List): void;
|
|
260
|
-
vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void;
|
|
261
|
-
vertexAttrib2fv(index: GLuint, values: Float32List): void;
|
|
262
|
-
vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void;
|
|
263
|
-
vertexAttrib3fv(index: GLuint, values: Float32List): void;
|
|
264
|
-
vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
|
|
265
|
-
vertexAttrib4fv(index: GLuint, values: Float32List): void;
|
|
266
|
-
vertexAttribPointer(index?: GLuint, size?: GLint, type?: GLenum, normalized?: GLboolean, stride?: GLsizei, offset?: GLintptr): void;
|
|
267
|
-
viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
|
108
|
+
getParameter(pname?: GLenum): unknown;
|
|
109
|
+
destroy(): void;
|
|
268
110
|
}
|
|
111
|
+
export {};
|
|
@@ -175,7 +175,7 @@ export declare class WebGL2RenderingContext extends WebGLContextBase implements
|
|
|
175
175
|
uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
176
176
|
uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
177
177
|
/** WebGL1 getUniform falls to default:null for UNSIGNED_INT types. Handle them here. */
|
|
178
|
-
getUniform(program: WebGLProgram, location: WebGLUniformLocation):
|
|
178
|
+
getUniform(program: WebGLProgram, location: WebGLUniformLocation): unknown;
|
|
179
179
|
getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string): GLuint;
|
|
180
180
|
uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint): void;
|
|
181
181
|
getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint): string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/webgl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "WebGL module for Gjs",
|
|
5
5
|
"module": "lib/esm/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
"WebGL"
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@gjsify/cli": "^0.
|
|
43
|
-
"@gjsify/unit": "^0.
|
|
42
|
+
"@gjsify/cli": "^0.4.0",
|
|
43
|
+
"@gjsify/unit": "^0.4.0",
|
|
44
44
|
"@types/bit-twiddle": "^1.0.3",
|
|
45
45
|
"@types/node": "^25.6.2",
|
|
46
46
|
"typescript": "^6.0.3"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@girs/gjs": "4.0.0-rc.
|
|
50
|
-
"@girs/gtk-4.0": "4.23.0-4.0.0-rc.
|
|
49
|
+
"@girs/gjs": "4.0.0-rc.15",
|
|
50
|
+
"@girs/gtk-4.0": "4.23.0-4.0.0-rc.15",
|
|
51
51
|
"@girs/gwebgl-0.1": "0.1.0-4.0.0-rc.5",
|
|
52
|
-
"@gjsify/dom-elements": "^0.
|
|
53
|
-
"@gjsify/event-bridge": "^0.
|
|
54
|
-
"@gjsify/utils": "^0.
|
|
52
|
+
"@gjsify/dom-elements": "^0.4.0",
|
|
53
|
+
"@gjsify/event-bridge": "^0.4.0",
|
|
54
|
+
"@gjsify/utils": "^0.4.0",
|
|
55
55
|
"bit-twiddle": "^1.0.2",
|
|
56
56
|
"glsl-tokenizer": "^2.1.5"
|
|
57
57
|
}
|