@gjsify/webgl 0.1.2 → 0.1.4
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/canvas-webgl-widget.js +12 -0
- package/lib/esm/conformance/attribs.spec.js +296 -0
- package/lib/esm/conformance/buffers.spec.js +203 -0
- package/lib/esm/conformance/context.spec.js +302 -0
- package/lib/esm/conformance/programs.spec.js +468 -0
- package/lib/esm/conformance/rendering-basic.spec.js +136 -0
- package/lib/esm/conformance/rendering.spec.js +424 -0
- package/lib/esm/conformance/setup.js +36 -0
- package/lib/esm/conformance/state.spec.js +348 -0
- package/lib/esm/conformance/textures.spec.js +354 -0
- package/lib/esm/conformance/uniforms.spec.js +305 -0
- package/lib/esm/conformance-test.js +23 -0
- package/lib/esm/extensions/ext-color-buffer-float.js +13 -0
- package/lib/esm/extensions/ext-color-buffer-half-float.js +13 -0
- package/lib/esm/extensions/oes-texture-half-float.js +19 -0
- package/lib/esm/index.js +5 -0
- package/lib/esm/test-utils.js +65 -0
- package/lib/esm/test.js +2 -2
- package/lib/esm/webgl-buffer.js +1 -1
- package/lib/esm/webgl-context-base.js +3371 -0
- package/lib/esm/webgl-framebuffer.js +1 -1
- package/lib/esm/webgl-program.js +1 -1
- package/lib/esm/webgl-renderbuffer.js +1 -1
- package/lib/esm/webgl-rendering-context.js +95 -3253
- package/lib/esm/webgl-shader.js +2 -1
- package/lib/esm/webgl-texture.js +1 -1
- package/lib/esm/{index.spec.js → webgl1.spec.js} +2 -2
- package/lib/esm/webgl2-rendering-context.js +617 -27
- package/lib/esm/webgl2.spec.js +573 -1
- package/lib/types/conformance/setup.d.ts +14 -0
- package/lib/types/extensions/ext-blend-minmax.d.ts +2 -2
- package/lib/types/extensions/ext-color-buffer-float.d.ts +4 -0
- package/lib/types/extensions/ext-color-buffer-half-float.d.ts +4 -0
- package/lib/types/extensions/ext-texture-filter-anisotropic.d.ts +2 -2
- package/lib/types/extensions/oes-element-index-unit.d.ts +2 -2
- package/lib/types/extensions/oes-standard-derivatives.d.ts +2 -2
- package/lib/types/extensions/oes-texture-float-linear.d.ts +2 -2
- package/lib/types/extensions/oes-texture-float.d.ts +2 -2
- package/lib/types/extensions/oes-texture-half-float.d.ts +5 -0
- package/lib/types/extensions/stackgl-destroy-context.d.ts +3 -3
- package/lib/types/extensions/stackgl-resize-drawing-buffer.d.ts +3 -3
- package/lib/types/index.d.ts +1 -0
- package/lib/types/test-utils.d.ts +24 -0
- package/lib/types/types/extension.d.ts +2 -2
- package/lib/types/utils.d.ts +9 -10
- package/lib/types/webgl-buffer.d.ts +3 -3
- package/lib/types/webgl-context-base.d.ts +267 -0
- package/lib/types/webgl-framebuffer.d.ts +3 -3
- package/lib/types/webgl-program.d.ts +3 -3
- package/lib/types/webgl-renderbuffer.d.ts +3 -3
- package/lib/types/webgl-rendering-context.d.ts +5 -250
- package/lib/types/webgl-shader.d.ts +4 -3
- package/lib/types/webgl-texture-unit.d.ts +3 -3
- package/lib/types/webgl-texture.d.ts +3 -3
- package/lib/types/webgl-vertex-attribute.d.ts +5 -5
- package/lib/types/webgl2-rendering-context.d.ts +95 -6
- package/package.json +13 -11
- package/prebuilds/linux-x86_64/Gwebgl-0.1.typelib +0 -0
- package/prebuilds/linux-x86_64/libgwebgl.so +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLContextBase } from '../webgl-context-base.js';
|
|
2
2
|
export declare class STACKGLDestroyContext {
|
|
3
3
|
destroy: () => void;
|
|
4
|
-
constructor(ctx:
|
|
4
|
+
constructor(ctx: WebGLContextBase);
|
|
5
5
|
}
|
|
6
|
-
export declare function getSTACKGLDestroyContext(ctx:
|
|
6
|
+
export declare function getSTACKGLDestroyContext(ctx: WebGLContextBase): STACKGLDestroyContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLContextBase } from '../webgl-context-base.js';
|
|
2
2
|
export declare class STACKGLResizeDrawingBuffer {
|
|
3
3
|
resize: (width: number, height: number) => void;
|
|
4
|
-
constructor(ctx:
|
|
4
|
+
constructor(ctx: WebGLContextBase);
|
|
5
5
|
}
|
|
6
|
-
export declare function getSTACKGLResizeDrawingBuffer(ctx:
|
|
6
|
+
export declare function getSTACKGLResizeDrawingBuffer(ctx: WebGLContextBase): STACKGLResizeDrawingBuffer;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './webgl-framebuffer.js';
|
|
|
11
11
|
export * from './webgl-program.js';
|
|
12
12
|
export * from './webgl-renderbuffer.js';
|
|
13
13
|
export * from './webgl-query.js';
|
|
14
|
+
export * from './webgl-context-base.js';
|
|
14
15
|
export * from './webgl-rendering-context.js';
|
|
15
16
|
export * from './webgl-sampler.js';
|
|
16
17
|
export * from './webgl-shader-precision-format.js';
|
|
@@ -43,3 +43,27 @@ export declare function makeTestFBOWithDepth(gl: WebGLRenderingContext, width?:
|
|
|
43
43
|
export declare function destroyTestFBO(gl: WebGLRenderingContext, fbo: TestFBO): void;
|
|
44
44
|
/** Unbind the FBO and delete both the color texture and depth renderbuffer. */
|
|
45
45
|
export declare function destroyTestFBOWithDepth(gl: WebGLRenderingContext, fbo: TestFBOWithDepth): void;
|
|
46
|
+
export interface TestFBOFloat {
|
|
47
|
+
fb: WebGLFramebuffer;
|
|
48
|
+
colorTex: WebGLTexture;
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a w×h RGBA16F FBO (half-float color texture) and bind it.
|
|
54
|
+
* Used for testing Three.js post-processing render target patterns.
|
|
55
|
+
*/
|
|
56
|
+
export declare function makeTestFBOFloat(gl: WebGL2RenderingContext, width?: number, height?: number): TestFBOFloat;
|
|
57
|
+
export interface TestFBOWithDepthTexture extends TestFBO {
|
|
58
|
+
depthTex: WebGLTexture;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Create a w×h RGBA8 FBO with a DEPTH_COMPONENT24 texture attachment.
|
|
62
|
+
* Three.js uses depth textures (not renderbuffers) for RenderPixelatedPass.
|
|
63
|
+
*/
|
|
64
|
+
export declare function makeTestFBOWithDepthTexture(gl: WebGL2RenderingContext, width?: number, height?: number): TestFBOWithDepthTexture;
|
|
65
|
+
/** WebGL2 passthrough texture shader (samples texture at UV and outputs it). */
|
|
66
|
+
export declare const TEXTURE_VS_300 = "#version 300 es\nin vec2 position;\nout vec2 vUv;\nvoid main() {\n vUv = position * 0.5 + 0.5;\n gl_Position = vec4(position, 0.0, 1.0);\n}";
|
|
67
|
+
export declare const TEXTURE_FS_300 = "#version 300 es\nprecision mediump float;\nuniform sampler2D uTexture;\nin vec2 vUv;\nout vec4 fragColor;\nvoid main() {\n fragColor = texture(uTexture, vUv);\n}";
|
|
68
|
+
/** WebGL2 cubemap sampling shader. */
|
|
69
|
+
export declare const CUBEMAP_FS_300 = "#version 300 es\nprecision mediump float;\nuniform samplerCube uCubemap;\nuniform vec3 uDirection;\nout vec4 fragColor;\nvoid main() {\n fragColor = texture(uCubemap, uDirection);\n}";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type ExtensionFactory = (context:
|
|
1
|
+
import type { WebGLContextBase } from '../webgl-context-base.js';
|
|
2
|
+
export type ExtensionFactory = (context: WebGLContextBase) => any | null;
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -2,17 +2,16 @@ import { WebGLUniformLocation } from './webgl-uniform-location.js';
|
|
|
2
2
|
import { WebGLProgram } from './webgl-program.js';
|
|
3
3
|
import GLib from '@girs/glib-2.0';
|
|
4
4
|
import { HTMLImageElement } from "@gjsify/dom-elements";
|
|
5
|
-
import type
|
|
6
|
-
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
5
|
+
import type { WebGLContextBase } from './webgl-context-base.js';
|
|
7
6
|
import type { TypedArray } from './types/index.js';
|
|
8
|
-
export declare function bindPublics(props: Array<keyof
|
|
7
|
+
export declare function bindPublics(props: Array<keyof WebGLContextBase>, wrapper: WebGLContextBase, privateInstance: WebGLContextBase, privateMethods: string[]): void;
|
|
9
8
|
export declare function checkObject(object: any): boolean;
|
|
10
9
|
export declare function checkUniform(program: WebGLProgram, location: WebGLUniformLocation): boolean;
|
|
11
10
|
export declare function isTypedArray(data: TypedArray): data is Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike> | Int8Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>;
|
|
12
11
|
export declare function isValidString(str: string): boolean;
|
|
13
|
-
export declare function vertexCount(gl:
|
|
14
|
-
export declare function typeSize(gl:
|
|
15
|
-
export declare function uniformTypeSize(gl:
|
|
12
|
+
export declare function vertexCount(gl: WebGLContextBase, primitive: GLenum, count: number): number;
|
|
13
|
+
export declare function typeSize(gl: WebGLContextBase, type: GLenum): 0 | 1 | 2 | 4;
|
|
14
|
+
export declare function uniformTypeSize(gl: WebGLContextBase, type: GLenum): 0 | 1 | 2 | 3 | 4;
|
|
16
15
|
export declare const listToArray: (values: Float32List) => number[];
|
|
17
16
|
export declare function arrayToUint8Array(array: TypedArray | Float32List | Array<number> | ArrayBuffer | DataView): Uint8Array<ArrayBufferLike>;
|
|
18
17
|
export declare function Uint8ArrayToVariant(array: Uint8Array | null): GLib.Variant<"ay">;
|
|
@@ -24,8 +23,8 @@ export declare function Uint8ArrayToVariant(array: Uint8Array | null): GLib.Vari
|
|
|
24
23
|
*/
|
|
25
24
|
export declare function boolArray(array: ArrayBufferView): boolean[];
|
|
26
25
|
export declare const extractImageData: (pixels: TexImageSource | HTMLImageElement) => ImageData | null;
|
|
27
|
-
export declare function formatSize(gl:
|
|
26
|
+
export declare function formatSize(gl: WebGLContextBase, internalFormat: number): 0 | 1 | 2 | 3 | 4;
|
|
28
27
|
export declare function convertPixels(pixels: ArrayBuffer | Uint8Array | Uint16Array | Uint8ClampedArray | Float32Array | Buffer | ArrayBufferView | null): Uint8Array<ArrayBufferLike>;
|
|
29
|
-
export declare function checkFormat(gl:
|
|
30
|
-
export declare function validCubeTarget(gl:
|
|
31
|
-
export declare function flag<T =
|
|
28
|
+
export declare function checkFormat(gl: WebGLContextBase, format: GLenum): format is 6406 | 6407 | 6408 | 6409 | 6410;
|
|
29
|
+
export declare function validCubeTarget(gl: WebGLContextBase, target: GLenum): target is 34069 | 34070 | 34071 | 34072 | 34073 | 34074;
|
|
30
|
+
export declare function flag<T = Record<string, any>>(options: T, name: keyof T, dflt: boolean): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { WebGLContextBase } from './webgl-context-base.js';
|
|
3
3
|
export declare class WebGLBuffer extends Linkable implements WebGLBuffer {
|
|
4
|
-
_ctx:
|
|
4
|
+
_ctx: WebGLContextBase;
|
|
5
5
|
_size: number;
|
|
6
6
|
_elements: Uint8Array<ArrayBuffer>;
|
|
7
|
-
constructor(_: number, ctx:
|
|
7
|
+
constructor(_: number, ctx: WebGLContextBase);
|
|
8
8
|
_performDelete(): void;
|
|
9
9
|
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import '@girs/gdkpixbuf-2.0';
|
|
2
|
+
import Gwebgl from '@girs/gwebgl-0.1';
|
|
3
|
+
import GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
|
|
4
|
+
import { WebGLContextAttributes } from './webgl-context-attributes.js';
|
|
5
|
+
import { HTMLCanvasElement } from './html-canvas-element.js';
|
|
6
|
+
import { WebGLActiveInfo } from './webgl-active-info.js';
|
|
7
|
+
import { WebGLFramebuffer } from './webgl-framebuffer.js';
|
|
8
|
+
import { WebGLBuffer } from './webgl-buffer.js';
|
|
9
|
+
import { WebGLDrawingBufferWrapper } from './webgl-drawing-buffer-wrapper.js';
|
|
10
|
+
import { WebGLProgram } from './webgl-program.js';
|
|
11
|
+
import { WebGLRenderbuffer } from './webgl-renderbuffer.js';
|
|
12
|
+
import { WebGLShader } from './webgl-shader.js';
|
|
13
|
+
import { WebGLShaderPrecisionFormat } from './webgl-shader-precision-format.js';
|
|
14
|
+
import { WebGLTextureUnit } from './webgl-texture-unit.js';
|
|
15
|
+
import { WebGLTexture } from './webgl-texture.js';
|
|
16
|
+
import { WebGLUniformLocation } from './webgl-uniform-location.js';
|
|
17
|
+
import { WebGLVertexArrayObjectState, WebGLVertexArrayGlobalState } from './webgl-vertex-attribute.js';
|
|
18
|
+
import type { TypedArray, WebGLConstants } from './types/index.js';
|
|
19
|
+
export interface WebGLContextBase extends WebGLConstants {
|
|
20
|
+
}
|
|
21
|
+
export declare abstract class WebGLContextBase {
|
|
22
|
+
canvas: HTMLCanvasElement;
|
|
23
|
+
/** TODO implement this: https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawingBufferColorSpace */
|
|
24
|
+
drawingBufferColorSpace: PredefinedColorSpace;
|
|
25
|
+
unpackColorSpace: PredefinedColorSpace;
|
|
26
|
+
readonly RGBA8: 32856;
|
|
27
|
+
get drawingBufferHeight(): number;
|
|
28
|
+
get drawingBufferWidth(): number;
|
|
29
|
+
DEFAULT_ATTACHMENTS: number[];
|
|
30
|
+
DEFAULT_COLOR_ATTACHMENTS: number[];
|
|
31
|
+
/** context counter */
|
|
32
|
+
_: number;
|
|
33
|
+
abstract get _gl(): Gwebgl.WebGLRenderingContextBase;
|
|
34
|
+
_contextAttributes: WebGLContextAttributes;
|
|
35
|
+
_extensions: Record<string, any>;
|
|
36
|
+
_programs: Record<number, WebGLProgram>;
|
|
37
|
+
_shaders: Record<number, WebGLShader>;
|
|
38
|
+
_textures: Record<number, WebGLTexture>;
|
|
39
|
+
_framebuffers: Record<number, WebGLFramebuffer>;
|
|
40
|
+
_renderbuffers: Record<number, WebGLRenderbuffer>;
|
|
41
|
+
_buffers: Record<number, WebGLBuffer>;
|
|
42
|
+
_activeProgram: WebGLProgram | null;
|
|
43
|
+
_activeFramebuffer: WebGLFramebuffer | null;
|
|
44
|
+
_activeRenderbuffer: WebGLRenderbuffer | null;
|
|
45
|
+
_checkStencil: boolean;
|
|
46
|
+
_stencilState: boolean;
|
|
47
|
+
_activeTextureUnit: number;
|
|
48
|
+
_errorStack: GLenum[];
|
|
49
|
+
_defaultVertexObjectState: WebGLVertexArrayObjectState;
|
|
50
|
+
_vertexObjectState: WebGLVertexArrayObjectState;
|
|
51
|
+
_vertexGlobalState: WebGLVertexArrayGlobalState;
|
|
52
|
+
_maxTextureSize: number;
|
|
53
|
+
_maxTextureLevel: number;
|
|
54
|
+
_maxCubeMapSize: number;
|
|
55
|
+
_maxCubeMapLevel: number;
|
|
56
|
+
_unpackAlignment: number;
|
|
57
|
+
_packAlignment: number;
|
|
58
|
+
_unpackFlipY: boolean;
|
|
59
|
+
_viewport: Int32Array;
|
|
60
|
+
_scissorBox: Int32Array;
|
|
61
|
+
_gtkFboId: number;
|
|
62
|
+
_textureUnits: WebGLTextureUnit[];
|
|
63
|
+
_drawingBuffer: WebGLDrawingBufferWrapper | null;
|
|
64
|
+
protected constructor(canvas: HTMLCanvasElement | null, options?: Record<string, any>);
|
|
65
|
+
/**
|
|
66
|
+
* Must be called by subclass constructors AFTER setting up the native GL object
|
|
67
|
+
* so that `this._gl` is available for GL-dependent initialization.
|
|
68
|
+
*/
|
|
69
|
+
protected _init(): void;
|
|
70
|
+
_initGLConstants(): void;
|
|
71
|
+
_getGlslVersion(es: boolean): string;
|
|
72
|
+
_checkDimensions(target: GLenum, width: GLsizei, height: GLsizei, level: number): boolean;
|
|
73
|
+
_checkLocation(location: WebGLUniformLocation | null): boolean;
|
|
74
|
+
_checkLocationActive(location: WebGLUniformLocation | null): boolean;
|
|
75
|
+
_checkOwns(object: any): boolean;
|
|
76
|
+
_checkShaderSource(shader: WebGLShader): boolean;
|
|
77
|
+
_checkStencilState(): boolean;
|
|
78
|
+
_checkTextureTarget(target: GLenum): boolean;
|
|
79
|
+
_checkWrapper(object: any, Wrapper: any): boolean;
|
|
80
|
+
_checkValid(object: any, Type: any): boolean;
|
|
81
|
+
_checkVertexAttribState(maxIndex: number): boolean;
|
|
82
|
+
_checkVertexIndex(index: number): boolean;
|
|
83
|
+
_computePixelSize(type: GLenum, internalFormat: GLenum): 0 | 1 | 2 | 3 | 4;
|
|
84
|
+
_computeRowStride(width: number, pixelSize: number): number;
|
|
85
|
+
_fixupLink(program: WebGLProgram): boolean;
|
|
86
|
+
_framebufferOk(): boolean;
|
|
87
|
+
_getActiveBuffer(target: GLenum): WebGLBuffer;
|
|
88
|
+
_getActiveTextureUnit(): WebGLTextureUnit;
|
|
89
|
+
_getActiveTexture(target: GLenum): WebGLTexture;
|
|
90
|
+
_getAttachments(): any;
|
|
91
|
+
_getColorAttachments(): any;
|
|
92
|
+
_getParameterDirect(pname: GLenum): any;
|
|
93
|
+
_getTexImage(target: GLenum): WebGLTexture;
|
|
94
|
+
_preCheckFramebufferStatus(framebuffer: WebGLFramebuffer): GLenum;
|
|
95
|
+
_isConstantBlendFunc(factor: GLenum): factor is 32769 | 32770 | 32771 | 32772;
|
|
96
|
+
_isObject(object: any, method: any, Wrapper: any): boolean;
|
|
97
|
+
_resizeDrawingBuffer(width: number, height: number): void;
|
|
98
|
+
_restoreError(lastError: GLenum): void;
|
|
99
|
+
_saveError(): void;
|
|
100
|
+
_switchActiveProgram(active: WebGLProgram | null): void;
|
|
101
|
+
_tryDetachFramebuffer(framebuffer: WebGLFramebuffer | null, renderbuffer: WebGLRenderbuffer): void;
|
|
102
|
+
_updateFramebufferAttachments(framebuffer: WebGLFramebuffer | null): void;
|
|
103
|
+
_validBlendFunc(factor: GLenum): factor is 0 | 1 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 32769 | 32770 | 32771 | 32772;
|
|
104
|
+
_validBlendMode(mode: GLenum): boolean;
|
|
105
|
+
_validCubeTarget(target: GLenum): target is 34069 | 34070 | 34071 | 34072 | 34073 | 34074;
|
|
106
|
+
_validFramebufferAttachment(attachment: GLenum): boolean;
|
|
107
|
+
_validGLSLIdentifier(str: string): boolean;
|
|
108
|
+
_validTextureTarget(target: GLenum): target is 3553 | 34067;
|
|
109
|
+
_verifyTextureCompleteness(target: GLenum, pname: GLenum, param: GLenum): void;
|
|
110
|
+
_wrapShader(_type: GLenum, source: string): string;
|
|
111
|
+
_allocateDrawingBuffer(width: number, height: number): void;
|
|
112
|
+
/**
|
|
113
|
+
* The `WebGLRenderingContext.getContextAttributes()` method returns a `WebGLContextAttributes` object that contains the actual context parameters.
|
|
114
|
+
* Might return `null`, if the context is lost.
|
|
115
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getContextAttributes
|
|
116
|
+
* @returns A `WebGLContextAttributes` object that contains the actual context parameters, or `null` if the context is lost.
|
|
117
|
+
*/
|
|
118
|
+
getContextAttributes(): WebGLContextAttributes | null;
|
|
119
|
+
getExtension(name: string): any;
|
|
120
|
+
bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;
|
|
121
|
+
bufferData(target: GLenum, data: BufferSource | null, usage: GLenum): void;
|
|
122
|
+
bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource): void;
|
|
123
|
+
compressedTexImage2D(target: GLenum, level: GLint, internalFormat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: TypedArray): void;
|
|
124
|
+
compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: TypedArray): void;
|
|
125
|
+
readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: TypedArray | null): void;
|
|
126
|
+
texImage2D(target: GLenum, level: GLint, internalFormat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
|
|
127
|
+
texImage2D(target: GLenum, level: GLint, internalFormat: GLint, format: GLenum, type: GLenum, source: TexImageSource | GdkPixbuf.Pixbuf): void;
|
|
128
|
+
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
|
|
129
|
+
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource | GdkPixbuf.Pixbuf): void;
|
|
130
|
+
_checkUniformValid(location: WebGLUniformLocation | null, v0: GLfloat, name: string, count: number, type: string): boolean;
|
|
131
|
+
_checkUniformValueValid(location: WebGLUniformLocation | null, value: Float32List | Int32List, name: string, count: number, _type: string): boolean;
|
|
132
|
+
uniform1fv(location: WebGLUniformLocation | null, value: Float32List | Int32List): void;
|
|
133
|
+
uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
134
|
+
uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void;
|
|
135
|
+
uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
136
|
+
uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void;
|
|
137
|
+
uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
138
|
+
uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void;
|
|
139
|
+
uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void;
|
|
140
|
+
_checkUniformMatrix(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List, name: string, count: number): boolean;
|
|
141
|
+
uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
|
142
|
+
uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
|
143
|
+
uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
|
144
|
+
activeTexture(texture?: GLenum): void;
|
|
145
|
+
attachShader(program: WebGLProgram, shader: WebGLShader): void;
|
|
146
|
+
bindAttribLocation(program: WebGLProgram, index: GLuint, name: string): void;
|
|
147
|
+
bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void;
|
|
148
|
+
bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null): void;
|
|
149
|
+
bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
|
|
150
|
+
bindTexture(target: GLenum, texture: WebGLTexture | null): void;
|
|
151
|
+
blendColor(red?: GLclampf, green?: GLclampf, blue?: GLclampf, alpha?: GLclampf): void;
|
|
152
|
+
blendEquation(mode?: GLenum): void;
|
|
153
|
+
blendEquationSeparate(modeRGB?: GLenum, modeAlpha?: GLenum): void;
|
|
154
|
+
blendFunc(sfactor?: GLenum, dfactor?: GLenum): void;
|
|
155
|
+
blendFuncSeparate(srcRGB?: GLenum, dstRGB?: GLenum, srcAlpha?: GLenum, dstAlpha?: GLenum): void;
|
|
156
|
+
checkFramebufferStatus(target: GLenum): GLenum;
|
|
157
|
+
clear(mask?: GLbitfield): void;
|
|
158
|
+
clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;
|
|
159
|
+
clearDepth(depth: GLclampf): void;
|
|
160
|
+
clearStencil(s?: GLint): void;
|
|
161
|
+
colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean): void;
|
|
162
|
+
compileShader(shader: WebGLShader): void;
|
|
163
|
+
copyTexImage2D(target?: GLenum, level?: GLint, internalFormat?: GLenum, x?: GLint, y?: GLint, width?: GLsizei, height?: GLsizei, border?: GLint): void;
|
|
164
|
+
copyTexSubImage2D(target?: GLenum, level?: GLint, xoffset?: GLint, yoffset?: GLint, x?: GLint, y?: GLint, width?: GLsizei, height?: GLsizei): void;
|
|
165
|
+
createBuffer(): WebGLBuffer | null;
|
|
166
|
+
createFramebuffer(): WebGLFramebuffer | null;
|
|
167
|
+
createProgram(): WebGLProgram | null;
|
|
168
|
+
createRenderbuffer(): WebGLRenderbuffer | null;
|
|
169
|
+
createShader(type?: GLenum): WebGLShader | null;
|
|
170
|
+
createTexture(): WebGLTexture | null;
|
|
171
|
+
cullFace(mode: GLenum): void;
|
|
172
|
+
deleteBuffer(buffer: WebGLBuffer | null): void;
|
|
173
|
+
deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;
|
|
174
|
+
_deleteLinkable(name: 'deleteProgram', object: WebGLProgram | null, Type: typeof WebGLProgram): void;
|
|
175
|
+
_deleteLinkable(name: 'deleteShader', object: WebGLShader | null, Type: typeof WebGLShader): void;
|
|
176
|
+
deleteProgram(program: WebGLProgram | null): void;
|
|
177
|
+
deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;
|
|
178
|
+
deleteShader(shader: WebGLShader | null): void;
|
|
179
|
+
deleteTexture(texture: WebGLTexture | null): void;
|
|
180
|
+
depthFunc(func: GLenum): void;
|
|
181
|
+
depthMask(flag: GLboolean): void;
|
|
182
|
+
depthRange(zNear: GLclampf, zFar: GLclampf): void;
|
|
183
|
+
destroy(): void;
|
|
184
|
+
detachShader(program: WebGLProgram, shader: WebGLShader): void;
|
|
185
|
+
disable(cap?: GLenum): void;
|
|
186
|
+
disableVertexAttribArray(index?: GLuint): void;
|
|
187
|
+
drawArrays(mode?: GLenum, first?: GLint, count?: GLsizei): void;
|
|
188
|
+
drawElements(mode?: GLenum, count?: GLsizei, type?: GLenum, ioffset?: GLintptr): void;
|
|
189
|
+
enable(cap?: GLenum): void;
|
|
190
|
+
enableVertexAttribArray(index: GLuint): void;
|
|
191
|
+
finish(): void;
|
|
192
|
+
flush(): void;
|
|
193
|
+
framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbufferTarget: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
|
|
194
|
+
framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level?: GLint): void;
|
|
195
|
+
frontFace(mode?: GLenum): void;
|
|
196
|
+
generateMipmap(target?: GLenum): void;
|
|
197
|
+
getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
|
|
198
|
+
getActiveUniform(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
|
|
199
|
+
getAttachedShaders(program: WebGLProgram): WebGLShader[] | null;
|
|
200
|
+
getAttribLocation(program: WebGLProgram, name: string): GLint;
|
|
201
|
+
getBufferParameter(target?: GLenum, pname?: GLenum): any;
|
|
202
|
+
getError(): GLenum;
|
|
203
|
+
setError(error: GLenum): void;
|
|
204
|
+
getFramebufferAttachmentParameter(target?: GLenum, attachment?: GLenum, pname?: GLenum): any;
|
|
205
|
+
getParameter(pname?: GLenum): any;
|
|
206
|
+
getProgramInfoLog(program: WebGLProgram): string | null;
|
|
207
|
+
getProgramParameter(program: WebGLProgram, pname?: GLenum): any;
|
|
208
|
+
getRenderbufferParameter(target?: GLenum, pname?: GLenum): any;
|
|
209
|
+
getShaderInfoLog(shader: WebGLShader): string | null;
|
|
210
|
+
getShaderParameter(shader: WebGLShader, pname?: GLenum): any;
|
|
211
|
+
getShaderPrecisionFormat(shaderType?: GLenum, precisionType?: GLenum): WebGLShaderPrecisionFormat | null;
|
|
212
|
+
getShaderSource(shader: WebGLShader): string | null;
|
|
213
|
+
getSupportedExtensions(): string[];
|
|
214
|
+
_getTexParameterDirect(target?: GLenum, pname?: GLenum): unknown;
|
|
215
|
+
getTexParameter(target?: GLenum, pname?: GLenum): any;
|
|
216
|
+
getUniform(program: WebGLProgram, location: WebGLUniformLocation): any;
|
|
217
|
+
getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation | null;
|
|
218
|
+
getVertexAttrib(index?: GLuint, pname?: GLenum): any;
|
|
219
|
+
getVertexAttribOffset(index?: GLuint, pname?: GLenum): GLintptr;
|
|
220
|
+
hint(target?: GLenum, mode?: GLenum): void;
|
|
221
|
+
isBuffer(buffer: WebGLBuffer): GLboolean;
|
|
222
|
+
isContextLost(): boolean;
|
|
223
|
+
isEnabled(cap?: GLenum): GLboolean;
|
|
224
|
+
isFramebuffer(framebuffer: WebGLShader): GLboolean;
|
|
225
|
+
isProgram(program: WebGLProgram): GLboolean;
|
|
226
|
+
isRenderbuffer(renderbuffer: WebGLRenderbuffer): GLboolean;
|
|
227
|
+
isShader(shader: WebGLShader): GLboolean;
|
|
228
|
+
isTexture(texture: WebGLTexture): GLboolean;
|
|
229
|
+
lineWidth(width: GLfloat): void;
|
|
230
|
+
linkProgram(program: WebGLProgram): void;
|
|
231
|
+
/** The `WebGLRenderingContext.pixelStorei()` method of the WebGL API specifies the pixel storage modes. */
|
|
232
|
+
pixelStorei(pname?: GLenum, param?: GLint | GLboolean): void;
|
|
233
|
+
polygonOffset(factor: GLfloat, units: GLfloat): void;
|
|
234
|
+
renderbufferStorage(target?: GLenum, internalFormat?: GLenum, width?: GLsizei, height?: GLsizei): void;
|
|
235
|
+
resize(width?: number, height?: number): void;
|
|
236
|
+
sampleCoverage(value: GLclampf, invert: GLboolean): void;
|
|
237
|
+
scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
|
238
|
+
shaderSource(shader: WebGLShader, source: string): void;
|
|
239
|
+
stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void;
|
|
240
|
+
stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint): void;
|
|
241
|
+
stencilMask(mask: GLuint): void;
|
|
242
|
+
stencilMaskSeparate(face: GLenum, mask: GLuint): void;
|
|
243
|
+
stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void;
|
|
244
|
+
stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum): void;
|
|
245
|
+
texParameterf(target: GLenum, pname: GLenum, param: GLfloat): void;
|
|
246
|
+
texParameteri(target?: GLenum, pname?: GLenum, param?: GLint): void;
|
|
247
|
+
uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void;
|
|
248
|
+
uniform1i(location: WebGLUniformLocation | null, x: GLint): void;
|
|
249
|
+
uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat): void;
|
|
250
|
+
uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void;
|
|
251
|
+
uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void;
|
|
252
|
+
uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void;
|
|
253
|
+
uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
|
|
254
|
+
uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void;
|
|
255
|
+
useProgram(program: WebGLProgram): void;
|
|
256
|
+
validateProgram(program: WebGLProgram): void;
|
|
257
|
+
vertexAttrib1f(index: GLuint, x: GLfloat): void;
|
|
258
|
+
vertexAttrib1fv(index: GLuint, values: Float32List): void;
|
|
259
|
+
vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void;
|
|
260
|
+
vertexAttrib2fv(index: GLuint, values: Float32List): void;
|
|
261
|
+
vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void;
|
|
262
|
+
vertexAttrib3fv(index: GLuint, values: Float32List): void;
|
|
263
|
+
vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
|
|
264
|
+
vertexAttrib4fv(index: GLuint, values: Float32List): void;
|
|
265
|
+
vertexAttribPointer(index?: GLuint, size?: GLint, type?: GLenum, normalized?: GLboolean, stride?: GLsizei, offset?: GLintptr): void;
|
|
266
|
+
viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
|
267
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { WebGLContextBase } from './webgl-context-base.js';
|
|
3
3
|
export declare class WebGLFramebuffer extends Linkable implements WebGLFramebuffer {
|
|
4
|
-
_ctx:
|
|
4
|
+
_ctx: WebGLContextBase;
|
|
5
5
|
_binding: number;
|
|
6
6
|
_width: number;
|
|
7
7
|
_height: number;
|
|
@@ -9,7 +9,7 @@ export declare class WebGLFramebuffer extends Linkable implements WebGLFramebuff
|
|
|
9
9
|
_attachments: Record<GLenum, WebGLTexture | WebGLRenderbuffer | null>;
|
|
10
10
|
_attachmentLevel: Record<GLenum, number | null>;
|
|
11
11
|
_attachmentFace: Record<GLenum, number | null>;
|
|
12
|
-
constructor(_: number, ctx:
|
|
12
|
+
constructor(_: number, ctx: WebGLContextBase);
|
|
13
13
|
_clearAttachment(attachment: GLenum): void;
|
|
14
14
|
_setAttachment(object: WebGLTexture | WebGLRenderbuffer | null, attachment: GLenum): void;
|
|
15
15
|
_performDelete(): void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
2
|
import { WebGLActiveInfo } from './webgl-active-info.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { WebGLContextBase } from './webgl-context-base.js';
|
|
4
4
|
export declare class WebGLProgram extends Linkable implements WebGLProgram {
|
|
5
|
-
_ctx:
|
|
5
|
+
_ctx: WebGLContextBase;
|
|
6
6
|
_linkCount: number;
|
|
7
7
|
_linkStatus: boolean;
|
|
8
8
|
_linkInfoLog: string | null;
|
|
9
9
|
_attributes: number[];
|
|
10
10
|
_uniforms: WebGLActiveInfo[];
|
|
11
|
-
constructor(_: number, ctx:
|
|
11
|
+
constructor(_: number, ctx: WebGLContextBase);
|
|
12
12
|
_performDelete(): void;
|
|
13
13
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { WebGLContextBase } from './webgl-context-base.js';
|
|
3
3
|
export declare class WebGLRenderbuffer extends Linkable implements WebGLRenderbuffer {
|
|
4
|
-
_ctx:
|
|
4
|
+
_ctx: WebGLContextBase;
|
|
5
5
|
_binding: number;
|
|
6
6
|
_width: number;
|
|
7
7
|
_height: number;
|
|
8
8
|
_format: number;
|
|
9
|
-
constructor(_: number, ctx:
|
|
9
|
+
constructor(_: number, ctx: WebGLContextBase);
|
|
10
10
|
_performDelete(): void;
|
|
11
11
|
}
|