CHAMADA DE PLATMAFOR DE CRUNTA API OpenGL by Dart através do DART: FFI. Fornece o OpenGL com widget de textura no Flutter.
Apoie iOS, Android, Web, MacOS, Windows
Linux TODO
Usado por três_dart
A API é semelhante ao webgl
Somente suporte de suporte para FBO. Em seguida, compartilhe a textura do FBO no lado nativo.
import 'package:flutter_gl/flutter_gl.dart';
int width = 200;
int height = 200;
num dpr = 1.0;
flutterGlPlugin = FlutterGlPlugin();
Map<String, dynamic> _options = {
"width": width,
"height": height,
"dpr": dpr,
"antialias": true,
"alpha": false
};
await flutterGlPlugin.initialize(options: _options);
// on web this need called after web canvas dom was added to document
await flutterGlPlugin.prepareContext();
// you can get gl by
gl = flutterGlPlugin.gl;
// then you can call OpenGL ES API by gl like
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
// use this method to notify Flutter update Texture Widget
// sourceTextue is a texture which bind to FBO framebuffer
flutterGlPlugin.updateTexture(sourceTexture);
Lista de dardos convertem para o ponteiro FFI precisam de cópia de meteoria.
Clone ou faça o download deste repositório
cd flutter_gl/flutter_gl/example
flutter run
Quando initi o plugin, salve o contexto do Share OpenGL com Threeeegl,
ThreeEgl.setContext("shareContext", shareEglEnv.eglContext);
Assim, você pode obtê -lo use threeeegl lib e, em seguida, crie o contexto OpenGL Compartilhe com "ShareContext"
shareContext = ThreeEgl.getContext("shareContext");
Para iOS, a chave é 3 ...
eAGLShareContext = ThreeEgl.getContext(key: 3);
não há necessidade ? apenas webgl
não suporta obter o contexto de compartilhamento agora
Verifique o exemplo do projeto Copie o exemplo/Android/App/libs/Aars/threeeegl.aar para o seu aplicativo Android
Alterar MinsdkVersion 24


Arquive quaisquer problemas, bugs ou solicitações de recursos.
Pull Pedido, por favor!