All Projects → wasabia → flutter_gl

wasabia / flutter_gl

Licence: other
cross-platform call OpenGL API by Dart through dart:ffi. Provides OpenGL with Texture Widget on Flutter.

Programming Languages

c
50402 projects - #5 most used programming language
dart
5743 projects
objective c
16641 projects - #2 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to flutter gl

ConvectionKernels
Fast, high-quality texture compression library for many formats
Stars: ✭ 40 (-63.96%)
Mutual labels:  opengl-es
mojoshader
Use Direct3D shaders with other 3D rendering APIs.
Stars: ✭ 91 (-18.02%)
Mutual labels:  opengl-es
ShaderShowcaseApp
A Jetpack Compose-based app to exhibit all the beautiful GLSL Fragment shaders I have ever written, where you can set them as Live Wallpaper.
Stars: ✭ 173 (+55.86%)
Mutual labels:  opengl-es
lvg
Lion Vector Graphics
Stars: ✭ 106 (-4.5%)
Mutual labels:  opengl-es
ogl to vlk
Vulkan Tutorials For OpenGL Developers
Stars: ✭ 16 (-85.59%)
Mutual labels:  opengl-es
owlos
DIY Open Source OS for building IoT ecosystems
Stars: ✭ 43 (-61.26%)
Mutual labels:  opengl-es
Pigs-In-A-Blanket
A Piglet/ShaccCg Wrapper Library for OpenGL ES 2.0 Support on the Vita
Stars: ✭ 37 (-66.67%)
Mutual labels:  opengl-es
AndroidScreenRecordAndCrop
A simple demo to demonstrate how to record screen using MediaProjectionManager and crop the video using OpenGL ES when recording on Android. Also record audio from microphone.
Stars: ✭ 50 (-54.95%)
Mutual labels:  opengl-es
AndroidGLKit
AndroidGLKit provides OpenGL ES 2.0 boilerplate codes for Android.
Stars: ✭ 22 (-80.18%)
Mutual labels:  opengl-es
COLLADAViewer2
An OBSOLETE instructional OS X application to load/display COLLADA Models and export to compact binary representations.
Stars: ✭ 48 (-56.76%)
Mutual labels:  opengl-es
topologic
Visualiser for basic geometric primitives and fractals in arbitrary-dimensional spaces
Stars: ✭ 39 (-64.86%)
Mutual labels:  opengl-es
beatmup
Beatmup: image and signal processing library
Stars: ✭ 168 (+51.35%)
Mutual labels:  opengl-es
jevoisbase
JeVois base collection of algorithms and modules
Stars: ✭ 41 (-63.06%)
Mutual labels:  opengl-es
magnum-extras
Extras for the Magnum C++11/C++14 graphics engine
Stars: ✭ 26 (-76.58%)
Mutual labels:  opengl-es
expo-gl
Expo module providing WebGL2 implementation
Stars: ✭ 18 (-83.78%)
Mutual labels:  opengl-es
mapbox-gl-qml
Unofficial Mapbox GL Native bindings for Qt QML
Stars: ✭ 30 (-72.97%)
Mutual labels:  opengl-es
image3D
🍊 使用webGL绘制三维图片。📊📈🎉Drawing three-dimensional images using webGL.
Stars: ✭ 13 (-88.29%)
Mutual labels:  opengl-es
Serious-Sam-Android
Porting of Serious Sam: The Second Encounter for android
Stars: ✭ 49 (-55.86%)
Mutual labels:  opengl-es
redcube
JS renderer based on GLTF to WebGPU or WebGL backends.
Stars: ✭ 86 (-22.52%)
Mutual labels:  opengl-es
Shader-Playgrounds
A WebGL shaders editor for beginners and otherwise.
Stars: ✭ 28 (-74.77%)
Mutual labels:  opengl-es

Flutter GL

cross-platform call OpenGL API by Dart through dart:ffi. Provides OpenGL with Texture Widget on Flutter.

Support iOS, Android, Web, macOS, Windows

Linux TODO

Used by three_dart

OpenGL API

the api is similar to WebGL

only support draw to FBO. then share the FBO texture to Native side.

import

import 'package:flutter_gl/flutter_gl.dart';

Usage

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);

why use NativeArray replace Dart List

Dart List convert to ffi pointer need memeory copy.

Run Examples

Clone or download this repo

cd flutter_gl/flutter_gl/example

flutter run

share opengl context with flutter_gl

Android

when init the plugin, save share opengl context with ThreeEgl,

ThreeEgl.setContext("shareContext", shareEglEnv.eglContext);

so you can get it use ThreeEgl lib, then create yourself opengl context share with "shareContext"

shareContext = ThreeEgl.getContext("shareContext");

iOS

for iOS the key is 3 ...

eAGLShareContext = ThreeEgl.getContext(key: 3);

Web

no need ? just webgl

Windows

not support get share context now

Android

check the example project copy the example/android/app/libs/aars/threeegl.aar to your app android project same path

change minSdkVersion 24

Screenshot

screen0

screen1

Issues

File any issues, bugs, or feature requests.

Contributing

Pull request please!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].