Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
expo-gl
exports a GLView
class which is a View
that acts as an OpenGL ES render target. On mounting, an OpenGL ES context is created. Its drawing buffer is presented as the contents of the View
every frame.
Firstly, you need to install the package from npm
registry.
npm install expo-gl
or yarn add expo-gl
If you're using Cocoapods, add the dependency to your Podfile
:
pod 'EXGL', path: '../node_modules/expo-gl/ios'
pod 'EXGL-CPP', path: '../node_modules/expo-gl-cpp/cpp'
and run pod install
.
Libraries
β Add Files to [your project's name]
.node_modules
β expo-gl
β ios
and add EXGL.xcodeproj
.node_modules
β expo-gl-cpp
β ios
β EXGL-CPP.xcodeproj
.libEXGL.a
to your project's Build Phases
β Link Binary With Libraries
.Cmd+R
).android/settings.gradle
:
include ':expo-gl'
project(':expo-gl').projectDir = new File(rootProject.projectDir, '../node_modules/expo-gl/android')
include ':expo-gl-cpp'
project(':expo-gl-cpp').projectDir = new File(rootProject.projectDir, '../node_modules/expo-gl-cpp/android')
and if not already included
include ':expo-core'
project(':expo-core').projectDir = new File(rootProject.projectDir, '../node_modules/expo-core/android')
include ':expo-camera-interface'
project(':expo-camera-interface').projectDir = new File(rootProject.projectDir, '../node_modules/expo-camera-interface/android')
include ':expo-file-system-interface'
project(':expo-file-system-interface').projectDir = new File(rootProject.projectDir, '../node_modules/expo-file-system-interface/android')
android/app/build.gradle
:
compile project(':expo-gl')
compile project(':expo-gl-cpp')
and if not already included
compile project(':expo-core')
compile project(':expo-camera-interface')
compile project(':expo-file-system-interface')
import React from 'react';
import { GLView } from 'expo-gl';
export default class ExpoIsAwesome extends React.Component {
onContextCreate = gl => {
// WebGL operations
}
render() {
return (
<GLView onContextCreate={this.onContextCreate} />
);
}
}
Other than the regular View
props for layout and touch handling, the following props are available:
onContextCreate
A function that will be called when the OpenGL ES context is created. The function is passed a single argument gl
that has a WebGLRenderingContext interface.
msaaSamples
GLView
can enable iOS's built-in multisampling. This prop specifies the number of samples to use. By default this is 4. Setting this to 0 turns off multisampling. On Android this is ignored.
takeSnapshotAsync(options)
Same as GLView.takeSnapshotAsync but uses WebGL context that is associated with the view on which the method is called.
GLView.createContextAsync()
Imperative API that creates headless context which is devoid of underlying view. It's useful for headless rendering or in case you want to keep just one context per application and share it between multiple components. It is slightly faster than usual context as it doesn't swap framebuffers and doesn't present them on the canvas, however it may require you to take a snapshot in order to present its results. Also, keep in mind that you need to set up a viewport and create your own framebuffer and texture that you will be drawing to, before you take a snapshot.
A promise that resolves to WebGL context object. See WebGL API for more details.
GLView.destroyContextAsync(gl)
Destroys given context.
A promise that resolves to boolean value that is true
if given context existed and has been destroyed successfully.
GLView.takeSnapshotAsync(gl, options)
Takes a snapshot of the framebuffer and saves it as a file to app's cache directory.
{ x: number, y: number, width: number, height: number }
) -- Rect to crop the snapshot. It's passed directly to glReadPixels
.false
.'jpeg'
or 'png'
. Specifies what type of compression should be used and what is the result file extension. PNG compression is lossless but slower, JPEG is faster but the image has visible artifacts. Defaults to 'jpeg'
.1.0
.Returns { uri, localUri, width, height }
where uri
is a URI to the snapshot. localUri
is a synonym for uri
that makes this object compatible with texImage2D
. width, height
specify the dimensions of the snapshot.
Since the WebGL API is quite low-level, it can be helpful to use higher-level graphics APIs rendering through a GLView
underneath. The following libraries integrate popular graphics APIs:
Any WebGL-supporting library that expects a WebGLRenderingContext could be used. Some times such libraries assume a web JavaScript context (such as assuming document
). Usually this is for resource loading or event handling, with the main rendering logic still only using pure WebGL. So these libraries can usually still be used with a couple workarounds. The Expo-specific integrations above include workarounds for some popular libraries.
Once the component is mounted and the OpenGL ES context has been created, the gl
object received through the onContextCreate
prop becomes the interface to the OpenGL ES context, providing a WebGL API. It resembles a WebGL2RenderingContext in the WebGL 2 spec. However, some older Android devices may not support WebGL2 features. To check whether the device supports WebGL2 it's recommended to use gl instanceof WebGL2RenderingContext
.
An additional method gl.endFrameEXP()
is present which notifies the context that the current frame is ready to be presented. This is similar to a 'swap buffers' API call in other OpenGL platforms.
The following WebGL2RenderingContext methods are currently unimplemented:
getFramebufferAttachmentParameter()
getRenderbufferParameter()
compressedTexImage2D()
compressedTexSubImage2D()
getTexParameter()
getUniform()
getVertexAttrib()
getVertexAttribOffset()
getBufferSubData()
getInternalformatParameter()
renderbufferStorageMultisample()
compressedTexImage3D()
compressedTexSubImage3D()
fenceSync()
isSync()
deleteSync()
clientWaitSync()
waitSync()
getSyncParameter()
getActiveUniformBlockParameter()
The pixels
argument of texImage2D()
must be null
, an ArrayBuffer
with pixel data, or an object of the form { localUri }
where localUri
is the file://
URI of an image in the device's file system. Thus an Expo.Asset
object could be used once .downloadAsync()
has been called on it (and completed) to fetch the resource.
For efficiency reasons the current implementations of the methods don't perform type or bounds checking on their arguments. So, passing invalid arguments could cause a native crash. We plan to update the API to perform argument checking in upcoming SDK versions. Currently the priority for error checking is low since engines generally don't rely on the OpenGL API to perform argument checking and, even otherwise, checks performed by the underlying OpenGL ES implementation are often sufficient.
51.0.0 β 2024-05-07
expo-auth-session
expoClientId
field from auth proxy. (#28590 by @EvanBacon)expo-barcode-scanner
expo-barcode-scanner
is now deprecated. Please use expo-camera
instead. (#26025 by @alanjhughes)expo-constants
expo-face-detector
expo-face-detector
is now deprecated. We recommed using react-native-vision-camera instead. (#26026 by @alanjhughes)expo-location
expo-local-authentication
expo-modules-core
expo-sms
sendSMSAsync
now throws error code ERR_UNAVAILABLE
instead of E_SMS_UNAVAILABLE
. (#27437 by @EvanBacon)expo-sqlite
expo-barcode-scanner
BarCodeScannerResult
now returns an additional raw
field corresponding to the barcode value as it was encoded in the barcode without parsing. Will always be undefined on iOS. (#25391 by @ajacquierbret)expo-blur
expo-asset
expo-camera
BarCodeAnalyzer
now passes an additional raw
field to its onComplete
callback, corresponding to the barcode value as it was encoded in the barcode without parsing. Will always be undefined on iOS. (#25391 by @ajacquierbret)false
instead of permission messages. (#28107 by @EvanBacon)pictureSize
prop to CameraView
component. (#27664 by @alanjhughes)NSMicrophoneUsageDescription
and ignore the mute
prop if they don't intend to use video. (#28156 by @alanjhughes)animateShutter
prop to provide feedback when a picture is taken. Also added shutter sound on android. (#28211 by @alanjhughes)expo-constants
expo-crypto
expo-contacts
expo-font
expo-file-system
expo-haptics
rigid
and soft
impact types (#28169 by @rodperottoni)expo-image-picker
false
instead of permission messages. (#28107 by @EvanBacon)legacy
option to ImagePickerOptions
to allow using the legacy image picker on android. (#28514 by @alanjhughes)expo-image-manipulator
expo-linear-gradient
expo-keep-awake
expo-location
formattedAddress
to the LocationGeocodedAddress
. (#26342 by @whysetiawan & @lukmccall) (#26342 by @whysetiawan, @lukmccall) (#26342, #26342 by @whysetiawan, @lukmccall, @whysetiawan, @lukmccall)isAndroidForegroundServiceEnabled
config plugin option #27265 by @brentvatne)false
instead of permission messages. (#28107 by @EvanBacon)expo-localization
expo-local-authentication
expo-network
expo-modules-core
Date
type converter. (#26148 by @alanjhughes)PlatformColor
and DynamicColorIOS
color props. (#26724 by @dlindenkreuz)BarCodeScannerResult
interface now declares an additional raw
field corresponding to the barcode value as it was encoded in the barcode without parsing. Will always be undefined on iOS. (#25391 by @ajacquierbret)createWebModule
function to wrap web functionality with the NativeModule class. (#27739 by @aleqsio)expo.SharedObject
) with a simple mechanism to release native pointer from JS. (#27038 by @tsapeta & #27331 by @lukmccall) (#27038, #27331 by @tsapeta, @lukmccall)AnyExpoView
(#27284 by @dominicstop)startObserving
and stopObserving
in the new EventEmitter
class. (#27393 by @tsapeta)NativeModule
class that inherits from EventEmitter
. (#27510 by @tsapeta)OnStartObserving
and OnStopObserving
can now be attached to a specific event. (#27766 by @tsapeta)reloadAppAsync
to reload the app. (#28400 by @kudo)expo-media-library
expo-screen-capture
expo-secure-store
false
instead of permission messages. (#28107 by @EvanBacon)canUseBiometricAuthentication
function. (#26767 by @behenate)expo-store-review
StoreReview.isAvailableAsync()
on iOS now resolves to false
for apps distributed through TestFlight. (#25900 by @gabrieldonadel)expo-sqlite
SQLiteStatement.executeForRawResultAsync()
in expo-sqlite/next
API which returns array based raw values than key-value based row value. (#26073 by @kudo)expo.sqlite.customBuildFlags
gradle property to support custom sqlite3 building flags. (#27385 by @kudo)serializeAsync()
and deserializeDatabaseAsync()
to serialze and deserialize databases. (#27422 by @kudo)SQLiteProvider.assetSource
to import an existing database from assets. (#28291 by @kudo)expo-av
Events
to AVModule
to prevent event emitter warning. (#26434 by @alanjhughes)AVManager
. (#28159 by @lukmccall)HashMap cannot be cast to ReadableNativeMap
error on Android. (#28317 by @lukmccall)expo-blur
setNativeProps
being removed. (#27721 by @EvanBacon)expo-asset
unstable_path
in development. (#26084 by @EvanBacon)TypeError: (0, _ExpoAsset.downloadAsync) is not a function
when loading assets using Expo Web. (#28405 by @jamiees2)downloadAsync()
does not support Android resources from release builds. (#28604 by @kudo)expo-calendar
expo-camera
iOS
, barcode types were not converted correctly causing the scanner to not start immediately. (#26704 by @alanjhughes)iOS
, fix maxDuration
timescale on videos. (#26882 by @alanjhughes)Android
, fix the camera not being released when the view is destroyed. (#27086 by @alanjhughes)iOS
, fix the orientation value in onResponsiveOrientationChanged
when exif
is set to true. (#27314 by @alanjhughes)Android
, fix empty qualities being passed to QualitySelector (#27126 by @leonhh)web
, prevent creating a webworker when rendering on the server (#27222 by @marklawlor)iOS
, fix method call on an optional variable. (#27235 by @alanjhughes)flash
being passed to native. (#27394 by @alanjhughes)mute
prop is passed to native so it is correctly initialiased even when not provided from JS. (#27546 by @alanjhughes)iOS
, fix camera orientation on initial render. (#27545 by @alanjhughes)iOS
, fix an issue where the configuration can be interuppted when the dev menu is presented on intial launch. (#27572 by @alanjhughes)iOS
, fix getAvailablePictureSizes
in the legacy package. (#27642 by @alanjhughes)iOS
where the barcode types did not match the typescript representation. Also enabled scanning upc_a
codes on iOS
. (#28233 by @alanjhughes)iOS
, fixed regression where recording a video captures dark frames. Reduced frequency of camera initialization. (#28427 by @alanjhughes)expo-constants
expo-contacts
expo-device
Device.productName
now returns Build.PRODUCT
instead of Build.DEVICE
. (#27230 by @alex-fournier)expo-font
expo-file-system
iOS
, set httpMethod
on upload requests. (#26516 by @alanjhughes)iOS
, fix upload task requests. (#26880 by @alanjhughes)iOS
, fix an issue with copyAsync
where the copy fails if it is a photo library asset. (#27208 by @alanjhughes)iOS
, resolve the promise manually after copying a PHAsset file. (#27381 by @alanjhughes)CookieHandler
as it's no longer in the module registry and not necessary. (#28145 by @alanjhughes)expo-gl
react-native-reanimated
. (#28414 by @lukmccall)expo-image-picker
fileSize
was named filesize
which did not match the docs & typescript definition. (#27293 by @WookieFPV) (#27293 by @wookieFPV)expo-intent-launcher
double
. However, it must be int
. (#26164 by @Alperengozum)expo-location
expo-task-manager
module for methods that don't use it. (#26200 by @behenate)NullPointerException: it must not be null
. (#26688 by @lukmccall)Android
, prevent location service from starting when permission is not in the manifest. (#27355 by @alanjhughes)expo-localization
expo-modules-core
OnCreate
was called before the React
instance was ready. (#25866 by @lukmccall)SharedObjectRegistry
crash for accessing internal data structures from multi-threads. (#25997 by @kudo)SharedObject
leakage on Android. (#25995 by @kudo)Enumerable
. (#26108 by @alanjhughes)Serializable
types are not obfuscated. (#26545 by @alanjhughes)onCreate
before OnActivityEntersForeground
event. (#26944 by @lukmccall)RCTHost
is not retained on iOS bridgeless mode. (#27715 by @kudo)recreateRootViewWithBundleURL
parameters. (#27989 by @gabrieldonadel)ExpoBridgeModule.installModules()
is broken on Android and bridgeless mode. (#28065 by @kudo)expo::MethodMetadata::convertJSIArgsToJNI
. (#28163 by @lukmccall)TypeError: Cannot read property 'NativeModule' of undefined
exceptions on Android. (#28200 by @kudo)fallbackToCacheTimeout
. (#28227 by @kudo)EXJavaScriptObject
accesses to dangling pointers. (#28262 by @kudo)AppContext.onHostResume()
sometimes getting null currentActivity
on Android. (#28338 by @kudo)std::shared_ptr<JavaCalllback::CallbackContext>::__on_zero_shared
. (#28483 by @lukmccall)field operation on NULL object
when reloading the app. (#28555 by @lukmccall)expo-media-library
default
as sorting key. (#28328 by @aleqsio)expo-notifications
expo-notifications
requiring the expo-task-manager
module to start. (#26227 by @behenate)UnavailabilityError
when trying to use setNotificationCategoryAsync
on web. (#26511 by @marklawlor).native
hardcoded platform imports (#26511 by @marklawlor)Android
, added events to module definition to clear warnings. (#26654 by @alanjhughes)expo-screen-capture
DETECT_SCREEN_CAPTURE
permission. (#27148 by @alanjhughes)expo-screen-orientation
expo-sensors
Android
, add event name to definition in the DeviceMotionModule
. (#26679 by @alanjhughes)expo-store-review
expo-task-manager
Android
, added events to module definition to clear warnings. (#26654 by @alanjhughes)expo-sqlite
NativeStatementBinding
leakage on Android. (#25996 by @kudo)SQLiteDatabase.getAllAsync()
in expo-sqlite/next API. (#26344 by @kudo)expo-sqlite/next
cannot be imported from an ESM project. (#27423 by @kudo)NullPointerException
on Android when opening the same database multiple times. (#27748 by @kudo)expo-video-thumbnails
expo-web-browser
iOS
, fix an issue where rapidly opening and closing the browser would leave the module in a bad state, preventing opening the browser again. (#28452 by @alanjhughes)expo-application
expo-av
com.facebook.react:react-native:+
Android dependency with com.facebook.react:react-android
. (#26237 by @kudo)name
property. (#27437 by @EvanBacon)expo-background-fetch
name
property. (#27437 by @EvanBacon)expo-auth-session
expo-battery
name
property. (#27437 by @EvanBacon)expo-brightness
name
property. (#27437 by @EvanBacon)expo-barcode-scanner
name
property. (#27437 by @EvanBacon)expo-blur
expo-asset
downloadAsync
to a native implementation. (#27369 by @aleqsio)expo-calendar
name
property. (#27437 by @EvanBacon)expo-cellular
expo-camera
Barcode
consistent. (#26900 by @alanjhughes)name
property. (#27437 by @EvanBacon)Android
, requesting audio permissions was meant to be optional in the config plugin. (#27365 by @alanjhughes)Android
, only recreate camera after certain props have changed. (#27952 by @alanjhughes)next
package to stable. (#28226 by @alanjhughes)expo-clipboard
expo-constants
expo-crypto
name
property. (#27437 by @EvanBacon)https
. (#26729 by @EvanBacon)expo-contacts
name
property. (#27437 by @EvanBacon)ShareOptions
type for shareContactAsync
parameter typing. (#26208 by @Simek)expo-device
expo-document-picker
name
property. (#27437 by @EvanBacon)expo-font
name
property. (#27437 by @EvanBacon)expo-face-detector
name
property. (#27437 by @EvanBacon)expo-file-system
expo-gl
expo-haptics
name
property. (#27437 by @EvanBacon)expo-image-loader
expo-image-picker
name
property. (#27437 by @EvanBacon).jpeg
in the ImagePicker result. (#26419 by @NikitaDudin)expo-intent-launcher
name
property. (#27437 by @EvanBacon)expo-image-manipulator
name
property. (#27437 by @EvanBacon)expo-linear-gradient
expo-keep-awake
expo-location
expo-localization
expo-local-authentication
name
property. (#27437 by @EvanBacon)expo-mail-composer
expo-network
expo-modules-core
1.8.10
to 1.8.22
. (#25945 by @lukmccall)com.facebook.react:react-native:+
Android dependency with com.facebook.react:react-android
. (#26237 by @kudo)expo.modules.core.Promise
. (#27471 by @aleqsio)global.ExpoModules
. (#26027 by @tsapeta)ObjectDeallocator
is now a native state instead of a host object. (#26906 by @tsapeta)SharedObjectRegistry
being a singleton. (#27032 by @tsapeta)EXCreateReactBindingRootView
to create correct React Native setup for New Architecture mode. (#27216 by @kudo)AppContext
in ExpoBridgeModule
. (#27378 by @alanjhughes)EXReactRootViewFactory.createDefaultReactRootView:
to RCTAppDelegate.recreateRootViewWithBundleURL:
category. (#27945 by @kudo)ReactNativeHostHandler.onReactInstanceException()
for client to listen for exceptions on Android. (#27815 by @kudo)expo-font
and nothing else depends on them. (#26380 by @tsapeta)onDidCreateDevSupportManager
handler to support error recovery from expo-updates. (#28177 by @kudo)ExpoReactDelegateHandler.bundleURL
for clients to override newer bundleURL. (#28256 by @kudo)expo-media-library
name
property. (#27437 by @EvanBacon)ACCESS_MEDIA_LOCATION
Android permission should not pulled into by default and should be pulled through Config Plugins. (#28230 by @kudo)expo-notifications
expo-screen-capture
expo-print
name
property. (#27437 by @EvanBacon)expo-random
name
property. (#27437 by @EvanBacon)expo-screen-orientation
name
property. (#27437 by @EvanBacon)expo-sharing
name
property. (#27437 by @EvanBacon)expo-secure-store
name
property. (#27437 by @EvanBacon)expo-sms
name
property. (#27437 by @EvanBacon)expo-speech
expo-sensors
name
property. (#27437 by @EvanBacon)expo-store-review
name
property. (#27437 by @EvanBacon)expo-task-manager
expo-sqlite
onDatabaseChange
event from legacy API as it is not supported natively. (#26655 by @alanjhughes)name
property. (#27437 by @EvanBacon)expo-video-thumbnails
name
property. (#27437 by @EvanBacon)expo-web-browser
androidx.browser:browser
to 1.6.0
#26619 by @zoontekname
property. (#27437 by @EvanBacon)https
. (#26729 by @EvanBacon)compare-urls
and url
dependencies in favor of built-in URL support. (#26702 by @EvanBacon)unimodules-app-loader
FAQs
Provides GLView that acts as OpenGL ES render target and gives GL context object implementing WebGL 2.0 specification.
The npm package expo-gl receives a total of 12,734 weekly downloads. As such, expo-gl popularity was classified as popular.
We found that expo-gl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 33 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.