ent_opengl 0.1.0-dev.4
ent_opengl: ^0.1.0-dev.4 copied to clipboard
The OpenGL ES renderer of Ent Engine: the shared renderer core drawing through OpenGL ES 3, on ANGLE (Metal) on macOS and on the system's OpenGL ES on Android.
ent_opengl #
The OpenGL ES renderer of Ent Engine: OpenGlRenderer draws through OpenGL ES 3, on ANGLE (Metal) on macOS and on
the system's OpenGL ES on Android. It exports all of ent, EntView and OrbitControlsListener, so an app
depends on ent_opengl only.
It draws what ent_flutter's Flutter GPU renderer draws, from the same renderer core and the same
shaders, and is checked against the same reference frames. Use it where Flutter GPU does not run, such as Android phones
where Impeller falls back to OpenGL ES.
Requirements #
- Flutter 3.47.6 or later. Flutter GPU does not need to be enabled.
- macOS: ANGLE comes from the
wranglepackage, bundled with the app (arm64 and x64). - Android: OpenGL ES 3.0, API level 24 or later.
| Platform | Status |
|---|---|
| macOS | Verified on an M1 |
| Android | Verified on a Galaxy S10 (Mali-G76) |
| iOS, Windows, Linux, web | Not supported in this version |
Getting started #
-
Depend on
ent_opengl. -
List the shader variants the app draws with, in a registry file as for
ent_flutter(its README, step 2), and name it underent_opengl, whose build hook compiles them:hooks: user_defines: ent_opengl: shaders: ent_shaders.jsonAn app that uses Flutter GPU on some platforms and OpenGL ES on others depends on both renderer packages, names the same file under each, and says in it which renderer draws where, so each platform carries only its renderer's shaders:
{ "renderers": { "ios": "ent_flutter", "macos": "ent_flutter", "android": "ent_opengl" }, "variants": ["basic"] } -
Install the platform services, create the renderer and show the scene:
FlutterPlatform.install(); final renderer = await OpenGlRenderer.create(antialias: true); EntView( renderer: renderer, scene: scene, camera: camera, onFrame: (elapsed) => cube.rotation.y = elapsed.inMicroseconds / 1e6, );EntViewshows the frames in a FlutterTexturewidget. It does not own the renderer: the app disposes it.
example/main.dart is this as a whole app, and the repository's examples/cube is a bigger one, with
the integration tests. Flutter's widgets define Color and Texture too: import them with hide Color, Texture.
How it draws, which way its rows run, how frames reach the screen and how it compares with the reference frames is in
docs/opengl.md.
Tests #
flutter test --enable-impeller --enable-flutter-gpu
cd ../../examples/cube && flutter build macos --debug && flutter test integration_test/parity_test.dart -d macos
The host tests compare its frames with Flutter GPU's, which needs the flags, and run the parity scenes on ANGLE.
License #
MIT, © 2026 KAMORA Ltd.; see LICENSE.