expo-gl 11.1.0 → 11.2.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/CHANGELOG.md +21 -0
- package/README.md +4 -4
- package/android/build.gradle +42 -25
- package/build/Canvas.d.ts +1 -0
- package/build/Canvas.d.ts.map +1 -0
- package/build/Canvas.js +1 -1
- package/build/Canvas.js.map +1 -1
- package/build/GLErrors.d.ts +1 -0
- package/build/GLErrors.d.ts.map +1 -0
- package/build/GLUtils.d.ts +1 -0
- package/build/GLUtils.d.ts.map +1 -0
- package/build/GLView.d.ts +1 -0
- package/build/GLView.d.ts.map +1 -0
- package/build/GLView.types.d.ts +1 -1
- package/build/GLView.types.d.ts.map +1 -0
- package/build/GLView.types.js.map +1 -1
- package/build/GLView.web.d.ts +1 -0
- package/build/GLView.web.d.ts.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -0
- package/build/types.d.ts +1 -0
- package/build/types.d.ts.map +1 -0
- package/ios/EXGL/EXGLView.mm +1 -1
- package/ios/EXGL.xcframework/Info.plist +5 -5
- package/ios/EXGL.xcframework/ios-arm64/EXGL.framework/EXGL +0 -0
- package/ios/EXGL.xcframework/ios-arm64/EXGL.framework/Info.plist +0 -0
- package/ios/EXGL.xcframework/ios-arm64_x86_64-simulator/EXGL.framework/EXGL +0 -0
- package/ios/EXGL.xcframework/ios-arm64_x86_64-simulator/EXGL.framework/Info.plist +0 -0
- package/package.json +5 -4
- package/src/Canvas.tsx +1 -1
- package/src/GLView.types.ts +0 -2
- package/build/WebGL2RenderingContext.d.ts +0 -411
- package/build/WebGL2RenderingContext.js +0 -2
- package/build/WebGL2RenderingContext.js.map +0 -1
- package/src/WebGL2RenderingContext.ts +0 -1134
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,27 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 11.2.0 — 2022-04-18
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Fix support for React Native 0.68 by building `expo-gl-cpp` from source. ([#17060](https://github.com/expo/expo/pull/17060) by [@wkozyra95](https://github.com/wkozyra95))
|
|
18
|
+
|
|
19
|
+
### ⚠️ Notices
|
|
20
|
+
|
|
21
|
+
- On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
|
|
22
|
+
|
|
23
|
+
## 11.1.2 - 2022-02-01
|
|
24
|
+
|
|
25
|
+
### 🐛 Bug fixes
|
|
26
|
+
|
|
27
|
+
- Fix segfault in iOS draw loop. ([#15653](https://github.com/expo/expo/pull/15653) by [@wkozyra95](https://github.com/wkozyra95))
|
|
28
|
+
- Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
|
|
29
|
+
|
|
30
|
+
## 11.1.1 — 2021-12-08
|
|
31
|
+
|
|
32
|
+
_This version does not introduce any user-facing changes._
|
|
33
|
+
|
|
13
34
|
## 11.1.0 — 2021-12-03
|
|
14
35
|
|
|
15
36
|
### 🎉 New features
|
package/README.md
CHANGED
|
@@ -4,12 +4,12 @@ Provides GLView that acts as OpenGL ES render target and gives GL context object
|
|
|
4
4
|
|
|
5
5
|
# API documentation
|
|
6
6
|
|
|
7
|
-
- [Documentation for the
|
|
8
|
-
- [Documentation for the latest stable release](https://docs.expo.
|
|
7
|
+
- [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/gl-view.md)
|
|
8
|
+
- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/gl-view/)
|
|
9
9
|
|
|
10
10
|
# Installation in managed Expo projects
|
|
11
11
|
|
|
12
|
-
For
|
|
12
|
+
For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/gl-view/).
|
|
13
13
|
|
|
14
14
|
# Installation in bare React Native projects
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ For bare React Native projects, you must ensure that you have [installed and con
|
|
|
17
17
|
|
|
18
18
|
### Install expo-gl-cpp
|
|
19
19
|
|
|
20
|
-
expo-gl requires that you also install and configure [expo-gl-cpp](https://github.com/expo/expo/tree/
|
|
20
|
+
expo-gl requires that you also install and configure [expo-gl-cpp](https://github.com/expo/expo/tree/main/packages/expo-gl-cpp).
|
|
21
21
|
|
|
22
22
|
### Add the package to your npm dependencies
|
|
23
23
|
|
package/android/build.gradle
CHANGED
|
@@ -1,63 +1,80 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
apply plugin: 'kotlin-android'
|
|
3
|
-
apply plugin: 'maven'
|
|
3
|
+
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '11.
|
|
6
|
+
version = '11.2.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
|
+
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
10
|
+
if (expoModulesCorePlugin.exists()) {
|
|
11
|
+
apply from: expoModulesCorePlugin
|
|
12
|
+
applyKotlinExpoModulesCorePlugin()
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
10
16
|
ext.safeExtGet = { prop, fallback ->
|
|
11
17
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
12
18
|
}
|
|
13
19
|
|
|
20
|
+
// Ensures backward compatibility
|
|
21
|
+
ext.getKotlinVersion = {
|
|
22
|
+
if (ext.has("kotlinVersion")) {
|
|
23
|
+
ext.kotlinVersion()
|
|
24
|
+
} else {
|
|
25
|
+
ext.safeExtGet("kotlinVersion", "1.6.10")
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
14
29
|
repositories {
|
|
15
30
|
mavenCentral()
|
|
16
31
|
}
|
|
17
32
|
|
|
18
33
|
dependencies {
|
|
19
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${
|
|
34
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
20
35
|
}
|
|
21
36
|
}
|
|
22
37
|
|
|
23
|
-
//
|
|
24
|
-
configurations {
|
|
25
|
-
deployerJars
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
//Creating sources with comments
|
|
38
|
+
// Creating sources with comments
|
|
29
39
|
task androidSourcesJar(type: Jar) {
|
|
30
40
|
classifier = 'sources'
|
|
31
41
|
from android.sourceSets.main.java.srcDirs
|
|
32
42
|
}
|
|
33
43
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
afterEvaluate {
|
|
45
|
+
publishing {
|
|
46
|
+
publications {
|
|
47
|
+
release(MavenPublication) {
|
|
48
|
+
from components.release
|
|
49
|
+
// Add additional sourcesJar to artifacts
|
|
50
|
+
artifact(androidSourcesJar)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
repositories {
|
|
54
|
+
maven {
|
|
55
|
+
url = mavenLocal().url
|
|
56
|
+
}
|
|
44
57
|
}
|
|
45
58
|
}
|
|
46
59
|
}
|
|
47
60
|
|
|
48
61
|
android {
|
|
49
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
62
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 31)
|
|
50
63
|
|
|
51
64
|
compileOptions {
|
|
52
|
-
sourceCompatibility JavaVersion.
|
|
53
|
-
targetCompatibility JavaVersion.
|
|
65
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
66
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
kotlinOptions {
|
|
70
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
54
71
|
}
|
|
55
72
|
|
|
56
73
|
defaultConfig {
|
|
57
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
58
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
75
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
59
76
|
versionCode 31
|
|
60
|
-
versionName "11.
|
|
77
|
+
versionName "11.2.0"
|
|
61
78
|
}
|
|
62
79
|
|
|
63
80
|
sourceSets.main {
|
|
@@ -73,5 +90,5 @@ dependencies {
|
|
|
73
90
|
implementation project(':expo-gl-cpp')
|
|
74
91
|
implementation project(':expo-modules-core')
|
|
75
92
|
|
|
76
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${
|
|
93
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
77
94
|
}
|
package/build/Canvas.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAmD,SAAS,EAAE,MAAM,cAAc,CAAC;AA2B1F,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAC1C,SAAS,GAAG;IACV,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACzC,CAyEF,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/build/Canvas.js
CHANGED
package/build/Canvas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OA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AAE,aAAa,EAAE,KAAK,EAAE,UAAU,CAAC,YAAY,GAAI;QACxF,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\nimport * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\nfunction getElement(component) {\n try {\n return findDOMNode(component);\n } catch {\n return component;\n }\n}\n\nfunction setRef<T>(refProp: React.Ref<T>, ref: T | null) {\n if (!refProp) return;\n\n if (typeof refProp === 'function') {\n refProp(ref);\n } else if ('current' in refProp) {\n // @ts-ignore\n refProp.current = ref;\n }\n}\n\nconst Canvas = React.forwardRef(\n (props: React.ComponentProps<typeof View>, ref: React.Ref<HTMLCanvasElement>) =>\n createElement('canvas', { ...props, ref })\n);\n\nconst CanvasWrapper: React.FunctionComponent<\n ViewProps & {\n canvasRef: React.Ref<HTMLCanvasElement>;\n }\n> = ({ pointerEvents, children, ...props }) => {\n const [size, setSize] = React.useState<{ width: number; height: number } | null>(null);\n\n const ref = React.useRef<View>(null);\n const _canvasRef = React.useRef<HTMLCanvasElement>(null);\n\n function updateCanvasSize(): void {\n const canvas = _canvasRef.current;\n // eslint-disable-next-line no-undef\n if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {\n const size = getSize();\n const scale = PixelRatio.get();\n\n canvas.style.width = `${size.width}px`;\n canvas.style.height = `${size.height}px`;\n\n canvas.width = size.width * scale;\n canvas.height = size.height * scale;\n }\n }\n\n function getSize(): { width: number; height: number } {\n if (size) {\n return size;\n } else if (!ref.current || !Platform.isDOMAvailable) {\n return { width: 0, height: 0 };\n }\n const element = getElement(ref.current);\n const { offsetWidth: width = 0, offsetHeight: height = 0 } = element;\n return { width, height };\n }\n\n const onLayout = (event: LayoutChangeEvent) => {\n const {\n nativeEvent: {\n layout: { width, height },\n },\n } = event;\n\n if (width !== size?.width || height !== size.height) {\n setSize({ width, height });\n\n if (props.onLayout) {\n props.onLayout(event);\n }\n }\n };\n\n React.useEffect(() => {\n if (ref.current != null) {\n setSize(getSize());\n }\n }, [ref]);\n\n React.useEffect(() => {\n updateCanvasSize();\n }, [size]);\n\n React.useEffect(() => {\n const canvas = _canvasRef.current;\n if (canvas) {\n updateCanvasSize();\n }\n setRef(props.canvasRef, canvas);\n }, [_canvasRef]);\n\n return (\n <View {...props} pointerEvents=\"box-none\" ref={ref} onLayout={onLayout}>\n <Canvas ref={_canvasRef} pointerEvents={pointerEvents} style={StyleSheet.absoluteFill} />\n {children}\n </View>\n );\n};\n\nexport default CanvasWrapper;\n"]}
|
package/build/GLErrors.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GLErrors.d.ts","sourceRoot":"","sources":["../src/GLErrors.ts"],"names":[],"mappings":";;;;;;;;AAAA,wBAOE"}
|
package/build/GLUtils.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ import { ExpoWebGLRenderingContext } from './GLView.types';
|
|
|
3
3
|
* Sets up `__expoSetLogging` method providing some logging options useful when debugging GL calls.
|
|
4
4
|
*/
|
|
5
5
|
export declare function configureLogging(gl: ExpoWebGLRenderingContext): void;
|
|
6
|
+
//# sourceMappingURL=GLUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GLUtils.d.ts","sourceRoot":"","sources":["../src/GLUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAmB,MAAM,gBAAgB,CAAC;AAO5E;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,yBAAyB,GAAG,IAAI,CAgFpE"}
|
package/build/GLView.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GLView.d.ts","sourceRoot":"","sources":["../src/GLView.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK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AAY,CAAC;IAmBrF,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3D,iBAAiB,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAO5E"}
|
package/build/GLView.types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Component, ComponentClass } from 'react';
|
|
2
2
|
import { ViewProps } from 'react-native';
|
|
3
|
-
import WebGL2RenderingContext from './WebGL2RenderingContext';
|
|
4
3
|
export declare type SurfaceCreateEvent = {
|
|
5
4
|
nativeEvent: {
|
|
6
5
|
exglCtxId: number;
|
|
@@ -76,3 +75,4 @@ export declare enum GLLoggingOption {
|
|
|
76
75
|
*/
|
|
77
76
|
ALL = 15
|
|
78
77
|
}
|
|
78
|
+
//# sourceMappingURL=GLView.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GLView.types.d.ts","sourceRoot":"","sources":["../src/GLView.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,oBAAY,kBAAkB,GAAG;IAC/B,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,IAAI,CAAC,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,yBAA0B,SAAQ,sBAAsB;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,IAAI,IAAI,CAAC;IACpB,QAAQ,IAAI,IAAI,CAAC;IACjB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CACjD;AAED,oBAAY,iBAAiB,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD;;;OAGG;IACH,eAAe,CAAC,EAAE,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAErD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,oBAAY,eAAe;IACzB;;OAEG;IACH,QAAQ,IAAI;IAEZ;;OAEG;IACH,YAAY,IAAI;IAEhB;;;OAGG;IACH,UAAU,IAAI;IAEd;;OAEG;IACH,iBAAiB,IAAI;IAErB;;;OAGG;IACH,gBAAgB,IAAI;IAEpB;;OAEG;IACH,GAAG,KAAmE;CACvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GLView.types.js","sourceRoot":"","sources":["../src/GLView.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GLView.types.js","sourceRoot":"","sources":["../src/GLView.types.ts"],"names":[],"mappings":"AAyDA,MAAM,CAAN,IAAY,eAgCX;AAhCD,WAAY,eAAe;IACzB;;OAEG;IACH,6DAAY,CAAA;IAEZ;;OAEG;IACH,qEAAgB,CAAA;IAEhB;;;OAGG;IACH,iEAAc,CAAA;IAEd;;OAEG;IACH,+EAAqB,CAAA;IAErB;;;OAGG;IACH,6EAAoB,CAAA;IAEpB;;OAEG;IACH,oDAAsE,CAAA;AACxE,CAAC,EAhCW,eAAe,KAAf,eAAe,QAgC1B","sourcesContent":["import { Component, ComponentClass } from 'react';\nimport { ViewProps } from 'react-native';\n\nexport type SurfaceCreateEvent = {\n nativeEvent: {\n exglCtxId: number;\n };\n};\n\nexport type SnapshotOptions = {\n flip?: boolean;\n framebuffer?: WebGLFramebuffer;\n rect?: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n format?: 'jpeg' | 'png';\n compress?: number;\n};\n\nexport type GLSnapshot = {\n uri: string | Blob | null;\n localUri: string;\n width: number;\n height: number;\n};\n\nexport interface ExpoWebGLRenderingContext extends WebGL2RenderingContext {\n contextId: number;\n endFrameEXP(): void;\n flushEXP(): void;\n __expoSetLogging(option: GLLoggingOption): void;\n}\n\nexport type ComponentOrHandle = null | number | Component<any, any> | ComponentClass<any>;\n\n/**\n *\n * A View that acts as an OpenGL ES render target. On mounting, an OpenGL ES\n * context is created. Its drawing buffer is presented as the contents of\n * the View every frame.\n */\nexport interface BaseGLViewProps extends ViewProps {\n /**\n * Called when the OpenGL context is created, with the context object as a parameter. The context\n * object has an API mirroring WebGL's WebGLRenderingContext.\n */\n onContextCreate(gl: ExpoWebGLRenderingContext): void;\n\n /**\n * [iOS only] Number of samples for Apple's built-in multisampling.\n */\n msaaSamples?: number;\n}\n\nexport enum GLLoggingOption {\n /**\n * Disables logging entirely.\n */\n DISABLED = 0,\n\n /**\n * Logs method calls, their parameters and results.\n */\n METHOD_CALLS = 1,\n\n /**\n * Calls `gl.getError()` after each other method call and prints an error if any is returned.\n * This option has a significant impact on the performance as this method is blocking.\n */\n GET_ERRORS = 2,\n\n /**\n * Resolves parameters of type `number` to their constant names.\n */\n RESOLVE_CONSTANTS = 4,\n\n /**\n * When this option is enabled, long strings will be truncated.\n * It's useful if your shaders are really big and logging them significantly reduces performance.\n */\n TRUNCATE_STRINGS = 8,\n\n /**\n * Enables all other options. It implies `GET_ERRORS` so be aware of the slowdown.\n */\n ALL = METHOD_CALLS | GET_ERRORS | RESOLVE_CONSTANTS | TRUNCATE_STRINGS,\n}\n"]}
|
package/build/GLView.web.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GLView.web.d.ts","sourceRoot":"","sources":["../src/GLView.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EACL,eAAe,EACf,iBAAiB,EAEjB,UAAU,EACV,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAmExB,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,eAAe,EAAE,CAAC,EAAE,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACrD,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACzD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,sBAAsB,CAAC,CAAC,QAAQ,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,IAAI,OAAE;CACjF;AA8BD,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;IACtD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,EAAE,CAAC,EAAE,qBAAqB,CAAC;WAEd,kBAAkB,IAAI,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;WAW3D,mBAAmB,CAAC,IAAI,CAAC,EAAE,qBAAqB,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;WAK5E,iBAAiB,CAC5B,EAAE,EAAE,qBAAqB,EACzB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,UAAU,CAAC;IAetB,oBAAoB;IAcpB,MAAM;IAgBN,kBAAkB,CAAC,SAAS,EAAE,WAAW;IAQzC,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,aAAa,CASnB;IAEF,OAAO,CAAC,iBAAiB,CAKvB;IAEF,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,YAAY,CAalB;IAEW,iBAAiB,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;IASrE,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtE"}
|
package/build/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
package/build/types.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;CAAG"}
|
package/ios/EXGL/EXGLView.mm
CHANGED
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
// This happens exactly at `gl.endFrameEXP()` in the queue
|
|
247
247
|
if (_viewColorbuffer != 0 && !_renderbufferPresented) {
|
|
248
248
|
// bind renderbuffer and present it on the layer
|
|
249
|
-
[_glContext
|
|
249
|
+
[_glContext runAsync:^{
|
|
250
250
|
glBindRenderbuffer(GL_RENDERBUFFER, self->_viewColorbuffer);
|
|
251
251
|
[self->_uiEaglCtx presentRenderbuffer:GL_RENDERBUFFER];
|
|
252
252
|
}];
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
<array>
|
|
7
7
|
<dict>
|
|
8
8
|
<key>LibraryIdentifier</key>
|
|
9
|
-
<string>ios-
|
|
9
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
10
10
|
<key>LibraryPath</key>
|
|
11
11
|
<string>EXGL.framework</string>
|
|
12
12
|
<key>SupportedArchitectures</key>
|
|
13
13
|
<array>
|
|
14
14
|
<string>arm64</string>
|
|
15
|
+
<string>x86_64</string>
|
|
15
16
|
</array>
|
|
16
17
|
<key>SupportedPlatform</key>
|
|
17
18
|
<string>ios</string>
|
|
19
|
+
<key>SupportedPlatformVariant</key>
|
|
20
|
+
<string>simulator</string>
|
|
18
21
|
</dict>
|
|
19
22
|
<dict>
|
|
20
23
|
<key>LibraryIdentifier</key>
|
|
21
|
-
<string>ios-
|
|
24
|
+
<string>ios-arm64</string>
|
|
22
25
|
<key>LibraryPath</key>
|
|
23
26
|
<string>EXGL.framework</string>
|
|
24
27
|
<key>SupportedArchitectures</key>
|
|
25
28
|
<array>
|
|
26
29
|
<string>arm64</string>
|
|
27
|
-
<string>x86_64</string>
|
|
28
30
|
</array>
|
|
29
31
|
<key>SupportedPlatform</key>
|
|
30
32
|
<string>ios</string>
|
|
31
|
-
<key>SupportedPlatformVariant</key>
|
|
32
|
-
<string>simulator</string>
|
|
33
33
|
</dict>
|
|
34
34
|
</array>
|
|
35
35
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-gl",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
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",
|
|
@@ -37,17 +37,18 @@
|
|
|
37
37
|
"preset": "expo-module-scripts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"expo-gl-cpp": "~11.
|
|
40
|
+
"expo-gl-cpp": "~11.2.0",
|
|
41
41
|
"invariant": "^2.2.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/invariant": "^2.2.33",
|
|
45
45
|
"@types/offscreencanvas": "2019.6.4",
|
|
46
|
+
"@types/webgl2": "^0.0.6",
|
|
46
47
|
"expo-module-scripts": "^2.0.0",
|
|
47
|
-
"react-test-renderer": "~17.0.
|
|
48
|
+
"react-test-renderer": "~17.0.2"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"expo": "*"
|
|
51
52
|
},
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "22dce752354bb429c84851bc4389abe47a766b1f"
|
|
53
54
|
}
|
package/src/Canvas.tsx
CHANGED
package/src/GLView.types.ts
CHANGED