Skip to main content

ent_opengl 0.1.0-dev.1 copy "ent_opengl: ^0.1.0-dev.1" to clipboard
ent_opengl: ^0.1.0-dev.1 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.

example/lib/main.dart

// A turning cube drawn by OpenGlRenderer (OpenGL ES on ANGLE) in an EntView.
import 'package:ent_opengl/ent_opengl.dart';
import 'package:flutter/widgets.dart' hide Color, Texture;

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(Example(await OpenGlRenderer.create(antialias: true)));
}

class Example extends StatelessWidget {
  Example(this.renderer, {super.key}) {
    scene.add(cube);
  }

  final OpenGlRenderer renderer;

  final scene = Scene()..background = Color(0x203040);

  final camera = PerspectiveCamera(50, 1, 0.1, 100)..position.z = 3;

  final cube = Mesh(BoxGeometry(1, 1, 1), MeshNormalMaterial());

  @override
  Widget build(BuildContext context) {
    return Directionality(
      textDirection: TextDirection.ltr,
      child: EntView(
        renderer: renderer,
        scene: scene,
        camera: camera,
        onFrame: (elapsed) => cube.rotation.set(elapsed.inMilliseconds / 1000, elapsed.inMilliseconds / 1500, 0),
      ),
    );
  }
}
0
likes
0
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

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.

Repository (GitHub)
View/report issues

Topics

#graphics #rendering #opengl

License

unknown (license)

Dependencies

code_assets, ent, ent_impeller, ent_renderer, ffi, flutter, hooks, vector_math, wrangle

More

Packages that depend on ent_opengl

Packages that implement ent_opengl