@gjsify/webgl 0.0.4 → 0.1.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/README.md +78 -6
- package/lib/esm/canvas-webgl-widget.js +116 -0
- package/lib/esm/html-canvas-element.js +31 -50
- package/lib/esm/index.js +7 -0
- package/lib/esm/index.spec.js +629 -120
- package/lib/esm/test-utils.js +87 -0
- package/lib/esm/test.js +5 -1
- package/lib/esm/utils.js +1 -1
- package/lib/esm/webgl-active-info.js +2 -2
- package/lib/esm/webgl-buffer.js +2 -3
- package/lib/esm/webgl-context-attributes.js +2 -3
- package/lib/esm/webgl-framebuffer.js +3 -4
- package/lib/esm/webgl-program.js +2 -3
- package/lib/esm/webgl-query.js +15 -0
- package/lib/esm/webgl-renderbuffer.js +2 -3
- package/lib/esm/webgl-rendering-context.js +105 -101
- package/lib/esm/webgl-sampler.js +15 -0
- package/lib/esm/webgl-shader-precision-format.js +2 -3
- package/lib/esm/webgl-shader.js +2 -3
- package/lib/esm/webgl-sync.js +15 -0
- package/lib/esm/webgl-texture.js +2 -3
- package/lib/esm/webgl-transform-feedback.js +15 -0
- package/lib/esm/webgl-uniform-location.js +2 -3
- package/lib/esm/webgl-vertex-array-object.js +21 -0
- package/lib/esm/webgl2-rendering-context.js +591 -0
- package/lib/esm/webgl2.spec.js +578 -0
- package/lib/types/canvas-webgl-widget.d.ts +509 -0
- package/lib/types/extensions/ext-blend-minmax.d.ts +2 -2
- 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/stackgl-destroy-context.d.ts +3 -3
- package/lib/types/extensions/stackgl-resize-drawing-buffer.d.ts +3 -3
- package/lib/types/html-canvas-element.d.ts +19 -31
- package/lib/types/index.d.ts +7 -0
- package/lib/types/test-utils.d.ts +45 -0
- package/lib/types/types/extension.d.ts +2 -2
- package/lib/types/utils.d.ts +14 -15
- package/lib/types/webgl-active-info.d.ts +1 -2
- package/lib/types/webgl-buffer.d.ts +5 -6
- package/lib/types/webgl-context-attributes.d.ts +1 -2
- package/lib/types/webgl-framebuffer.d.ts +4 -5
- package/lib/types/webgl-program.d.ts +4 -5
- package/lib/types/webgl-query.d.ts +7 -0
- package/lib/types/webgl-renderbuffer.d.ts +4 -5
- package/lib/types/webgl-rendering-context.d.ts +15 -13
- package/lib/types/webgl-sampler.d.ts +7 -0
- package/lib/types/webgl-shader-precision-format.d.ts +1 -2
- package/lib/types/webgl-shader.d.ts +4 -5
- package/lib/types/webgl-sync.d.ts +7 -0
- package/lib/types/webgl-texture-unit.d.ts +3 -3
- package/lib/types/webgl-texture.d.ts +6 -7
- package/lib/types/webgl-transform-feedback.d.ts +7 -0
- package/lib/types/webgl-uniform-location.d.ts +3 -4
- package/lib/types/webgl-vertex-array-object.d.ts +9 -0
- package/lib/types/webgl-vertex-attribute.d.ts +5 -5
- package/lib/types/webgl2-rendering-context.d.ts +124 -0
- package/package.json +27 -26
- package/prebuilds/linux-aarch64/Gwebgl-0.1.typelib +0 -0
- package/prebuilds/linux-aarch64/libgwebgl.so +0 -0
- package/prebuilds/linux-x86_64/Gwebgl-0.1.typelib +0 -0
- package/prebuilds/linux-x86_64/libgwebgl.so +0 -0
- package/lib/cjs/@types/glsl-tokenizer/index.d.js +0 -0
- package/lib/cjs/extensions/ext-blend-minmax.js +0 -18
- package/lib/cjs/extensions/ext-texture-filter-anisotropic.js +0 -18
- package/lib/cjs/extensions/oes-element-index-unit.js +0 -14
- package/lib/cjs/extensions/oes-standard-derivatives.js +0 -17
- package/lib/cjs/extensions/oes-texture-float-linear.js +0 -14
- package/lib/cjs/extensions/oes-texture-float.js +0 -14
- package/lib/cjs/extensions/stackgl-destroy-context.js +0 -12
- package/lib/cjs/extensions/stackgl-resize-drawing-buffer.js +0 -12
- package/lib/cjs/html-canvas-element.js +0 -70
- package/lib/cjs/index.js +0 -18
- package/lib/cjs/index.spec.js +0 -146
- package/lib/cjs/linkable.js +0 -50
- package/lib/cjs/test.js +0 -3
- package/lib/cjs/types/constructor.js +0 -0
- package/lib/cjs/types/extension.js +0 -0
- package/lib/cjs/types/index.js +0 -5
- package/lib/cjs/types/typed-array.js +0 -0
- package/lib/cjs/types/webgl-constants.js +0 -0
- package/lib/cjs/types/webgl-context-attribute-options.js +0 -0
- package/lib/cjs/utils.js +0 -212
- package/lib/cjs/webgl-active-info.js +0 -10
- package/lib/cjs/webgl-buffer.js +0 -18
- package/lib/cjs/webgl-context-attributes.js +0 -24
- package/lib/cjs/webgl-drawing-buffer-wrapper.js +0 -10
- package/lib/cjs/webgl-framebuffer.js +0 -109
- package/lib/cjs/webgl-program.js +0 -26
- package/lib/cjs/webgl-renderbuffer.js +0 -24
- package/lib/cjs/webgl-rendering-context.js +0 -3343
- package/lib/cjs/webgl-shader-precision-format.js +0 -11
- package/lib/cjs/webgl-shader.js +0 -23
- package/lib/cjs/webgl-texture-unit.js +0 -12
- package/lib/cjs/webgl-texture.js +0 -22
- package/lib/cjs/webgl-uniform-location.js +0 -15
- package/lib/cjs/webgl-vertex-attribute.js +0 -147
- package/meson.build +0 -39
- package/src/test/app.vala +0 -60
- package/src/ts/@types/glsl-tokenizer/index.d.ts +0 -18
- package/src/ts/extensions/angle-instanced-arrays.ts.off +0 -232
- package/src/ts/extensions/ext-blend-minmax.ts +0 -18
- package/src/ts/extensions/ext-texture-filter-anisotropic.ts +0 -18
- package/src/ts/extensions/oes-element-index-unit.ts +0 -14
- package/src/ts/extensions/oes-standard-derivatives.ts +0 -17
- package/src/ts/extensions/oes-texture-float-linear.ts +0 -14
- package/src/ts/extensions/oes-texture-float.ts +0 -14
- package/src/ts/extensions/oes-vertex-array-object.ts.off +0 -128
- package/src/ts/extensions/stackgl-destroy-context.ts +0 -12
- package/src/ts/extensions/stackgl-resize-drawing-buffer.ts +0 -14
- package/src/ts/extensions/webgl-draw-buffers.ts.off +0 -107
- package/src/ts/html-canvas-element.ts +0 -98
- package/src/ts/index.spec.ts +0 -186
- package/src/ts/index.ts +0 -21
- package/src/ts/linkable.ts +0 -55
- package/src/ts/test.ts +0 -6
- package/src/ts/types/constructor.ts +0 -3
- package/src/ts/types/extension.ts +0 -3
- package/src/ts/types/index.ts +0 -26
- package/src/ts/types/typed-array.ts +0 -1
- package/src/ts/types/webgl-constants.ts +0 -300
- package/src/ts/types/webgl-context-attribute-options.ts +0 -12
- package/src/ts/utils.ts +0 -266
- package/src/ts/webgl-active-info.ts +0 -13
- package/src/ts/webgl-buffer.ts +0 -21
- package/src/ts/webgl-context-attributes.ts +0 -24
- package/src/ts/webgl-drawing-buffer-wrapper.ts +0 -10
- package/src/ts/webgl-framebuffer.ts +0 -133
- package/src/ts/webgl-program.ts +0 -30
- package/src/ts/webgl-renderbuffer.ts +0 -28
- package/src/ts/webgl-rendering-context.ts +0 -4050
- package/src/ts/webgl-shader-precision-format.ts +0 -12
- package/src/ts/webgl-shader.ts +0 -29
- package/src/ts/webgl-texture-unit.ts +0 -16
- package/src/ts/webgl-texture.ts +0 -27
- package/src/ts/webgl-uniform-location.ts +0 -18
- package/src/ts/webgl-vertex-attribute.ts +0 -169
- package/src/vala/handle-types.vala +0 -23
- package/src/vala/webgl-rendering-context-base.vala +0 -1265
- package/src/vala/webgl-rendering-context.vala +0 -265
- package/src/vapi/epoxy.vapi +0 -14558
- package/src/vapi/glesv2.vapi +0 -670
- package/test.gjs.js +0 -39937
- package/test.gjs.js.meta.json +0 -1
- package/tmp/.tsbuildinfo +0 -1
- package/tsconfig.json +0 -38
- package/tsconfig.types.json +0 -7
package/lib/types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import '@girs/gjs';
|
|
|
2
2
|
import '@girs/gio-2.0';
|
|
3
3
|
import '@girs/gtk-4.0';
|
|
4
4
|
export * from './html-canvas-element.js';
|
|
5
|
+
export * from './canvas-webgl-widget.js';
|
|
5
6
|
export * from './webgl-active-info.js';
|
|
6
7
|
export * from './webgl-buffer.js';
|
|
7
8
|
export * from './webgl-context-attributes.js';
|
|
@@ -9,8 +10,14 @@ export * from './webgl-drawing-buffer-wrapper.js';
|
|
|
9
10
|
export * from './webgl-framebuffer.js';
|
|
10
11
|
export * from './webgl-program.js';
|
|
11
12
|
export * from './webgl-renderbuffer.js';
|
|
13
|
+
export * from './webgl-query.js';
|
|
12
14
|
export * from './webgl-rendering-context.js';
|
|
15
|
+
export * from './webgl-sampler.js';
|
|
13
16
|
export * from './webgl-shader-precision-format.js';
|
|
17
|
+
export * from './webgl-sync.js';
|
|
18
|
+
export * from './webgl-transform-feedback.js';
|
|
19
|
+
export * from './webgl-vertex-array-object.js';
|
|
20
|
+
export * from './webgl2-rendering-context.js';
|
|
14
21
|
export * from './webgl-shader.js';
|
|
15
22
|
export * from './webgl-texture-unit.js';
|
|
16
23
|
export * from './webgl-texture.js';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Compile a WebGL shader from source. Does not check compile status. */
|
|
2
|
+
export declare function makeShader(gl: WebGLRenderingContext, type: number, src: string): WebGLShader;
|
|
3
|
+
/**
|
|
4
|
+
* Link a WebGL program from vertex + fragment source strings.
|
|
5
|
+
* Binds attribute "position" to location 0 before linking so that drawTriangle() works
|
|
6
|
+
* without an explicit getAttribLocation() call.
|
|
7
|
+
* Does not check link status — call getProgramParameter(prog, LINK_STATUS) if needed.
|
|
8
|
+
*/
|
|
9
|
+
export declare function makeProgram(gl: WebGLRenderingContext, vsSrc: string, fsSrc: string): WebGLProgram;
|
|
10
|
+
/**
|
|
11
|
+
* Draw a fullscreen triangle using attribute location 0.
|
|
12
|
+
* Covers the entire clip space: vertices at (-2,-2), (-2,4), (4,-2).
|
|
13
|
+
* The active program must expose a vec2 attribute named "position" at location 0
|
|
14
|
+
* (ensured by makeProgram's bindAttribLocation call).
|
|
15
|
+
*/
|
|
16
|
+
export declare function drawTriangle(gl: WebGLRenderingContext): void;
|
|
17
|
+
/** Read a single RGBA pixel at (x, y). Defaults to (0, 0). */
|
|
18
|
+
export declare function readPixel(gl: WebGLRenderingContext, x?: number, y?: number): Uint8Array;
|
|
19
|
+
/** Return true if |a[i] - b[i]| <= tolerance for every RGBA component. */
|
|
20
|
+
export declare function pixelClose(a: Uint8Array, b: number[], tolerance?: number): boolean;
|
|
21
|
+
export interface TestFBO {
|
|
22
|
+
fb: WebGLFramebuffer;
|
|
23
|
+
colorTex: WebGLTexture;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
}
|
|
27
|
+
export interface TestFBOWithDepth extends TestFBO {
|
|
28
|
+
depthRb: WebGLRenderbuffer;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a w×h RGBA8 FBO and bind it as the current framebuffer.
|
|
32
|
+
* Also sets the viewport to (0, 0, w, h).
|
|
33
|
+
* Call destroyTestFBO() when done.
|
|
34
|
+
*/
|
|
35
|
+
export declare function makeTestFBO(gl: WebGLRenderingContext, width?: number, height?: number): TestFBO;
|
|
36
|
+
/**
|
|
37
|
+
* Create a w×h RGBA8 FBO with a DEPTH_COMPONENT16 renderbuffer and bind it.
|
|
38
|
+
* Also sets the viewport to (0, 0, w, h).
|
|
39
|
+
* Call destroyTestFBOWithDepth() when done.
|
|
40
|
+
*/
|
|
41
|
+
export declare function makeTestFBOWithDepth(gl: WebGLRenderingContext, width?: number, height?: number): TestFBOWithDepth;
|
|
42
|
+
/** Unbind the FBO and delete the color texture. */
|
|
43
|
+
export declare function destroyTestFBO(gl: WebGLRenderingContext, fbo: TestFBO): void;
|
|
44
|
+
/** Unbind the FBO and delete both the color texture and depth renderbuffer. */
|
|
45
|
+
export declare function destroyTestFBOWithDepth(gl: WebGLRenderingContext, fbo: TestFBOWithDepth): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type ExtensionFactory = (context:
|
|
1
|
+
import type { WebGLRenderingContext } from '../webgl-rendering-context.js';
|
|
2
|
+
export type ExtensionFactory = (context: WebGLRenderingContext) => any | null;
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
1
|
import { WebGLUniformLocation } from './webgl-uniform-location.js';
|
|
3
2
|
import { WebGLProgram } from './webgl-program.js';
|
|
4
3
|
import GLib from '@girs/glib-2.0';
|
|
5
|
-
import { HTMLImageElement
|
|
4
|
+
import { HTMLImageElement } from "@gjsify/dom-elements";
|
|
6
5
|
import type Gwebgl from '@girs/gwebgl-0.1';
|
|
7
|
-
import type {
|
|
6
|
+
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
8
7
|
import type { TypedArray } from './types/index.js';
|
|
9
|
-
export declare function bindPublics(props: Array<keyof
|
|
8
|
+
export declare function bindPublics(props: Array<keyof WebGLRenderingContext>, wrapper: WebGLRenderingContext, privateInstance: WebGLRenderingContext, privateMethods: string[]): void;
|
|
10
9
|
export declare function checkObject(object: any): boolean;
|
|
11
10
|
export declare function checkUniform(program: WebGLProgram, location: WebGLUniformLocation): boolean;
|
|
12
|
-
export declare function isTypedArray(data: TypedArray):
|
|
11
|
+
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>;
|
|
13
12
|
export declare function isValidString(str: string): boolean;
|
|
14
|
-
export declare function vertexCount(gl:
|
|
15
|
-
export declare function typeSize(gl:
|
|
16
|
-
export declare function uniformTypeSize(gl:
|
|
13
|
+
export declare function vertexCount(gl: WebGLRenderingContext, primitive: GLenum, count: number): number;
|
|
14
|
+
export declare function typeSize(gl: WebGLRenderingContext, type: GLenum): 0 | 1 | 2 | 4;
|
|
15
|
+
export declare function uniformTypeSize(gl: WebGLRenderingContext, type: GLenum): 0 | 1 | 2 | 3 | 4;
|
|
17
16
|
export declare const listToArray: (values: Float32List) => number[];
|
|
18
|
-
export declare function arrayToUint8Array(array: TypedArray | Float32List | Array<number> | ArrayBuffer | DataView): Uint8Array
|
|
19
|
-
export declare function Uint8ArrayToVariant(array: Uint8Array | null): GLib.Variant
|
|
17
|
+
export declare function arrayToUint8Array(array: TypedArray | Float32List | Array<number> | ArrayBuffer | DataView): Uint8Array<ArrayBufferLike>;
|
|
18
|
+
export declare function Uint8ArrayToVariant(array: Uint8Array | null): GLib.Variant<"ay">;
|
|
20
19
|
/**
|
|
21
20
|
* Converts an ArrayBufferView to an array of bools. gjs returns
|
|
22
21
|
* Uint8Array, but the elements are actually 4 bytes each.
|
|
@@ -24,9 +23,9 @@ export declare function Uint8ArrayToVariant(array: Uint8Array | null): GLib.Vari
|
|
|
24
23
|
* @returns
|
|
25
24
|
*/
|
|
26
25
|
export declare function boolArray(array: ArrayBufferView): boolean[];
|
|
27
|
-
export declare const extractImageData: (pixels: TexImageSource |
|
|
28
|
-
export declare function formatSize(gl:
|
|
29
|
-
export declare function convertPixels(pixels: ArrayBuffer | Uint8Array | Uint16Array | Uint8ClampedArray | Float32Array | Buffer | ArrayBufferView | null): Uint8Array
|
|
30
|
-
export declare function checkFormat(gl:
|
|
31
|
-
export declare function validCubeTarget(gl:
|
|
26
|
+
export declare const extractImageData: (pixels: TexImageSource | HTMLImageElement) => ImageData | null;
|
|
27
|
+
export declare function formatSize(gl: WebGLRenderingContext, internalFormat: number): 0 | 1 | 2 | 3 | 4;
|
|
28
|
+
export declare function convertPixels(pixels: ArrayBuffer | Uint8Array | Uint16Array | Uint8ClampedArray | Float32Array | Buffer | ArrayBufferView | null): Uint8Array<ArrayBufferLike>;
|
|
29
|
+
export declare function checkFormat(gl: WebGLRenderingContext, format: GLenum): format is 6406 | 6407 | 6408 | 6409 | 6410;
|
|
30
|
+
export declare function validCubeTarget(gl: WebGLRenderingContext, target: GLenum): target is 34069 | 34070 | 34071 | 34072 | 34073 | 34074;
|
|
32
31
|
export declare function flag<T = Gwebgl.WebGLRenderingContext.ConstructorProperties>(options: T, name: keyof T, dflt: boolean): boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
declare class
|
|
1
|
+
export declare class WebGLActiveInfo implements WebGLActiveInfo {
|
|
2
2
|
size: GLsizei;
|
|
3
3
|
type: GLenum;
|
|
4
4
|
name: string;
|
|
5
5
|
constructor(_: WebGLActiveInfo);
|
|
6
6
|
}
|
|
7
|
-
export { GjsifyWebGLActiveInfo as WebGLActiveInfo };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
|
-
import type {
|
|
3
|
-
export declare class
|
|
4
|
-
_ctx:
|
|
2
|
+
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
3
|
+
export declare class WebGLBuffer extends Linkable implements WebGLBuffer {
|
|
4
|
+
_ctx: WebGLRenderingContext;
|
|
5
5
|
_size: number;
|
|
6
|
-
_elements: Uint8Array
|
|
7
|
-
constructor(_:
|
|
6
|
+
_elements: Uint8Array<ArrayBuffer>;
|
|
7
|
+
constructor(_: number, ctx: WebGLRenderingContext);
|
|
8
8
|
_performDelete(): void;
|
|
9
9
|
}
|
|
10
|
-
export { GjsifyWebGLBuffer as WebGLBuffer };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class WebGLContextAttributes implements WebGLContextAttributes {
|
|
2
2
|
alpha?: boolean;
|
|
3
3
|
depth?: boolean;
|
|
4
4
|
stencil?: boolean;
|
|
@@ -11,4 +11,3 @@ export declare class GjsifyWebGLContextAttributes implements WebGLContextAttribu
|
|
|
11
11
|
powerPreference?: WebGLPowerPreference;
|
|
12
12
|
constructor(alpha?: boolean, depth?: boolean, stencil?: boolean, antialias?: boolean, premultipliedAlpha?: boolean, preserveDrawingBuffer?: boolean, preferLowPowerToHighPerformance?: boolean, failIfMajorPerformanceCaveat?: boolean);
|
|
13
13
|
}
|
|
14
|
-
export { GjsifyWebGLContextAttributes as WebGLContextAttributes };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
|
-
import type {
|
|
3
|
-
export declare class
|
|
4
|
-
_ctx:
|
|
2
|
+
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
3
|
+
export declare class WebGLFramebuffer extends Linkable implements WebGLFramebuffer {
|
|
4
|
+
_ctx: WebGLRenderingContext;
|
|
5
5
|
_binding: number;
|
|
6
6
|
_width: number;
|
|
7
7
|
_height: number;
|
|
@@ -9,9 +9,8 @@ export declare class GjsifyWebGLFramebuffer extends Linkable implements WebGLFra
|
|
|
9
9
|
_attachments: Record<GLenum, WebGLTexture | WebGLRenderbuffer | null>;
|
|
10
10
|
_attachmentLevel: Record<GLenum, number | null>;
|
|
11
11
|
_attachmentFace: Record<GLenum, number | null>;
|
|
12
|
-
constructor(_:
|
|
12
|
+
constructor(_: number, ctx: WebGLRenderingContext);
|
|
13
13
|
_clearAttachment(attachment: GLenum): void;
|
|
14
14
|
_setAttachment(object: WebGLTexture | WebGLRenderbuffer | null, attachment: GLenum): void;
|
|
15
15
|
_performDelete(): void;
|
|
16
16
|
}
|
|
17
|
-
export { GjsifyWebGLFramebuffer as WebGLFramebuffer };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
2
|
import { WebGLActiveInfo } from './webgl-active-info.js';
|
|
3
|
-
import type {
|
|
4
|
-
export declare class
|
|
5
|
-
_ctx:
|
|
3
|
+
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
4
|
+
export declare class WebGLProgram extends Linkable implements WebGLProgram {
|
|
5
|
+
_ctx: WebGLRenderingContext;
|
|
6
6
|
_linkCount: number;
|
|
7
7
|
_linkStatus: boolean;
|
|
8
8
|
_linkInfoLog: string | null;
|
|
9
9
|
_attributes: number[];
|
|
10
10
|
_uniforms: WebGLActiveInfo[];
|
|
11
|
-
constructor(_:
|
|
11
|
+
constructor(_: number, ctx: WebGLRenderingContext);
|
|
12
12
|
_performDelete(): void;
|
|
13
13
|
}
|
|
14
|
-
export { GjsifyWebGLProgram as WebGLProgram };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Linkable } from './linkable.js';
|
|
2
|
+
import type { WebGL2RenderingContext } from './webgl2-rendering-context.js';
|
|
3
|
+
export declare class WebGLQuery extends Linkable implements WebGLQuery {
|
|
4
|
+
_ctx: WebGL2RenderingContext;
|
|
5
|
+
constructor(_: number, ctx: WebGL2RenderingContext);
|
|
6
|
+
_performDelete(): void;
|
|
7
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
|
-
import type {
|
|
3
|
-
export declare class
|
|
4
|
-
_ctx:
|
|
2
|
+
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
3
|
+
export declare class WebGLRenderbuffer extends Linkable implements WebGLRenderbuffer {
|
|
4
|
+
_ctx: WebGLRenderingContext;
|
|
5
5
|
_binding: number;
|
|
6
6
|
_width: number;
|
|
7
7
|
_height: number;
|
|
8
8
|
_format: number;
|
|
9
|
-
constructor(_:
|
|
9
|
+
constructor(_: number, ctx: WebGLRenderingContext);
|
|
10
10
|
_performDelete(): void;
|
|
11
11
|
}
|
|
12
|
-
export { GjsifyWebGLRenderbuffer as WebGLRenderbuffer };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="@girs/gdkpixbuf-2.0/ambient" />
|
|
2
1
|
import '@girs/gdkpixbuf-2.0';
|
|
3
2
|
import Gwebgl from '@girs/gwebgl-0.1';
|
|
4
3
|
import GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
|
|
5
4
|
import { WebGLContextAttributes } from './webgl-context-attributes.js';
|
|
6
|
-
import {
|
|
5
|
+
import { HTMLCanvasElement } from './html-canvas-element.js';
|
|
7
6
|
import { WebGLActiveInfo } from './webgl-active-info.js';
|
|
8
7
|
import { WebGLFramebuffer } from './webgl-framebuffer.js';
|
|
9
8
|
import { WebGLBuffer } from './webgl-buffer.js';
|
|
@@ -17,12 +16,14 @@ import { WebGLTexture } from './webgl-texture.js';
|
|
|
17
16
|
import { WebGLUniformLocation } from './webgl-uniform-location.js';
|
|
18
17
|
import { WebGLVertexArrayObjectState, WebGLVertexArrayGlobalState } from './webgl-vertex-attribute.js';
|
|
19
18
|
import type { TypedArray, WebGLConstants } from './types/index.js';
|
|
20
|
-
export interface
|
|
19
|
+
export interface WebGLRenderingContext extends WebGLConstants {
|
|
21
20
|
}
|
|
22
|
-
export declare class
|
|
23
|
-
canvas:
|
|
21
|
+
export declare class WebGLRenderingContext implements WebGLRenderingContext {
|
|
22
|
+
canvas: HTMLCanvasElement;
|
|
24
23
|
/** TODO implement this: https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawingBufferColorSpace */
|
|
25
24
|
drawingBufferColorSpace: PredefinedColorSpace;
|
|
25
|
+
unpackColorSpace: PredefinedColorSpace;
|
|
26
|
+
readonly RGBA8: 32856;
|
|
26
27
|
get drawingBufferHeight(): number;
|
|
27
28
|
get drawingBufferWidth(): number;
|
|
28
29
|
DEFAULT_ATTACHMENTS: number[];
|
|
@@ -54,12 +55,14 @@ export declare class GjsifyWebGLRenderingContext implements WebGLRenderingContex
|
|
|
54
55
|
_maxCubeMapLevel: number;
|
|
55
56
|
_unpackAlignment: number;
|
|
56
57
|
_packAlignment: number;
|
|
58
|
+
_viewport: Int32Array;
|
|
59
|
+
_scissorBox: Int32Array;
|
|
57
60
|
_attrib0Buffer: WebGLBuffer | null;
|
|
58
61
|
_textureUnits: WebGLTextureUnit[];
|
|
59
62
|
_drawingBuffer: WebGLDrawingBufferWrapper | null;
|
|
60
|
-
constructor(canvas:
|
|
63
|
+
constructor(canvas: HTMLCanvasElement | null, options?: Gwebgl.WebGLRenderingContext.ConstructorProperties);
|
|
61
64
|
_initGLConstants(): void;
|
|
62
|
-
_getGlslVersion(es: boolean):
|
|
65
|
+
_getGlslVersion(es: boolean): string;
|
|
63
66
|
_checkDimensions(target: GLenum, width: GLsizei, height: GLsizei, level: number): boolean;
|
|
64
67
|
_checkLocation(location: WebGLUniformLocation | null): boolean;
|
|
65
68
|
_checkLocationActive(location: WebGLUniformLocation | null): boolean;
|
|
@@ -83,7 +86,7 @@ export declare class GjsifyWebGLRenderingContext implements WebGLRenderingContex
|
|
|
83
86
|
_getParameterDirect(pname: GLenum): any;
|
|
84
87
|
_getTexImage(target: GLenum): WebGLTexture;
|
|
85
88
|
_preCheckFramebufferStatus(framebuffer: WebGLFramebuffer): 36053 | 36054 | 36055 | 36057 | 36061;
|
|
86
|
-
_isConstantBlendFunc(factor: GLenum):
|
|
89
|
+
_isConstantBlendFunc(factor: GLenum): factor is 32769 | 32770 | 32771 | 32772;
|
|
87
90
|
_isObject(object: any, method: any, Wrapper: any): boolean;
|
|
88
91
|
_resizeDrawingBuffer(width: number, height: number): void;
|
|
89
92
|
_restoreError(lastError: GLenum): void;
|
|
@@ -91,12 +94,12 @@ export declare class GjsifyWebGLRenderingContext implements WebGLRenderingContex
|
|
|
91
94
|
_switchActiveProgram(active: WebGLProgram | null): void;
|
|
92
95
|
_tryDetachFramebuffer(framebuffer: WebGLFramebuffer | null, renderbuffer: WebGLRenderbuffer): void;
|
|
93
96
|
_updateFramebufferAttachments(framebuffer: WebGLFramebuffer | null): void;
|
|
94
|
-
_validBlendFunc(factor: GLenum):
|
|
97
|
+
_validBlendFunc(factor: GLenum): factor is 0 | 1 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 32769 | 32770 | 32771 | 32772;
|
|
95
98
|
_validBlendMode(mode: GLenum): boolean;
|
|
96
|
-
_validCubeTarget(target: GLenum):
|
|
99
|
+
_validCubeTarget(target: GLenum): target is 34069 | 34070 | 34071 | 34072 | 34073 | 34074;
|
|
97
100
|
_validFramebufferAttachment(attachment: GLenum): boolean;
|
|
98
101
|
_validGLSLIdentifier(str: string): boolean;
|
|
99
|
-
_validTextureTarget(target: GLenum):
|
|
102
|
+
_validTextureTarget(target: GLenum): target is 3553 | 34067;
|
|
100
103
|
_verifyTextureCompleteness(target: GLenum, pname: GLenum, param: GLenum): void;
|
|
101
104
|
_wrapShader(_type: GLenum, source: string): string;
|
|
102
105
|
_beginAttrib0Hack(): void;
|
|
@@ -111,7 +114,7 @@ export declare class GjsifyWebGLRenderingContext implements WebGLRenderingContex
|
|
|
111
114
|
getContextAttributes(): WebGLContextAttributes | null;
|
|
112
115
|
getExtension(name: string): any;
|
|
113
116
|
bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;
|
|
114
|
-
bufferData(target: GLenum, data:
|
|
117
|
+
bufferData(target: GLenum, data: BufferSource | null, usage: GLenum): void;
|
|
115
118
|
bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource): void;
|
|
116
119
|
compressedTexImage2D(target: GLenum, level: GLint, internalFormat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: TypedArray): void;
|
|
117
120
|
compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: TypedArray): void;
|
|
@@ -258,4 +261,3 @@ export declare class GjsifyWebGLRenderingContext implements WebGLRenderingContex
|
|
|
258
261
|
vertexAttribPointer(index?: GLuint, size?: GLint, type?: GLenum, normalized?: GLboolean, stride?: GLsizei, offset?: GLintptr): void;
|
|
259
262
|
viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
|
260
263
|
}
|
|
261
|
-
export { GjsifyWebGLRenderingContext as WebGLRenderingContext };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Linkable } from './linkable.js';
|
|
2
|
+
import type { WebGL2RenderingContext } from './webgl2-rendering-context.js';
|
|
3
|
+
export declare class WebGLSampler extends Linkable implements WebGLSampler {
|
|
4
|
+
_ctx: WebGL2RenderingContext;
|
|
5
|
+
constructor(_: number, ctx: WebGL2RenderingContext);
|
|
6
|
+
_performDelete(): void;
|
|
7
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class WebGLShaderPrecisionFormat implements WebGLShaderPrecisionFormat {
|
|
2
2
|
rangeMin: number;
|
|
3
3
|
rangeMax: number;
|
|
4
4
|
precision: number;
|
|
5
5
|
constructor(_: WebGLShaderPrecisionFormat);
|
|
6
6
|
}
|
|
7
|
-
export { GjsifyWebGLShaderPrecisionFormat as WebGLShaderPrecisionFormat };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
|
-
import type {
|
|
3
|
-
export declare class
|
|
2
|
+
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
3
|
+
export declare class WebGLShader extends Linkable implements WebGLShader {
|
|
4
4
|
_type: GLenum;
|
|
5
|
-
_ctx:
|
|
5
|
+
_ctx: WebGLRenderingContext;
|
|
6
6
|
_source: string;
|
|
7
7
|
_compileStatus: boolean;
|
|
8
8
|
_compileInfo: string;
|
|
9
|
-
constructor(_:
|
|
9
|
+
constructor(_: number, ctx: WebGLRenderingContext, type: GLenum);
|
|
10
10
|
_performDelete(): void;
|
|
11
11
|
}
|
|
12
|
-
export { GjsifyWebGLShader as WebGLShader };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Linkable } from './linkable.js';
|
|
2
|
+
import type { WebGL2RenderingContext } from './webgl2-rendering-context.js';
|
|
3
|
+
export declare class WebGLSync extends Linkable implements WebGLSync {
|
|
4
|
+
_ctx: WebGL2RenderingContext;
|
|
5
|
+
constructor(_: number, ctx: WebGL2RenderingContext);
|
|
6
|
+
_performDelete(): void;
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
2
2
|
import type { WebGLTexture } from './webgl-texture.js';
|
|
3
3
|
export declare class WebGLTextureUnit {
|
|
4
|
-
_ctx:
|
|
4
|
+
_ctx: WebGLRenderingContext;
|
|
5
5
|
_idx: number;
|
|
6
6
|
_mode: number;
|
|
7
7
|
_bind2D: WebGLTexture | null;
|
|
8
8
|
_bindCube: WebGLTexture | null;
|
|
9
|
-
constructor(ctx:
|
|
9
|
+
constructor(ctx: WebGLRenderingContext, idx: number);
|
|
10
10
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Linkable } from './linkable.js';
|
|
2
|
-
import type {
|
|
3
|
-
export declare class
|
|
4
|
-
_ctx:
|
|
2
|
+
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
3
|
+
export declare class WebGLTexture extends Linkable implements WebGLTexture {
|
|
4
|
+
_ctx: WebGLRenderingContext;
|
|
5
5
|
_binding: number;
|
|
6
|
-
_levelWidth: Int32Array
|
|
7
|
-
_levelHeight: Int32Array
|
|
6
|
+
_levelWidth: Int32Array<ArrayBuffer>;
|
|
7
|
+
_levelHeight: Int32Array<ArrayBuffer>;
|
|
8
8
|
_format: number;
|
|
9
9
|
_type: number;
|
|
10
10
|
_complete: boolean;
|
|
11
|
-
constructor(_:
|
|
11
|
+
constructor(_: number, ctx: WebGLRenderingContext);
|
|
12
12
|
_performDelete(): void;
|
|
13
13
|
}
|
|
14
|
-
export { GjsifyWebGLTexture as WebGLTexture };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Linkable } from './linkable.js';
|
|
2
|
+
import type { WebGL2RenderingContext } from './webgl2-rendering-context.js';
|
|
3
|
+
export declare class WebGLTransformFeedback extends Linkable implements WebGLTransformFeedback {
|
|
4
|
+
_ctx: WebGL2RenderingContext;
|
|
5
|
+
constructor(_: number, ctx: WebGL2RenderingContext);
|
|
6
|
+
_performDelete(): void;
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WebGLProgram } from './webgl-program.js';
|
|
2
|
-
export declare class
|
|
3
|
-
_:
|
|
2
|
+
export declare class WebGLUniformLocation implements WebGLUniformLocation {
|
|
3
|
+
_: number;
|
|
4
4
|
_program: WebGLProgram;
|
|
5
5
|
_linkCount: number;
|
|
6
6
|
_activeInfo: {
|
|
@@ -9,10 +9,9 @@ export declare class GjsifyWebGLUniformLocation implements WebGLUniformLocation
|
|
|
9
9
|
name: string;
|
|
10
10
|
};
|
|
11
11
|
_array: Array<number | null> | null;
|
|
12
|
-
constructor(_:
|
|
12
|
+
constructor(_: number, program: WebGLProgram, info: {
|
|
13
13
|
size: GLsizei;
|
|
14
14
|
type: GLenum;
|
|
15
15
|
name: string;
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
export { GjsifyWebGLUniformLocation as WebGLUniformLocation };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Linkable } from './linkable.js';
|
|
2
|
+
import { WebGLVertexArrayObjectState } from './webgl-vertex-attribute.js';
|
|
3
|
+
import type { WebGL2RenderingContext } from './webgl2-rendering-context.js';
|
|
4
|
+
export declare class WebGLVertexArrayObject extends Linkable implements WebGLVertexArrayObject {
|
|
5
|
+
_ctx: WebGL2RenderingContext;
|
|
6
|
+
_objectState: WebGLVertexArrayObjectState;
|
|
7
|
+
constructor(_: number, ctx: WebGL2RenderingContext);
|
|
8
|
+
_performDelete(): void;
|
|
9
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WebGLBuffer } from './webgl-buffer.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
3
3
|
export declare class WebGLVertexArrayObjectAttribute {
|
|
4
|
-
_ctx:
|
|
4
|
+
_ctx: WebGLRenderingContext;
|
|
5
5
|
_idx: number;
|
|
6
6
|
_isPointer: boolean;
|
|
7
7
|
_pointerBuffer: WebGLBuffer | null;
|
|
@@ -13,7 +13,7 @@ export declare class WebGLVertexArrayObjectAttribute {
|
|
|
13
13
|
_divisor: number;
|
|
14
14
|
_inputSize: number;
|
|
15
15
|
_inputStride: number;
|
|
16
|
-
constructor(ctx:
|
|
16
|
+
constructor(ctx: WebGLRenderingContext, idx: number);
|
|
17
17
|
_clear(): void;
|
|
18
18
|
}
|
|
19
19
|
export declare class WebGLVertexArrayGlobalAttribute {
|
|
@@ -24,7 +24,7 @@ export declare class WebGLVertexArrayGlobalAttribute {
|
|
|
24
24
|
export declare class WebGLVertexArrayObjectState {
|
|
25
25
|
_attribs: WebGLVertexArrayObjectAttribute[];
|
|
26
26
|
_elementArrayBufferBinding: WebGLBuffer | null;
|
|
27
|
-
constructor(ctx:
|
|
27
|
+
constructor(ctx: WebGLRenderingContext);
|
|
28
28
|
setElementArrayBuffer(buffer: WebGLBuffer | null): void;
|
|
29
29
|
cleanUp(): void;
|
|
30
30
|
releaseArrayBuffer(buffer: WebGLBuffer): void;
|
|
@@ -33,6 +33,6 @@ export declare class WebGLVertexArrayObjectState {
|
|
|
33
33
|
export declare class WebGLVertexArrayGlobalState {
|
|
34
34
|
_arrayBufferBinding: WebGLBuffer | null;
|
|
35
35
|
_attribs: WebGLVertexArrayGlobalAttribute[];
|
|
36
|
-
constructor(ctx:
|
|
36
|
+
constructor(ctx: WebGLRenderingContext);
|
|
37
37
|
setArrayBuffer(buffer: WebGLBuffer | null): void;
|
|
38
38
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import Gwebgl from '@girs/gwebgl-0.1';
|
|
2
|
+
import { WebGLRenderingContext } from './webgl-rendering-context.js';
|
|
3
|
+
import { HTMLCanvasElement } from './html-canvas-element.js';
|
|
4
|
+
import { WebGLQuery } from './webgl-query.js';
|
|
5
|
+
import { WebGLSampler } from './webgl-sampler.js';
|
|
6
|
+
import { WebGLSync } from './webgl-sync.js';
|
|
7
|
+
import { WebGLTransformFeedback } from './webgl-transform-feedback.js';
|
|
8
|
+
import { WebGLVertexArrayObject } from './webgl-vertex-array-object.js';
|
|
9
|
+
import { WebGLUniformLocation } from './webgl-uniform-location.js';
|
|
10
|
+
import { WebGLActiveInfo } from './webgl-active-info.js';
|
|
11
|
+
import { WebGLTexture } from './webgl-texture.js';
|
|
12
|
+
export declare class WebGL2RenderingContext extends WebGLRenderingContext implements WebGL2RenderingContext {
|
|
13
|
+
_native2: Gwebgl.WebGL2RenderingContext;
|
|
14
|
+
_queries: Record<number, WebGLQuery>;
|
|
15
|
+
_samplers: Record<number, WebGLSampler>;
|
|
16
|
+
_transformFeedbacks: Record<number, WebGLTransformFeedback>;
|
|
17
|
+
_vertexArrayObjects: Record<number, WebGLVertexArrayObject>;
|
|
18
|
+
_syncs: Record<number, WebGLSync>;
|
|
19
|
+
constructor(canvas: HTMLCanvasElement | null, options?: Gwebgl.WebGL2RenderingContext.ConstructorProperties);
|
|
20
|
+
_getGlslVersion(es: boolean): string;
|
|
21
|
+
/** WebGL2 allows COLOR_ATTACHMENT1–15 as framebuffer attachment points. */
|
|
22
|
+
_validFramebufferAttachment(attachment: GLenum): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Apply COLOR_ATTACHMENT1–15 to the native GL FBO when they have attachments.
|
|
25
|
+
* The base class only knows about CA0, DEPTH, STENCIL, DEPTH_STENCIL.
|
|
26
|
+
*/
|
|
27
|
+
_updateFramebufferAttachments(framebuffer: any): void;
|
|
28
|
+
/** WebGL2 adds UNIFORM_BUFFER, TRANSFORM_FEEDBACK_BUFFER, etc. targets. */
|
|
29
|
+
bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void;
|
|
30
|
+
/** WebGL2 adds READ/COPY buffer usages and additional buffer targets. */
|
|
31
|
+
bufferData(target: GLenum, dataOrSize: GLsizeiptr | BufferSource | null, usage: GLenum): void;
|
|
32
|
+
/** WebGL2 adds TEXTURE_3D and TEXTURE_2D_ARRAY target support. */
|
|
33
|
+
bindTexture(target: GLenum, texture: WebGLTexture | null): void;
|
|
34
|
+
/** WebGL2 adds TEXTURE_3D/TEXTURE_2D_ARRAY targets and TEXTURE_WRAP_R pname. */
|
|
35
|
+
texParameteri(target: GLenum, pname: GLenum, param: GLint): void;
|
|
36
|
+
/**
|
|
37
|
+
* In WebGL2/GLES3 the attribute-0 requirement from WebGL1 does not apply.
|
|
38
|
+
* Override drawArrays to skip the attrib0 hack and call glDrawArrays directly.
|
|
39
|
+
*/
|
|
40
|
+
drawArrays(mode: GLenum, first: GLint, count: GLsizei): void;
|
|
41
|
+
createVertexArray(): WebGLVertexArrayObject | null;
|
|
42
|
+
deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void;
|
|
43
|
+
isVertexArray(vertexArray: WebGLVertexArrayObject | null): GLboolean;
|
|
44
|
+
bindVertexArray(array: WebGLVertexArrayObject | null): void;
|
|
45
|
+
createQuery(): WebGLQuery | null;
|
|
46
|
+
deleteQuery(query: WebGLQuery | null): void;
|
|
47
|
+
isQuery(query: WebGLQuery | null): GLboolean;
|
|
48
|
+
beginQuery(target: GLenum, query: WebGLQuery): void;
|
|
49
|
+
endQuery(target: GLenum): void;
|
|
50
|
+
getQuery(_target: GLenum, _pname: GLenum): WebGLQuery | null;
|
|
51
|
+
getQueryParameter(query: WebGLQuery, pname: GLenum): any;
|
|
52
|
+
createSampler(): WebGLSampler | null;
|
|
53
|
+
deleteSampler(sampler: WebGLSampler | null): void;
|
|
54
|
+
isSampler(sampler: WebGLSampler | null): GLboolean;
|
|
55
|
+
bindSampler(unit: GLuint, sampler: WebGLSampler | null): void;
|
|
56
|
+
samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint): void;
|
|
57
|
+
samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat): void;
|
|
58
|
+
getSamplerParameter(sampler: WebGLSampler, pname: GLenum): any;
|
|
59
|
+
fenceSync(condition: GLenum, flags: GLbitfield): WebGLSync | null;
|
|
60
|
+
isSync(sync: WebGLSync | null): GLboolean;
|
|
61
|
+
deleteSync(sync: WebGLSync | null): void;
|
|
62
|
+
clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64): GLenum;
|
|
63
|
+
waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64): void;
|
|
64
|
+
getSyncParameter(sync: WebGLSync, pname: GLenum): any;
|
|
65
|
+
createTransformFeedback(): WebGLTransformFeedback | null;
|
|
66
|
+
deleteTransformFeedback(tf: WebGLTransformFeedback | null): void;
|
|
67
|
+
isTransformFeedback(tf: WebGLTransformFeedback | null): GLboolean;
|
|
68
|
+
bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback | null): void;
|
|
69
|
+
beginTransformFeedback(primitiveMode: GLenum): void;
|
|
70
|
+
endTransformFeedback(): void;
|
|
71
|
+
pauseTransformFeedback(): void;
|
|
72
|
+
resumeTransformFeedback(): void;
|
|
73
|
+
transformFeedbackVaryings(program: WebGLProgram, varyings: string[], bufferMode: GLenum): void;
|
|
74
|
+
getTransformFeedbackVarying(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
|
|
75
|
+
bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer | null): void;
|
|
76
|
+
bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer | null, offset: GLintptr, size: GLsizeiptr): void;
|
|
77
|
+
copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr): void;
|
|
78
|
+
getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset?: GLuint, length?: GLuint): void;
|
|
79
|
+
texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
|
|
80
|
+
texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
|
|
81
|
+
compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, _imageSize: GLsizei, data: ArrayBufferView): void;
|
|
82
|
+
compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, _imageSize: GLsizei, data: ArrayBufferView): void;
|
|
83
|
+
copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
|
84
|
+
texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void;
|
|
85
|
+
texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei): void;
|
|
86
|
+
framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture | null, level: GLint, layer: GLint): void;
|
|
87
|
+
drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei): void;
|
|
88
|
+
drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei): void;
|
|
89
|
+
vertexAttribDivisor(index: GLuint, divisor: GLuint): void;
|
|
90
|
+
vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr): void;
|
|
91
|
+
drawBuffers(buffers: GLenum[]): void;
|
|
92
|
+
drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr): void;
|
|
93
|
+
blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum): void;
|
|
94
|
+
invalidateFramebuffer(target: GLenum, attachments: GLenum[]): void;
|
|
95
|
+
invalidateSubFramebuffer(target: GLenum, attachments: GLenum[], x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
|
96
|
+
readBuffer(src: GLenum): void;
|
|
97
|
+
renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void;
|
|
98
|
+
uniform1ui(location: WebGLUniformLocation | null, v0: GLuint): void;
|
|
99
|
+
uniform2ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint): void;
|
|
100
|
+
uniform3ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint): void;
|
|
101
|
+
uniform4ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint): void;
|
|
102
|
+
uniform1uiv(location: WebGLUniformLocation | null, data: Uint32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
103
|
+
uniform2uiv(location: WebGLUniformLocation | null, data: Uint32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
104
|
+
uniform3uiv(location: WebGLUniformLocation | null, data: Uint32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
105
|
+
uniform4uiv(location: WebGLUniformLocation | null, data: Uint32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
106
|
+
uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
107
|
+
uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
108
|
+
uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
109
|
+
uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
110
|
+
uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
111
|
+
uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, _srcOffset?: GLuint, _srcLength?: GLuint): void;
|
|
112
|
+
/** WebGL1 getUniform falls to default:null for UNSIGNED_INT types. Handle them here. */
|
|
113
|
+
getUniform(program: WebGLProgram, location: WebGLUniformLocation): any;
|
|
114
|
+
getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string): GLuint;
|
|
115
|
+
uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint): void;
|
|
116
|
+
getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint): string | null;
|
|
117
|
+
getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum): any;
|
|
118
|
+
getActiveUniforms(program: WebGLProgram, uniformIndices: GLuint[], pname: GLenum): any;
|
|
119
|
+
getFragDataLocation(program: WebGLProgram, name: string): GLint;
|
|
120
|
+
getIndexedParameter(target: GLenum, index: GLuint): any;
|
|
121
|
+
getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum): any;
|
|
122
|
+
getParameter(pname: GLenum): any;
|
|
123
|
+
getStringi(name: GLenum, index: GLuint): string | null;
|
|
124
|
+
}
|