flutter_gl
1.0.0
다트를 통해 DART : FFI를 통해 Cross-Platform Call OpenGL API. Flutter에 텍스처 위젯을 제공하는 OpenGL을 제공합니다.
iOS, Android, 웹, MacOS, Windows를 지원합니다
Linux Todo
Three_dart에서 사용합니다
API는 WebGL과 유사합니다
FBO에 대한 추첨 만 지원합니다. 그런 다음 FBO 텍스처를 기본 측면에 공유하십시오.
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);
DART 목록 FFI 포인터로 변환하여 밈 사본이 필요합니다.
이 저장소를 복제하거나 다운로드하십시오
cd flutter_gl/flutter_gl/example
flutter run
플러그인을 시작하면 threeegl과 함께 OpenGL 컨텍스트를 공유하는 것을 저장합니다.
ThreeEgl.setContext("shareContext", shareEglEnv.eglContext);
따라서 threeegl lib를 사용하게 된 다음 "ShareContext"와 함께 OpenGL 컨텍스트 공유를 만들 수 있습니다.
shareContext = ThreeEgl.getContext("shareContext");
iOS의 경우 키는 3입니다.
eAGLShareContext = ThreeEgl.getContext(key: 3);
필요 없습니까? 그냥 webgl
지원하지 않음 지금 공유 컨텍스트를 얻으십시오
예제 프로젝트 확인 예제/android/app/libs/aars/threeegl.aar app android 프로젝트 동일한 경로에 복사하십시오.
minsdkversion 24를 변경하십시오


문제, 버그 또는 기능 요청을 제출하십시오.
요청을 풀어주세요!