@geastack/native-webgl-angle 0.1.6
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/LICENSE +202 -0
- package/README.md +184 -0
- package/geatsc-plugin-batched-probe.mjs +98 -0
- package/geatsc-plugin-instancing.mjs +160 -0
- package/geatsc-plugin-uniforms.mjs +1955 -0
- package/geatsc-plugin-uploads.mjs +29 -0
- package/geatsc-plugin.mjs +10275 -0
- package/native/angle_webgl_host.mm +2687 -0
- package/native/audio_host.mm +857 -0
- package/native/audio_uwp.h +116 -0
- package/package.json +70 -0
- package/src/gea-native-types.d.ts +4 -0
- package/src/nativeAudioHost.ts +296 -0
- package/src/nativeThreeUtils.ts +11 -0
- package/src/nativeWebGL.ts +1211 -0
- package/src/nativeWebGLAnimation.ts +13 -0
- package/src/nativeWebGLHost.ts +333 -0
- package/src/nativeWebXRManager.ts +48 -0
- package/src/text/atlas-sans.ts +195 -0
- package/src/text/atlas-serif-italic.ts +195 -0
- package/src/text/atlas-serif.ts +195 -0
- package/src/text/native-text-types.ts +17 -0
- package/src/text/native-text.ts +203 -0
- package/src/troika-three-text.ts +248 -0
- package/test/auto-instanced-render-scene.ts +66 -0
- package/test/batched-render-scene.ts +58 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type NativeFrameCallback = (timestampMs: number) => void
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Three's renderer-local animation driver on hosts without browser `self`.
|
|
5
|
+
* Apple applications schedule frames through their native host callback, so
|
|
6
|
+
* this object retains Three's lifecycle surface without owning a second loop.
|
|
7
|
+
*/
|
|
8
|
+
export class WebGLAnimation {
|
|
9
|
+
start(): void {}
|
|
10
|
+
stop(): void {}
|
|
11
|
+
setAnimationLoop(_callback: NativeFrameCallback): void {}
|
|
12
|
+
setContext(): void {}
|
|
13
|
+
}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/// <reference path="./gea-native-types.d.ts" />
|
|
2
|
+
|
|
3
|
+
import type { NSView } from '@geastack/apple/AppKit'
|
|
4
|
+
|
|
5
|
+
export function attachNativeWebGL(
|
|
6
|
+
hostView: NSView,
|
|
7
|
+
width: number,
|
|
8
|
+
height: number,
|
|
9
|
+
devicePixelRatio: number,
|
|
10
|
+
): boolean {
|
|
11
|
+
return threeWebGLAttach(hostView, width, height, devicePixelRatio)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function syncNativeWebGLSize(fallbackAspect: number): number {
|
|
15
|
+
return threeWebGLSyncSize(fallbackAspect)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function nativeWebGLWidth(): number {
|
|
19
|
+
return threeWebGLWidth()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function nativeWebGLHeight(): number {
|
|
23
|
+
return threeWebGLHeight()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// The host's actual backing scale (window.devicePixelRatio analog).
|
|
27
|
+
// nativeWebGLWidth/Height report DEVICE pixels; divide by this for the
|
|
28
|
+
// CSS-pixel (logical) size that web layout math (HUD ortho camera,
|
|
29
|
+
// troika fontSize) expects.
|
|
30
|
+
export function nativeWebGLDevicePixelRatio(): number {
|
|
31
|
+
return threeWebGLDevicePixelRatio()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function nativeWebGLSwap(): void {
|
|
35
|
+
threeWebGLSwap()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function logNativeWebGL(message: string): void {
|
|
39
|
+
threeAngleSmokeLog(message)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Whether a macOS hardware key (virtual key code, 0-127) is currently held.
|
|
43
|
+
// Backed by the host NSView's keyDown:/keyUp: state; drives native input.
|
|
44
|
+
export function nativeKeyPressed(code: number): boolean {
|
|
45
|
+
return threeKeyPressed(code)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function nativeGamepadState(channel: number): number {
|
|
49
|
+
return threeGamepadState(channel)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Native pointer state (macOS host), the mouse twin of nativeKeyPressed.
|
|
53
|
+
// Channels: 0=x, 1=y (view coordinates, TOP-LEFT origin — clientX/clientY
|
|
54
|
+
// semantics), 2=view width, 3=view height (same units as x/y), 4=move
|
|
55
|
+
// sequence (changes on every pointer event; 0 = pointer never seen),
|
|
56
|
+
// 5=primary button (1 = down). Backed by the host NSView's NSTrackingArea
|
|
57
|
+
// mouseMoved:/mouseDragged:/mouseDown:/mouseUp: handlers. Also drivable
|
|
58
|
+
// headlessly via GEA_THREE_SYNTH_POINTER="x0,y0:x1,y1:startMs:endMs"
|
|
59
|
+
// (normalized [0,1] coordinates, reported with width=height=1).
|
|
60
|
+
export function nativePointerState(channel: number): number {
|
|
61
|
+
return threePointerState(channel)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function nativeWebGLCreateBuffer(): number { return threeWebGLCreateBuffer() }
|
|
65
|
+
export function nativeWebGLDeleteBuffer(buffer: number): void { threeWebGLDeleteBuffer(buffer) }
|
|
66
|
+
export function nativeWebGLBindBuffer(target: number, buffer: number): void { threeWebGLBindBuffer(target, buffer) }
|
|
67
|
+
|
|
68
|
+
export function nativeWebGLCreateShader(type: number): number { return threeWebGLCreateShader(type) }
|
|
69
|
+
export function nativeWebGLShaderSource(shader: number, source: string): void { threeWebGLShaderSource(shader, source) }
|
|
70
|
+
export function nativeWebGLCompileShader(shader: number): void { threeWebGLCompileShader(shader) }
|
|
71
|
+
export function nativeWebGLGetShaderParameter(shader: number, pname: number): number { return threeWebGLGetShaderParameter(shader, pname) }
|
|
72
|
+
export function nativeWebGLDeleteShader(shader: number): void { threeWebGLDeleteShader(shader) }
|
|
73
|
+
|
|
74
|
+
export function nativeWebGLCreateProgram(): number { return threeWebGLCreateProgram() }
|
|
75
|
+
export function nativeWebGLAttachShader(program: number, shader: number): void { threeWebGLAttachShader(program, shader) }
|
|
76
|
+
export function nativeWebGLLinkProgram(program: number): void { threeWebGLLinkProgram(program) }
|
|
77
|
+
export function nativeWebGLGetProgramParameter(program: number, pname: number): number { return threeWebGLGetProgramParameter(program, pname) }
|
|
78
|
+
export function nativeWebGLDeleteProgram(program: number): void { threeWebGLDeleteProgram(program) }
|
|
79
|
+
export function nativeWebGLUseProgram(program: number): void { threeWebGLUseProgram(program) }
|
|
80
|
+
export function nativeWebGLGetAttribLocation(program: number, name: string): number { return threeWebGLGetAttribLocation(program, name) }
|
|
81
|
+
export function nativeWebGLGetUniformLocation(program: number, name: string): number { return threeWebGLGetUniformLocation(program, name) }
|
|
82
|
+
// Driver-truth active uniform/attrib reflection, serialized "name|type|size"
|
|
83
|
+
// ("" past the end). Mirrors glGetActiveUniform/glGetActiveAttrib semantics
|
|
84
|
+
// exactly (struct-array member expansion, "name[0]" array reporting).
|
|
85
|
+
export function nativeWebGLGetActiveUniformInfo(program: number, index: number): string { return threeWebGLGetActiveUniformInfo(program, index) }
|
|
86
|
+
export function nativeWebGLGetActiveAttribInfo(program: number, index: number): string { return threeWebGLGetActiveAttribInfo(program, index) }
|
|
87
|
+
|
|
88
|
+
export function nativeWebGLEnableVertexAttribArray(index: number): void { threeWebGLEnableVertexAttribArray(index) }
|
|
89
|
+
export function nativeWebGLDisableVertexAttribArray(index: number): void { threeWebGLDisableVertexAttribArray(index) }
|
|
90
|
+
export function nativeWebGLVertexAttribPointer(index: number, size: number, type: number, normalized: number, stride: number, offset: number): void { threeWebGLVertexAttribPointer(index, size, type, normalized, stride, offset) }
|
|
91
|
+
|
|
92
|
+
export function nativeWebGLUniform1f(location: number, x: number): void { threeWebGLUniform1f(location, x) }
|
|
93
|
+
export function nativeWebGLUniform1i(location: number, x: number): void { threeWebGLUniform1i(location, x) }
|
|
94
|
+
export function nativeWebGLUniform2f(location: number, x: number, y: number): void { threeWebGLUniform2f(location, x, y) }
|
|
95
|
+
export function nativeWebGLUniform3f(location: number, x: number, y: number, z: number): void { threeWebGLUniform3f(location, x, y, z) }
|
|
96
|
+
export function nativeWebGLUniform4f(location: number, x: number, y: number, z: number, w: number): void { threeWebGLUniform4f(location, x, y, z, w) }
|
|
97
|
+
|
|
98
|
+
export function nativeWebGLCreateTexture(): number { return threeWebGLCreateTexture() }
|
|
99
|
+
export function nativeWebGLDeleteTexture(texture: number): void { threeWebGLDeleteTexture(texture) }
|
|
100
|
+
export function nativeWebGLBindTexture(target: number, texture: number): void { threeWebGLBindTexture(target, texture) }
|
|
101
|
+
export function nativeWebGLActiveTexture(texture: number): void { threeWebGLActiveTexture(texture) }
|
|
102
|
+
export function nativeWebGLTexParameteri(target: number, pname: number, param: number): void { threeWebGLTexParameteri(target, pname, param) }
|
|
103
|
+
export function nativeWebGLPixelStorei(pname: number, param: number): void { threeWebGLPixelStorei(pname, param) }
|
|
104
|
+
export function nativeWebGLGenerateMipmap(target: number): void { threeWebGLGenerateMipmap(target) }
|
|
105
|
+
|
|
106
|
+
export function nativeWebGLCreateVertexArray(): number { return threeWebGLCreateVertexArray() }
|
|
107
|
+
export function nativeWebGLBindVertexArray(vertexArray: number): void { threeWebGLBindVertexArray(vertexArray) }
|
|
108
|
+
export function nativeWebGLDeleteVertexArray(vertexArray: number): void { threeWebGLDeleteVertexArray(vertexArray) }
|
|
109
|
+
|
|
110
|
+
export function nativeWebGLCreateFramebuffer(): number { return threeWebGLCreateFramebuffer() }
|
|
111
|
+
export function nativeWebGLBindFramebuffer(target: number, framebuffer: number): void { threeWebGLBindFramebuffer(target, framebuffer) }
|
|
112
|
+
export function nativeWebGLDeleteFramebuffer(framebuffer: number): void { threeWebGLDeleteFramebuffer(framebuffer) }
|
|
113
|
+
export function nativeWebGLFramebufferTexture2D(target: number, attachment: number, textarget: number, texture: number, level: number): void { threeWebGLFramebufferTexture2D(target, attachment, textarget, texture, level) }
|
|
114
|
+
export function nativeWebGLCheckFramebufferStatus(target: number): number { return threeWebGLCheckFramebufferStatus(target) }
|
|
115
|
+
export function nativeWebGLCreateRenderbuffer(): number { return threeWebGLCreateRenderbuffer() }
|
|
116
|
+
export function nativeWebGLBindRenderbuffer(target: number, renderbuffer: number): void { threeWebGLBindRenderbuffer(target, renderbuffer) }
|
|
117
|
+
export function nativeWebGLDeleteRenderbuffer(renderbuffer: number): void { threeWebGLDeleteRenderbuffer(renderbuffer) }
|
|
118
|
+
export function nativeWebGLRenderbufferStorage(target: number, internalFormat: number, width: number, height: number): void { threeWebGLRenderbufferStorage(target, internalFormat, width, height) }
|
|
119
|
+
export function nativeWebGLFramebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: number): void { threeWebGLFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer) }
|
|
120
|
+
export function nativeWebGLDrawBuffers(attachment: number): void { threeWebGLDrawBuffers(attachment) }
|
|
121
|
+
|
|
122
|
+
export function nativeWebGLClearColor(r: number, g: number, b: number, a: number): void { threeWebGLClearColor(r, g, b, a) }
|
|
123
|
+
export function nativeWebGLClear(mask: number): void { threeWebGLClear(mask) }
|
|
124
|
+
export function nativeWebGLClearDepth(depth: number): void { threeWebGLClearDepth(depth) }
|
|
125
|
+
export function nativeWebGLClearStencil(stencil: number): void { threeWebGLClearStencil(stencil) }
|
|
126
|
+
export function nativeWebGLColorMask(r: number, g: number, b: number, a: number): void { threeWebGLColorMask(r, g, b, a) }
|
|
127
|
+
export function nativeWebGLDepthMask(flag: number): void { threeWebGLDepthMask(flag) }
|
|
128
|
+
export function nativeWebGLDepthFunc(func: number): void { threeWebGLDepthFunc(func) }
|
|
129
|
+
export function nativeWebGLEnable(cap: number): void { threeWebGLEnable(cap) }
|
|
130
|
+
export function nativeWebGLDisable(cap: number): void { threeWebGLDisable(cap) }
|
|
131
|
+
export function nativeWebGLBlendFunc(sfactor: number, dfactor: number): void { threeWebGLBlendFunc(sfactor, dfactor) }
|
|
132
|
+
export function nativeWebGLBlendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void { threeWebGLBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha) }
|
|
133
|
+
export function nativeWebGLBlendEquation(mode: number): void { threeWebGLBlendEquation(mode) }
|
|
134
|
+
export function nativeWebGLBlendEquationSeparate(modeRGB: number, modeAlpha: number): void { threeWebGLBlendEquationSeparate(modeRGB, modeAlpha) }
|
|
135
|
+
export function nativeWebGLCullFace(mode: number): void { threeWebGLCullFace(mode) }
|
|
136
|
+
export function nativeWebGLFrontFace(mode: number): void { threeWebGLFrontFace(mode) }
|
|
137
|
+
export function nativeWebGLViewport(x: number, y: number, width: number, height: number): void { threeWebGLViewport(x, y, width, height) }
|
|
138
|
+
export function nativeWebGLScissor(x: number, y: number, width: number, height: number): void { threeWebGLScissor(x, y, width, height) }
|
|
139
|
+
export function nativeWebGLLineWidth(width: number): void { threeWebGLLineWidth(width) }
|
|
140
|
+
export function nativeWebGLPolygonOffset(factor: number, units: number): void { threeWebGLPolygonOffset(factor, units) }
|
|
141
|
+
export function nativeWebGLStencilMask(mask: number): void { threeWebGLStencilMask(mask) }
|
|
142
|
+
export function nativeWebGLStencilMaskSeparate(face: number, mask: number): void { threeWebGLStencilMaskSeparate(face, mask) }
|
|
143
|
+
export function nativeWebGLStencilFunc(func: number, ref: number, mask: number): void { threeWebGLStencilFunc(func, ref, mask) }
|
|
144
|
+
export function nativeWebGLStencilFuncSeparate(face: number, func: number, ref: number, mask: number): void { threeWebGLStencilFuncSeparate(face, func, ref, mask) }
|
|
145
|
+
export function nativeWebGLStencilOp(fail: number, zfail: number, zpass: number): void { threeWebGLStencilOp(fail, zfail, zpass) }
|
|
146
|
+
export function nativeWebGLStencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void { threeWebGLStencilOpSeparate(face, fail, zfail, zpass) }
|
|
147
|
+
export function nativeWebGLDrawElements(mode: number, count: number, type: number, offset: number): void { threeWebGLDrawElements(mode, count, type, offset) }
|
|
148
|
+
export function nativeWebGLDrawArrays(mode: number, first: number, count: number): void { threeWebGLDrawArrays(mode, first, count) }
|
|
149
|
+
export function nativeWebGLGetError(): number { return threeWebGLGetError() }
|
|
150
|
+
|
|
151
|
+
/** Lifecycle entry: retains/uses the host view and installs native monitors; not an inert call. */
|
|
152
|
+
declare function threeWebGLAttach(view: NSView, width: number, height: number, devicePixelRatio: number): boolean
|
|
153
|
+
/** Lifecycle entry: synchronizes host layout and viewport state; keep outside the inert contract. */
|
|
154
|
+
declare function threeWebGLSyncSize(fallbackAspect: number): number
|
|
155
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
156
|
+
declare function threeWebGLWidth(): number
|
|
157
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
158
|
+
declare function threeWebGLHeight(): number
|
|
159
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
160
|
+
declare function threeWebGLDevicePixelRatio(): number
|
|
161
|
+
/** Lifecycle entry: presents the native surface and may run platform hooks; not an inert call. */
|
|
162
|
+
declare function threeWebGLSwap(): void
|
|
163
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
164
|
+
declare function threeAngleSmokeLog(message: string): void
|
|
165
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
166
|
+
declare function threeKeyPressed(code: number): boolean
|
|
167
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
168
|
+
declare function threePointerState(channel: number): number
|
|
169
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
170
|
+
declare function threeWebGLCreateBuffer(): number
|
|
171
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
172
|
+
declare function threeWebGLDeleteBuffer(buffer: number): void
|
|
173
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
174
|
+
declare function threeWebGLBindBuffer(target: number, buffer: number): void
|
|
175
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
176
|
+
declare function threeWebGLCreateShader(type: number): number
|
|
177
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
178
|
+
declare function threeWebGLShaderSource(shader: number, source: string): void
|
|
179
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
180
|
+
declare function threeWebGLCompileShader(shader: number): void
|
|
181
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
182
|
+
declare function threeWebGLGetShaderParameter(shader: number, pname: number): number
|
|
183
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
184
|
+
declare function threeWebGLDeleteShader(shader: number): void
|
|
185
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
186
|
+
declare function threeWebGLCreateProgram(): number
|
|
187
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
188
|
+
declare function threeWebGLAttachShader(program: number, shader: number): void
|
|
189
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
190
|
+
declare function threeWebGLLinkProgram(program: number): void
|
|
191
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
192
|
+
declare function threeWebGLGetProgramParameter(program: number, pname: number): number
|
|
193
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
194
|
+
declare function threeWebGLDeleteProgram(program: number): void
|
|
195
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
196
|
+
declare function threeWebGLUseProgram(program: number): void
|
|
197
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
198
|
+
declare function threeWebGLGetAttribLocation(program: number, name: string): number
|
|
199
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
200
|
+
declare function threeWebGLGetUniformLocation(program: number, name: string): number
|
|
201
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
202
|
+
declare function threeWebGLGetActiveUniformInfo(program: number, index: number): string
|
|
203
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
204
|
+
declare function threeWebGLGetActiveAttribInfo(program: number, index: number): string
|
|
205
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
206
|
+
declare function threeWebGLEnableVertexAttribArray(index: number): void
|
|
207
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
208
|
+
declare function threeWebGLDisableVertexAttribArray(index: number): void
|
|
209
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
210
|
+
declare function threeWebGLVertexAttribPointer(index: number, size: number, type: number, normalized: number, stride: number, offset: number): void
|
|
211
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
212
|
+
declare function threeWebGLUniform1f(location: number, x: number): void
|
|
213
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
214
|
+
declare function threeWebGLUniform1i(location: number, x: number): void
|
|
215
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
216
|
+
declare function threeWebGLUniform2f(location: number, x: number, y: number): void
|
|
217
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
218
|
+
declare function threeWebGLUniform3f(location: number, x: number, y: number, z: number): void
|
|
219
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
220
|
+
declare function threeWebGLUniform4f(location: number, x: number, y: number, z: number, w: number): void
|
|
221
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
222
|
+
declare function threeWebGLCreateTexture(): number
|
|
223
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
224
|
+
declare function threeWebGLDeleteTexture(texture: number): void
|
|
225
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
226
|
+
declare function threeWebGLBindTexture(target: number, texture: number): void
|
|
227
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
228
|
+
declare function threeWebGLActiveTexture(texture: number): void
|
|
229
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
230
|
+
declare function threeWebGLTexParameteri(target: number, pname: number, param: number): void
|
|
231
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
232
|
+
declare function threeWebGLPixelStorei(pname: number, param: number): void
|
|
233
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
234
|
+
declare function threeWebGLGenerateMipmap(target: number): void
|
|
235
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
236
|
+
declare function threeWebGLCreateVertexArray(): number
|
|
237
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
238
|
+
declare function threeWebGLBindVertexArray(vertexArray: number): void
|
|
239
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
240
|
+
declare function threeWebGLDeleteVertexArray(vertexArray: number): void
|
|
241
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
242
|
+
declare function threeWebGLCreateFramebuffer(): number
|
|
243
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
244
|
+
declare function threeWebGLBindFramebuffer(target: number, framebuffer: number): void
|
|
245
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
246
|
+
declare function threeWebGLDeleteFramebuffer(framebuffer: number): void
|
|
247
|
+
/** @gea-host-inert Copies scalar arguments into GL state; retains no script references and invokes no script. */
|
|
248
|
+
declare function threeWebGLFramebufferTexture2D(target: number, attachment: number, textarget: number, texture: number, level: number): void
|
|
249
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
250
|
+
declare function threeWebGLCheckFramebufferStatus(target: number): number
|
|
251
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
252
|
+
declare function threeWebGLCreateRenderbuffer(): number
|
|
253
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
254
|
+
declare function threeWebGLBindRenderbuffer(target: number, renderbuffer: number): void
|
|
255
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
256
|
+
declare function threeWebGLDeleteRenderbuffer(renderbuffer: number): void
|
|
257
|
+
/** @gea-host-inert Copies scalar arguments into GL state; retains no script references and invokes no script. */
|
|
258
|
+
declare function threeWebGLRenderbufferStorage(target: number, internalFormat: number, width: number, height: number): void
|
|
259
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
260
|
+
declare function threeWebGLFramebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: number): void
|
|
261
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
262
|
+
declare function threeWebGLDrawBuffers(attachment: number): void
|
|
263
|
+
/** @gea-host-inert Copies scalar arguments into GL state; retains no script references and invokes no script. */
|
|
264
|
+
declare function threeWebGLClearColor(r: number, g: number, b: number, a: number): void
|
|
265
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
266
|
+
declare function threeWebGLClear(mask: number): void
|
|
267
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
268
|
+
declare function threeWebGLClearDepth(depth: number): void
|
|
269
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
270
|
+
declare function threeWebGLClearStencil(stencil: number): void
|
|
271
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
272
|
+
declare function threeWebGLColorMask(r: number, g: number, b: number, a: number): void
|
|
273
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
274
|
+
declare function threeWebGLDepthMask(flag: number): void
|
|
275
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
276
|
+
declare function threeWebGLDepthFunc(func: number): void
|
|
277
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
278
|
+
declare function threeWebGLEnable(cap: number): void
|
|
279
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
280
|
+
declare function threeWebGLDisable(cap: number): void
|
|
281
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
282
|
+
declare function threeWebGLBlendFunc(sfactor: number, dfactor: number): void
|
|
283
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
284
|
+
declare function threeWebGLBlendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void
|
|
285
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
286
|
+
declare function threeWebGLBlendEquation(mode: number): void
|
|
287
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
288
|
+
declare function threeWebGLBlendEquationSeparate(modeRGB: number, modeAlpha: number): void
|
|
289
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
290
|
+
declare function threeWebGLCullFace(mode: number): void
|
|
291
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
292
|
+
declare function threeWebGLFrontFace(mode: number): void
|
|
293
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
294
|
+
declare function threeWebGLViewport(x: number, y: number, width: number, height: number): void
|
|
295
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
296
|
+
declare function threeWebGLScissor(x: number, y: number, width: number, height: number): void
|
|
297
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
298
|
+
declare function threeWebGLLineWidth(width: number): void
|
|
299
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
300
|
+
declare function threeWebGLPolygonOffset(factor: number, units: number): void
|
|
301
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
302
|
+
declare function threeWebGLStencilMask(mask: number): void
|
|
303
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
304
|
+
declare function threeWebGLStencilMaskSeparate(face: number, mask: number): void
|
|
305
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
306
|
+
declare function threeWebGLStencilFunc(func: number, ref: number, mask: number): void
|
|
307
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
308
|
+
declare function threeWebGLStencilFuncSeparate(face: number, func: number, ref: number, mask: number): void
|
|
309
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
310
|
+
declare function threeWebGLStencilOp(fail: number, zfail: number, zpass: number): void
|
|
311
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
312
|
+
declare function threeWebGLStencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void
|
|
313
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
314
|
+
declare function threeWebGLDrawElements(mode: number, count: number, type: number, offset: number): void
|
|
315
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
316
|
+
declare function threeWebGLDrawArrays(mode: number, first: number, count: number): void
|
|
317
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
318
|
+
declare function threeWebGLGetError(): number
|
|
319
|
+
|
|
320
|
+
// The host compiles these markers out of normal builds.
|
|
321
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
322
|
+
declare function threeNativeProfilePhase(phase: number): void
|
|
323
|
+
export function nativeProfilePhase(phase: number): void { threeNativeProfilePhase(phase) }
|
|
324
|
+
|
|
325
|
+
export function nativeWebGLVertexAttribDivisor(index: number, divisor: number): void { threeWebGLVertexAttribDivisor(index, divisor) }
|
|
326
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
327
|
+
declare function threeWebGLVertexAttribDivisor(index: number, divisor: number): void
|
|
328
|
+
export function nativeWebGLDrawElementsInstanced(mode: number, count: number, type: number, offset: number, instanceCount: number): void { threeWebGLDrawElementsInstanced(mode, count, type, offset, instanceCount) }
|
|
329
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
330
|
+
declare function threeWebGLDrawElementsInstanced(mode: number, count: number, type: number, offset: number, instanceCount: number): void
|
|
331
|
+
export function nativeWebGLDrawArraysInstanced(mode: number, first: number, count: number, instanceCount: number): void { threeWebGLDrawArraysInstanced(mode, first, count, instanceCount) }
|
|
332
|
+
/** @gea-host-inert Native state only; retains no script references and invokes no script. */
|
|
333
|
+
declare function threeWebGLDrawArraysInstanced(mode: number, first: number, count: number, instanceCount: number): void
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ArrayCamera } from 'three/src/cameras/ArrayCamera.js'
|
|
2
|
+
import { EventDispatcher } from 'three/src/core/EventDispatcher.js'
|
|
3
|
+
import type { Camera } from 'three/src/cameras/Camera.js'
|
|
4
|
+
import type { Mesh } from 'three/src/objects/Mesh.js'
|
|
5
|
+
import type { WebGLRenderer } from 'three/src/renderers/WebGLRenderer.js'
|
|
6
|
+
import type { NativeWebGL2RenderingContext } from './nativeWebGL'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The XR surface WebGLRenderer needs on an Apple-native target.
|
|
10
|
+
*
|
|
11
|
+
* WebXR is a browser device API and no Apple-native host object implements it.
|
|
12
|
+
* Keeping the manager present, permanently non-presenting, preserves Three's
|
|
13
|
+
* renderer contract without pulling its browser-only XR session/controller
|
|
14
|
+
* graph into the native program.
|
|
15
|
+
*/
|
|
16
|
+
export class WebXRManager extends EventDispatcher {
|
|
17
|
+
cameraAutoUpdate = true
|
|
18
|
+
enabled = false
|
|
19
|
+
readonly isPresenting = false
|
|
20
|
+
|
|
21
|
+
private readonly camera = new ArrayCamera()
|
|
22
|
+
|
|
23
|
+
constructor(_renderer: WebGLRenderer, _gl: NativeWebGL2RenderingContext) {
|
|
24
|
+
super()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
updateCamera(_camera: Camera): void {}
|
|
28
|
+
|
|
29
|
+
getCamera(): ArrayCamera {
|
|
30
|
+
return this.camera
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
hasDepthSensing(): boolean {
|
|
34
|
+
return false
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
getDepthSensingMesh(): Mesh | null {
|
|
38
|
+
return null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
getEnvironmentBlendMode(): string {
|
|
42
|
+
return 'opaque'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
setAnimationLoop<T>(_callback: T | null): void {}
|
|
46
|
+
|
|
47
|
+
dispose(): void {}
|
|
48
|
+
}
|