@geastack/native-webgl-angle 0.1.6 → 0.1.7
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/geatsc-plugin.mjs +61 -0
- package/package.json +6 -6
- package/src/nativeAudioHost.ts +6 -4
package/geatsc-plugin.mjs
CHANGED
|
@@ -1531,6 +1531,57 @@ const ambientTypeRealizations = {
|
|
|
1531
1531
|
type: "NativeWebGLCanvas",
|
|
1532
1532
|
importedFrom: "@geastack/native-webgl-angle/nativeWebGL",
|
|
1533
1533
|
},
|
|
1534
|
+
// Web Audio, for the same reason again. `nativeAudioHost.ts` IS this host's
|
|
1535
|
+
// Web Audio implementation (`audio_host.mm` behind it), so an app's sound
|
|
1536
|
+
// design is written against the browser's own names -- `AudioContext`,
|
|
1537
|
+
// `GainNode`, `AudioBuffer` -- exactly as it is for the web, and every value
|
|
1538
|
+
// those positions ever hold natively is one of these classes
|
|
1539
|
+
// (`createNativeAudioContext()` and what its context creates). Without the
|
|
1540
|
+
// realization an app had to invent structural `*Like` twins of the browser
|
|
1541
|
+
// interfaces, and a class instance stored into such an interface slot is a
|
|
1542
|
+
// slice (the compiler refuses it): the interface is a record, the value is a
|
|
1543
|
+
// class. The constructors stay absent as values: an app probes
|
|
1544
|
+
// `globalThis.AudioContext` and falls back to `createNativeAudioContext()`.
|
|
1545
|
+
AudioContext: {
|
|
1546
|
+
type: "NativeAudioContext",
|
|
1547
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1548
|
+
},
|
|
1549
|
+
BaseAudioContext: {
|
|
1550
|
+
type: "NativeAudioContext",
|
|
1551
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1552
|
+
},
|
|
1553
|
+
AudioNode: {
|
|
1554
|
+
type: "NativeAudioNode",
|
|
1555
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1556
|
+
},
|
|
1557
|
+
AudioDestinationNode: {
|
|
1558
|
+
type: "NativeAudioDestination",
|
|
1559
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1560
|
+
},
|
|
1561
|
+
AudioParam: {
|
|
1562
|
+
type: "NativeAudioParam",
|
|
1563
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1564
|
+
},
|
|
1565
|
+
GainNode: {
|
|
1566
|
+
type: "NativeGainNode",
|
|
1567
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1568
|
+
},
|
|
1569
|
+
BiquadFilterNode: {
|
|
1570
|
+
type: "NativeBiquadFilterNode",
|
|
1571
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1572
|
+
},
|
|
1573
|
+
OscillatorNode: {
|
|
1574
|
+
type: "NativeOscillatorNode",
|
|
1575
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1576
|
+
},
|
|
1577
|
+
AudioBuffer: {
|
|
1578
|
+
type: "NativeAudioBuffer",
|
|
1579
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1580
|
+
},
|
|
1581
|
+
AudioBufferSourceNode: {
|
|
1582
|
+
type: "NativeBufferSourceNode",
|
|
1583
|
+
importedFrom: "@geastack/native-webgl-angle/nativeAudioHost",
|
|
1584
|
+
},
|
|
1534
1585
|
};
|
|
1535
1586
|
|
|
1536
1587
|
const object3DClearSource =
|
|
@@ -10250,6 +10301,16 @@ export default {
|
|
|
10250
10301
|
"ImageBitmap",
|
|
10251
10302
|
"OffscreenCanvas",
|
|
10252
10303
|
"VideoFrame",
|
|
10304
|
+
// The browser's worker/window global. This package's own animation
|
|
10305
|
+
// driver (`src/nativeWebGLAnimation.ts`) exists BECAUSE the host has
|
|
10306
|
+
// no `self` to hand three's `animation.setContext(self)`, and that
|
|
10307
|
+
// `if (typeof self !== 'undefined')` guard in `WebGLRenderer.js` is
|
|
10308
|
+
// three's only use of it. Left unstated, the guard was live, the
|
|
10309
|
+
// read bound the ambient `self: Window & typeof globalThis`, and the
|
|
10310
|
+
// program emitted lib.dom's whole `Window` layout -- `Navigator`,
|
|
10311
|
+
// `History`, `ScreenOrientation` handles no host registers -- for a
|
|
10312
|
+
// value nothing ever reads.
|
|
10313
|
+
"self",
|
|
10253
10314
|
],
|
|
10254
10315
|
embeddedHostFunctions,
|
|
10255
10316
|
embeddedHostFunctionReturnTypes,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geastack/native-webgl-angle",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Typed native WebGL compatibility layer backed by ANGLE/Metal",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -53,16 +53,16 @@
|
|
|
53
53
|
"test:package": "node --experimental-vm-modules test/package.test.mjs"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@geastack/apple": ">=0.
|
|
56
|
+
"@geastack/apple": ">=0.2.8"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"three": "^0.185.0",
|
|
60
|
-
"@geastack/compiler": "^1.0.
|
|
60
|
+
"@geastack/compiler": "^1.0.17"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@geastack/compiler": "^1.0.
|
|
64
|
-
"@geastack/core": "^0.1.
|
|
65
|
-
"@geastack/engine": "^0.1.
|
|
63
|
+
"@geastack/compiler": "^1.0.17",
|
|
64
|
+
"@geastack/core": "^0.1.23",
|
|
65
|
+
"@geastack/engine": "^0.1.5",
|
|
66
66
|
"@types/three": "^0.185.0",
|
|
67
67
|
"three": "^0.185.0",
|
|
68
68
|
"typescript": "latest"
|
package/src/nativeAudioHost.ts
CHANGED
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
// and mp3 decode by asset basename (the native asset stub lowers
|
|
8
8
|
// `import url from './x.mp3'` to the file's basename).
|
|
9
9
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
10
|
+
// An app writes its sound design against the browser's own Web Audio names;
|
|
11
|
+
// geatsc-plugin.mjs's `ambientTypeRealizations` respell those names to the
|
|
12
|
+
// classes below for the native build, so this module is the Web Audio
|
|
13
|
+
// implementation the app's types already describe. On the web these classes
|
|
14
|
+
// are never constructed (the browser's own context wins), so the ambient host
|
|
15
|
+
// externs are never referenced at runtime there.
|
|
14
16
|
|
|
15
17
|
// Node kinds (native/audio_host.mm NodeKind).
|
|
16
18
|
const NODE_GAIN = 1
|