expo-gl 56.0.4 → 56.0.5
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/CHANGELOG.md +7 -0
- package/android/build.gradle +2 -2
- package/android/src/main/cpp/EXGLJniApi.cpp +6 -0
- package/android/src/main/java/expo/modules/gl/GLModule.kt +12 -0
- package/android/src/main/java/expo/modules/gl/cpp/EXGL.java +1 -0
- package/common/EXGLNativeApi.cpp +5 -0
- package/common/EXGLNativeApi.h +5 -0
- package/common/EXJsiUtils.h +16 -0
- package/common/EXWebGLRenderer.cpp +69 -40
- package/common/EXWebGLRenderer.h +10 -1
- package/expo-module.config.json +1 -1
- package/ios/ExpoGLModule.swift +11 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/{56.0.4/expo.modules.gl-56.0.4-sources.jar → 56.0.5/expo.modules.gl-56.0.5-sources.jar} +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/{56.0.4/expo.modules.gl-56.0.4.module → 56.0.5/expo.modules.gl-56.0.5.module} +22 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/{56.0.4/expo.modules.gl-56.0.4.pom → 56.0.5/expo.modules.gl-56.0.5.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4-sources.jar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4-sources.jar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4-sources.jar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4-sources.jar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 56.0.5 — 2026-05-19
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Install `WebGLRenderingContext` and `WebGL2RenderingContext` globals and their numeric constants at module init so libraries that read them before any GL context is created no longer crash. ([#45865](https://github.com/expo/expo/pull/45865) by [@tsapeta](https://github.com/tsapeta))
|
|
18
|
+
- Make `WebGL2RenderingContext` inherit from `WebGLRenderingContext`, matching the WebGL spec. `gl2 instanceof WebGLRenderingContext` now returns `true` for WebGL2 contexts, and shared constants and methods are no longer duplicated on the WebGL2 prototype. ([#45871](https://github.com/expo/expo/pull/45871) by [@tsapeta](https://github.com/tsapeta))
|
|
19
|
+
|
|
13
20
|
## 56.0.4 — 2026-05-15
|
|
14
21
|
|
|
15
22
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -11,7 +11,7 @@ def reactNativeArchitectures() {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
group = 'host.exp.exponent'
|
|
14
|
-
version = '56.0.
|
|
14
|
+
version = '56.0.5'
|
|
15
15
|
|
|
16
16
|
android {
|
|
17
17
|
if (rootProject.hasProperty("ndkPath")) {
|
|
@@ -24,7 +24,7 @@ android {
|
|
|
24
24
|
namespace "expo.modules.gl"
|
|
25
25
|
defaultConfig {
|
|
26
26
|
versionCode 31
|
|
27
|
-
versionName "56.0.
|
|
27
|
+
versionName "56.0.5"
|
|
28
28
|
|
|
29
29
|
externalNativeBuild {
|
|
30
30
|
cmake {
|
|
@@ -16,6 +16,12 @@ Java_expo_modules_gl_cpp_EXGL_EXGLContextCreate
|
|
|
16
16
|
return EXGLContextCreate();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
JNIEXPORT void JNICALL
|
|
20
|
+
Java_expo_modules_gl_cpp_EXGL_EXGLInstallWebGLBindings
|
|
21
|
+
(JNIEnv *env, jclass clazz, jlong jsiPtr) {
|
|
22
|
+
EXGLInstallWebGLBindings((void *) jsiPtr);
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
JNIEXPORT void JNICALL
|
|
20
26
|
Java_expo_modules_gl_cpp_EXGL_EXGLContextPrepare
|
|
21
27
|
(JNIEnv *env, jclass clazz, jlong jsiPtr, jint exglCtxId, jobject glContext) {
|
|
@@ -5,12 +5,14 @@ import android.os.Bundle
|
|
|
5
5
|
import android.util.SparseArray
|
|
6
6
|
import android.view.View
|
|
7
7
|
import expo.modules.interfaces.camera.CameraViewInterface
|
|
8
|
+
import expo.modules.gl.cpp.EXGL
|
|
8
9
|
import expo.modules.kotlin.Promise
|
|
9
10
|
import expo.modules.kotlin.exception.CodedException
|
|
10
11
|
import expo.modules.kotlin.exception.Exceptions
|
|
11
12
|
import expo.modules.kotlin.functions.Queues
|
|
12
13
|
import expo.modules.kotlin.modules.Module
|
|
13
14
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
15
|
+
import expo.modules.kotlin.runtime.MainRuntime
|
|
14
16
|
|
|
15
17
|
private class InvalidCameraViewException :
|
|
16
18
|
CodedException("Provided view tag don't point to valid instance of the camera view")
|
|
@@ -24,6 +26,16 @@ class GLModule : Module() {
|
|
|
24
26
|
override fun definition() = ModuleDefinition {
|
|
25
27
|
Name("ExpoGL")
|
|
26
28
|
|
|
29
|
+
OnCreate {
|
|
30
|
+
val runtime = appContext.runtime as? MainRuntime ?: return@OnCreate
|
|
31
|
+
val jsRuntimePointer = runtime.reactContext?.javaScriptContextHolder?.get() ?: 0L
|
|
32
|
+
if (jsRuntimePointer != 0L) {
|
|
33
|
+
runtime.schedule {
|
|
34
|
+
EXGL.EXGLInstallWebGLBindings(jsRuntimePointer)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
AsyncFunction("destroyObjectAsync") { exglObjId: Int ->
|
|
28
40
|
val glObject = mGLObjects[exglObjId]
|
|
29
41
|
?: return@AsyncFunction false
|
|
@@ -8,6 +8,7 @@ public class EXGL {
|
|
|
8
8
|
SoLoader.loadLibrary("expo-gl");
|
|
9
9
|
}
|
|
10
10
|
public static native int EXGLContextCreate();
|
|
11
|
+
public static native void EXGLInstallWebGLBindings(long jsCtxPtr);
|
|
11
12
|
public static native void EXGLContextPrepare(long jsCtxPtr, int exglCtxId, Object glContext);
|
|
12
13
|
public static native void EXGLContextPrepareWorklet(int exglCtxId);
|
|
13
14
|
|
package/common/EXGLNativeApi.cpp
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#include "EXGLNativeApi.h"
|
|
2
2
|
#include "EXGLContextManager.h"
|
|
3
3
|
#include "EXGLNativeContext.h"
|
|
4
|
+
#include "EXWebGLRenderer.h"
|
|
4
5
|
|
|
5
6
|
using namespace expo::gl_cpp;
|
|
6
7
|
|
|
@@ -8,6 +9,10 @@ EXGLContextId EXGLContextCreate() {
|
|
|
8
9
|
return ContextCreate();
|
|
9
10
|
}
|
|
10
11
|
|
|
12
|
+
void EXGLInstallWebGLBindings(void *jsiPtr) {
|
|
13
|
+
installWebGLConstructorsAndConstants(*reinterpret_cast<jsi::Runtime *>(jsiPtr));
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
void EXGLContextPrepare(
|
|
12
17
|
void *jsiPtr,
|
|
13
18
|
EXGLContextId exglCtxId,
|
package/common/EXGLNativeApi.h
CHANGED
|
@@ -28,6 +28,11 @@ typedef unsigned int EXGLObjectId;
|
|
|
28
28
|
|
|
29
29
|
EXGLContextId EXGLContextCreate();
|
|
30
30
|
|
|
31
|
+
// [JS thread] Install the `WebGLRenderingContext` / `WebGL2RenderingContext`
|
|
32
|
+
// global constructors and their numeric constants so they are reachable from
|
|
33
|
+
// JS before any GL context is created. `runtime` is a raw `jsi::Runtime *`.
|
|
34
|
+
void EXGLInstallWebGLBindings(void *runtime);
|
|
35
|
+
|
|
31
36
|
#ifdef __cplusplus
|
|
32
37
|
// [JS thread] Create an EXGL context and return its id number. Saves the
|
|
33
38
|
// JavaScript interface object (has a WebGLRenderingContext-style API) at
|
package/common/EXJsiUtils.h
CHANGED
|
@@ -60,6 +60,22 @@ inline void setFunctionOnObject(
|
|
|
60
60
|
runtime, jsName, jsi::Function::createFromHostFunction(runtime, jsName, 0, func));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
// Sets `derived.__proto__ = base`, equivalent to `Object.setPrototypeOf` in
|
|
64
|
+
// JS. For two constructor functions A and B, this is the static-side half of
|
|
65
|
+
// `class B extends A {}` — property lookups on B fall through to A.
|
|
66
|
+
inline void setObjectPrototypeOf(
|
|
67
|
+
jsi::Runtime &runtime,
|
|
68
|
+
jsi::Object &derived,
|
|
69
|
+
jsi::Object &base) {
|
|
70
|
+
jsi::Object objectClass = runtime.global().getPropertyAsObject(runtime, "Object");
|
|
71
|
+
objectClass
|
|
72
|
+
.getPropertyAsFunction(runtime, "setPrototypeOf")
|
|
73
|
+
.callWithThis(
|
|
74
|
+
runtime,
|
|
75
|
+
objectClass,
|
|
76
|
+
{jsi::Value(runtime, derived), jsi::Value(runtime, base)});
|
|
77
|
+
}
|
|
78
|
+
|
|
63
79
|
inline void jsConsoleLog(jsi::Runtime &runtime, std::initializer_list<jsi::Value> args) {
|
|
64
80
|
runtime.global()
|
|
65
81
|
.getProperty(runtime, "console")
|
|
@@ -44,7 +44,8 @@ void createWebGLRenderer(
|
|
|
44
44
|
glesContext viewport,
|
|
45
45
|
jsi::Object &&global
|
|
46
46
|
) {
|
|
47
|
-
|
|
47
|
+
installWebGLConstructorsAndConstants(runtime);
|
|
48
|
+
installWebGLInstanceMethods(runtime);
|
|
48
49
|
jsi::Object gl = ctx->supportsWebGL2
|
|
49
50
|
? createWebGLObject(
|
|
50
51
|
runtime, EXWebGLClass::WebGL2RenderingContext, {static_cast<double>(ctx->ctxId)})
|
|
@@ -123,14 +124,6 @@ std::string getConstructorName(EXWebGLClass value) {
|
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
void attachClass(
|
|
127
|
-
jsi::Runtime &runtime,
|
|
128
|
-
EXWebGLClass webglClass,
|
|
129
|
-
std::function<void(EXWebGLClass webglClass)> installPrototypes) {
|
|
130
|
-
jsi::PropNameID name = jsi::PropNameID::forUtf8(runtime, getConstructorName(webglClass));
|
|
131
|
-
installPrototypes(webglClass);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
127
|
// https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Inheritance#setting_teachers_prototype_and_constructor_reference
|
|
135
128
|
//
|
|
136
129
|
// Below implementation is equivalent of `class WebGLBuffer extends WebGLObject {}`
|
|
@@ -172,7 +165,14 @@ void jsClassExtend(jsi::Runtime &runtime, jsi::Object &baseClass, jsi::PropNameI
|
|
|
172
165
|
});
|
|
173
166
|
}
|
|
174
167
|
|
|
175
|
-
|
|
168
|
+
static jsi::Object getRenderingContextPrototype(jsi::Runtime &runtime, EXWebGLClass classEnum) {
|
|
169
|
+
return runtime.global()
|
|
170
|
+
.getProperty(runtime, jsi::PropNameID::forUtf8(runtime, getConstructorName(classEnum)))
|
|
171
|
+
.asObject(runtime)
|
|
172
|
+
.getPropertyAsObject(runtime, "prototype");
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
void installWebGLConstructorsAndConstants(jsi::Runtime &runtime) {
|
|
176
176
|
if (runtime.global().hasProperty(runtime, "WebGLRenderingContext")) {
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
@@ -181,37 +181,50 @@ void ensurePrototypes(jsi::Runtime &runtime) {
|
|
|
181
181
|
auto evalBuffer = std::make_shared<jsi::StringBuffer>(evalStubConstructors);
|
|
182
182
|
runtime.evaluateJavaScript(evalBuffer, "expo-gl");
|
|
183
183
|
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
jsi::Object objectClass = runtime.global().getPropertyAsObject(runtime, "Object");
|
|
185
|
+
auto inheritFromJsObject = [&runtime, &objectClass](EXWebGLClass classEnum) {
|
|
186
186
|
jsClassExtend(
|
|
187
187
|
runtime, objectClass, jsi::PropNameID::forUtf8(runtime, getConstructorName(classEnum)));
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
inheritFromJsObject(EXWebGLClass::WebGLRenderingContext);
|
|
193
|
-
auto prototype =
|
|
190
|
+
auto installConstantsOnConstructor = [&runtime](EXWebGLClass classEnum) {
|
|
191
|
+
auto constructor =
|
|
194
192
|
runtime.global()
|
|
195
|
-
.getProperty(runtime, jsi::PropNameID::forUtf8(runtime, getConstructorName(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
193
|
+
.getProperty(runtime, jsi::PropNameID::forUtf8(runtime, getConstructorName(classEnum)))
|
|
194
|
+
.asObject(runtime);
|
|
195
|
+
// Per the WebGL spec, GL_* numeric constants are exposed both as static
|
|
196
|
+
// members of the interface (e.g. WebGLRenderingContext.LINEAR) and on the
|
|
197
|
+
// prototype (e.g. gl.LINEAR). Only the static members are needed before
|
|
198
|
+
// a context is created; the prototype copy is deferred to
|
|
199
|
+
// `installWebGLInstanceMethods` to keep module-init cheap.
|
|
200
|
+
installConstants(runtime, constructor);
|
|
201
|
+
};
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
203
|
+
inheritFromJsObject(EXWebGLClass::WebGLRenderingContext);
|
|
204
|
+
installConstantsOnConstructor(EXWebGLClass::WebGLRenderingContext);
|
|
205
|
+
|
|
206
|
+
// Make WebGL2RenderingContext extend WebGLRenderingContext on both sides,
|
|
207
|
+
// matching the WebGL spec and what `class WebGL2RenderingContext extends
|
|
208
|
+
// WebGLRenderingContext {}` would produce. Saves duplicating constants and
|
|
209
|
+
// WebGL1 methods on the WebGL2 prototype, and gives `instanceof
|
|
210
|
+
// WebGLRenderingContext` the right answer for WebGL2 instances.
|
|
211
|
+
auto webglRenderingContext =
|
|
212
|
+
runtime.global()
|
|
213
|
+
.getProperty(
|
|
214
|
+
runtime,
|
|
215
|
+
jsi::PropNameID::forUtf8(runtime, getConstructorName(EXWebGLClass::WebGLRenderingContext)))
|
|
216
|
+
.asObject(runtime);
|
|
217
|
+
jsClassExtend(
|
|
218
|
+
runtime,
|
|
219
|
+
webglRenderingContext,
|
|
220
|
+
jsi::PropNameID::forUtf8(runtime, getConstructorName(EXWebGLClass::WebGL2RenderingContext)));
|
|
221
|
+
jsi::Object webgl2RenderingContext =
|
|
222
|
+
runtime.global()
|
|
223
|
+
.getProperty(
|
|
224
|
+
runtime,
|
|
225
|
+
jsi::PropNameID::forUtf8(runtime, getConstructorName(EXWebGLClass::WebGL2RenderingContext)))
|
|
226
|
+
.asObject(runtime);
|
|
227
|
+
setObjectPrototypeOf(runtime, webgl2RenderingContext, webglRenderingContext);
|
|
215
228
|
|
|
216
229
|
// Configure rest of WebGL objects
|
|
217
230
|
inheritFromJsObject(EXWebGLClass::WebGLObject);
|
|
@@ -245,6 +258,22 @@ void ensurePrototypes(jsi::Runtime &runtime) {
|
|
|
245
258
|
inheritFromWebGLObject(EXWebGLClass::WebGLVertexArrayObject);
|
|
246
259
|
}
|
|
247
260
|
|
|
261
|
+
void installWebGLInstanceMethods(jsi::Runtime &runtime) {
|
|
262
|
+
if (runtime.global().hasProperty(runtime, "__EXGLPrototypeReady")) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
runtime.global().setProperty(runtime, "__EXGLPrototypeReady", true);
|
|
266
|
+
|
|
267
|
+
auto webglPrototype = getRenderingContextPrototype(runtime, EXWebGLClass::WebGLRenderingContext);
|
|
268
|
+
installConstants(runtime, webglPrototype);
|
|
269
|
+
installWebGLMethods(runtime, webglPrototype);
|
|
270
|
+
|
|
271
|
+
// Constants and WebGL1 methods reach the WebGL2 prototype via inheritance;
|
|
272
|
+
// only the WebGL2-exclusive methods need installing here.
|
|
273
|
+
auto webgl2Prototype = getRenderingContextPrototype(runtime, EXWebGLClass::WebGL2RenderingContext);
|
|
274
|
+
installWebGL2Methods(runtime, webgl2Prototype);
|
|
275
|
+
}
|
|
276
|
+
|
|
248
277
|
void installConstants(jsi::Runtime &runtime, jsi::Object &gl) {
|
|
249
278
|
#define GL_CONSTANT(name) gl.setProperty(runtime, #name, static_cast<double>(GL_##name));
|
|
250
279
|
|
|
@@ -264,17 +293,17 @@ void installWebGLMethods(jsi::Runtime &runtime, jsi::Object &gl) {
|
|
|
264
293
|
#undef NATIVE_METHOD
|
|
265
294
|
}
|
|
266
295
|
|
|
296
|
+
// Installs only WebGL2-exclusive methods. WebGL1 methods reach WebGL2
|
|
297
|
+
// instances via the prototype chain (WebGL2RenderingContext.prototype
|
|
298
|
+
// inherits from WebGLRenderingContext.prototype).
|
|
267
299
|
void installWebGL2Methods(jsi::Runtime &runtime, jsi::Object &gl) {
|
|
268
|
-
#define
|
|
269
|
-
|
|
270
|
-
#define NATIVE_METHOD(name) CREATE_METHOD(name)
|
|
271
|
-
#define NATIVE_WEBGL2_METHOD(name) CREATE_METHOD(name)
|
|
300
|
+
#define NATIVE_METHOD(name) ;
|
|
301
|
+
#define NATIVE_WEBGL2_METHOD(name) setFunctionOnObject(runtime, gl, #name, method::glNativeMethod_##name);
|
|
272
302
|
|
|
273
303
|
#include "EXWebGLMethods.def"
|
|
274
304
|
|
|
275
305
|
#undef NATIVE_WEBGL2_METHOD
|
|
276
306
|
#undef NATIVE_METHOD
|
|
277
|
-
#undef CREATE_METHOD
|
|
278
307
|
}
|
|
279
308
|
|
|
280
309
|
} // namespace gl_cpp
|
package/common/EXWebGLRenderer.h
CHANGED
|
@@ -36,7 +36,16 @@ enum class EXWebGLClass {
|
|
|
36
36
|
WebGLVertexArrayObject,
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
// Installs the WebGLRenderingContext and WebGL2RenderingContext constructors,
|
|
40
|
+
// their numeric constants, and the inheritance chain for related interface
|
|
41
|
+
// objects. Safe to call before any GL context exists; idempotent.
|
|
42
|
+
void installWebGLConstructorsAndConstants(jsi::Runtime &runtime);
|
|
43
|
+
|
|
44
|
+
// Installs WebGLRenderingContext and WebGL2RenderingContext instance methods
|
|
45
|
+
// on their prototypes. Defers the heavier per-method binding work until a GL
|
|
46
|
+
// context is created. Requires `installWebGLConstructorsAndConstants` to have
|
|
47
|
+
// run; idempotent.
|
|
48
|
+
void installWebGLInstanceMethods(jsi::Runtime &runtime);
|
|
40
49
|
|
|
41
50
|
void createWebGLRenderer(jsi::Runtime &runtime, EXGLContext *, glesContext, jsi::Object &&global);
|
|
42
51
|
|
package/expo-module.config.json
CHANGED
package/ios/ExpoGLModule.swift
CHANGED
|
@@ -6,6 +6,17 @@ public final class ExpoGLModule: Module {
|
|
|
6
6
|
public func definition() -> ModuleDefinition {
|
|
7
7
|
Name("ExpoGL")
|
|
8
8
|
|
|
9
|
+
OnCreate {
|
|
10
|
+
guard let runtime = try? appContext?.runtime else {
|
|
11
|
+
return
|
|
12
|
+
}
|
|
13
|
+
try! runtime.execute {
|
|
14
|
+
runtime.withUnsafePointee { runtimePtr in
|
|
15
|
+
EXGLInstallWebGLBindings(runtimePtr)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
9
20
|
AsyncFunction("takeSnapshotAsync") { (contextId: UInt, options: [String: Any], promise: Promise) in
|
|
10
21
|
EXGLObjectManager.shared.takeSnapshot(
|
|
11
22
|
withContextId: contextId as NSNumber,
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a84e7ebaca6934fcbf7e033fbc11eac0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d7d25999839107f671c14ba9771c640c29f9e5d0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3e07f19fe60bbbe25f2df865c8dee91ee9274a2322421f7604c81e8a95424337
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0f8d330c85629629bc0c5fe8373ce7e4d2e24720c45ef711ebabf2814d0ffc0de9be7ae71964abd211055fbba194c5c1d389a09020096d3a924e01d818125031
|
|
Binary file
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.aar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
23787a05e7ead0a5035c7d13206093ad
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.aar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
82afe6ab060b2aa5d95f2dc4d9100b1d3e5578ed
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
154c6045333bd75e885803be7812c43fb8b70d9e4f1cf890be4f9d841ad16564
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7275be66e8f2ddfdb1f6d4ac8771c9d5c4abe30c71e8bd856efd69e032926d2ae6700d9bc8a29be80c2b8bdd099f7bcbc053794e1a5614348232886d4d4b940b
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.gl",
|
|
6
|
-
"version": "56.0.
|
|
6
|
+
"version": "56.0.5",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.gl-56.0.
|
|
28
|
-
"url": "expo.modules.gl-56.0.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.gl-56.0.5.aar",
|
|
28
|
+
"url": "expo.modules.gl-56.0.5.aar",
|
|
29
|
+
"size": 970871,
|
|
30
|
+
"sha512": "7275be66e8f2ddfdb1f6d4ac8771c9d5c4abe30c71e8bd856efd69e032926d2ae6700d9bc8a29be80c2b8bdd099f7bcbc053794e1a5614348232886d4d4b940b",
|
|
31
|
+
"sha256": "154c6045333bd75e885803be7812c43fb8b70d9e4f1cf890be4f9d841ad16564",
|
|
32
|
+
"sha1": "82afe6ab060b2aa5d95f2dc4d9100b1d3e5578ed",
|
|
33
|
+
"md5": "23787a05e7ead0a5035c7d13206093ad"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
],
|
|
68
68
|
"files": [
|
|
69
69
|
{
|
|
70
|
-
"name": "expo.modules.gl-56.0.
|
|
71
|
-
"url": "expo.modules.gl-56.0.
|
|
72
|
-
"size":
|
|
73
|
-
"sha512": "
|
|
74
|
-
"sha256": "
|
|
75
|
-
"sha1": "
|
|
76
|
-
"md5": "
|
|
70
|
+
"name": "expo.modules.gl-56.0.5.aar",
|
|
71
|
+
"url": "expo.modules.gl-56.0.5.aar",
|
|
72
|
+
"size": 970871,
|
|
73
|
+
"sha512": "7275be66e8f2ddfdb1f6d4ac8771c9d5c4abe30c71e8bd856efd69e032926d2ae6700d9bc8a29be80c2b8bdd099f7bcbc053794e1a5614348232886d4d4b940b",
|
|
74
|
+
"sha256": "154c6045333bd75e885803be7812c43fb8b70d9e4f1cf890be4f9d841ad16564",
|
|
75
|
+
"sha1": "82afe6ab060b2aa5d95f2dc4d9100b1d3e5578ed",
|
|
76
|
+
"md5": "23787a05e7ead0a5035c7d13206093ad"
|
|
77
77
|
}
|
|
78
78
|
]
|
|
79
79
|
},
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
},
|
|
88
88
|
"files": [
|
|
89
89
|
{
|
|
90
|
-
"name": "expo.modules.gl-56.0.
|
|
91
|
-
"url": "expo.modules.gl-56.0.
|
|
92
|
-
"size":
|
|
93
|
-
"sha512": "
|
|
94
|
-
"sha256": "
|
|
95
|
-
"sha1": "
|
|
96
|
-
"md5": "
|
|
90
|
+
"name": "expo.modules.gl-56.0.5-sources.jar",
|
|
91
|
+
"url": "expo.modules.gl-56.0.5-sources.jar",
|
|
92
|
+
"size": 12222,
|
|
93
|
+
"sha512": "0f8d330c85629629bc0c5fe8373ce7e4d2e24720c45ef711ebabf2814d0ffc0de9be7ae71964abd211055fbba194c5c1d389a09020096d3a924e01d818125031",
|
|
94
|
+
"sha256": "3e07f19fe60bbbe25f2df865c8dee91ee9274a2322421f7604c81e8a95424337",
|
|
95
|
+
"sha1": "d7d25999839107f671c14ba9771c640c29f9e5d0",
|
|
96
|
+
"md5": "a84e7ebaca6934fcbf7e033fbc11eac0"
|
|
97
97
|
}
|
|
98
98
|
]
|
|
99
99
|
}
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5ff53cd31af9045809ad9d87980dcefb
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4a56f6f0acb982c4590ccde6feaacbd56e0476f8
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c9ecb5e7c2fb2fbddc12175dc08685d35cd2909013cfc8a28539d11ecb0011b4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6ed7a4d997884b3d06746cc079674f67187f2d0e97157be75ef4d9dd902443e531d7f8adaddf084a54b4e038e48e2b254693401b3a5d92a8024e9b0313895621
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.gl</artifactId>
|
|
12
|
-
<version>56.0.
|
|
12
|
+
<version>56.0.5</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.gl</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3f657ff1d1595816b3080b8dab148065
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.pom.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
61b563690f16b03161793186a2da626fc908fd7b
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ae6bfbab5f7118c1df7326eddb474c6fb5db2d84558834e5c6ecd282ba326aa2
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.5/expo.modules.gl-56.0.5.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3616b2b7e3febddc9fc46347324cec371ec7589ebf19e0f498b3831a395b4028fe0b2854fdc1ed0bdfc74c666abffa90c70f108152967fb1a4b77fa5bc1190e2
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.gl</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>56.0.
|
|
7
|
-
<release>56.0.
|
|
6
|
+
<latest>56.0.5</latest>
|
|
7
|
+
<release>56.0.5</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>56.0.
|
|
9
|
+
<version>56.0.5</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260519105327</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
19f01a8e6f890a66c2ba571a5bd99c5e
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
695f87b434bd6babd6a3df3a9455141ca9cd5334
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c791352b7b662cf7b2825bde00766954715966ec6babb14eb2564097887fdebc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
36af51128748e0670b09cdf03a556ea8815cef5160ff1a9e451f32fde04dcf4f7f843cef293bb48dde601d925b68c8ae4f415840e860321c1ea7774b459e6051
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-gl",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.5",
|
|
4
4
|
"description": "Provides GLView that acts as OpenGL ES render target and gives GL context object implementing WebGL 2.0 specification.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/react-test-renderer": "^19.1.0",
|
|
37
37
|
"@types/webgl2": "^0.0.6",
|
|
38
38
|
"react-test-renderer": "19.2.0",
|
|
39
|
-
"expo": "56.0.0-preview.
|
|
39
|
+
"expo": "56.0.0-preview.13",
|
|
40
40
|
"expo-module-scripts": "56.0.2"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"optional": true
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "290368bc41026449a05a4ebf991b85c3a2fb0e3a",
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "expo-module build",
|
|
64
64
|
"clean": "expo-module clean",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c8b3b9c0eb18c3ed8301bd13091e8954
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4a63c60afb90c5ff1ad1cc5a3a8c47e221c311d2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
03db17b32366e1d504b4afa8e093129c9cf60d3aaaee4a3ca438e77fe7a58c3f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a4ac9ac9f0df52e68cf381fdff15837179f9fb3e45e147180e3adefe1d09dedbd7b6fda3f004900ac68d531f7e3c271ab701b5959b9c98ed94f5751f4c45204e
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar
DELETED
|
Binary file
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
920d285d62da3f8d9351210c8d1828bb
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7cde3650a9c4537ff6ee2673d3d1b863a450cb8b
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9e18bc4b0b35372d933a33fa00ff0008fdbf490e6d27dd56d688e46df3a5c84c
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.aar.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d7571b69874cfe741de280e5f03b293a4b2a88d62fcacaf9be238f3873585c76225c13a4fa451f36958f9ba594fde378ce56147415a40edc644e2bcf1e246de8
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2a8bbf7d7250846b5791601916a11dc5
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
01966a8a6a90c5c01874bc4eabbb32b7f79c7f56
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cbac7e289c16a4f35a594284d875a805b6ffab1e8b7abbb77966bab2e54e380a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b19af0b63864ffe59dd05fb212fef7e10f5db6b97f878bc15547ef919589c719facbebd59a58213ca2431e6ec4715bc8a57d135167a78687948ce2aa8202334f
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
931c01c064c0aee614abc436a7917d0e
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dbecefffd1c2bc4b467fcced2ac82ab13aaf0ec0
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
37c806591fb629ace11e996e2f31710c600429e49ac692a6884b48ab3ea0b00f
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/56.0.4/expo.modules.gl-56.0.4.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9a68846411ca58d07bbb2ca7c10a03a93ebe21401c468e6af23d46824976d0688246c9e53cbadfc9dc89ef8ffcf3f8e2abf928261dee92f3572437f7d4eeed35
|