OpenGL Flutter plugin

OpenGL Android NDK plugin.

YT video


Getting Started

This plugin is only for Android. Is greatly appreciated any help!
This is an early stage of a plugin for Flutter to let the developers to use an OpenGL widget. This is not a binding to let the devs to write OpenGL code within Flutter, but lets to write shader and drawing frame functions in C/C++ code. The plugin is only available for Android OS, looking forward for someone to make it cross-platform!

The example provides 4 drawing shaders classes. They are subclass of Shader.cpp. Each of them need an initShader(void *args) and a drawFrame(void *args) functions which are used by the renderer.cpp engine at creation time. RendererController::nativeSetSurface() has the task to crate the renderer engine.

The 3 example shaders are taken from by nimitz by Darthmarshie by alro

(more to come)


Currently NDK builds for x86_64, x86, arm64-v8a and armeabi-v7a and is available on all ABI lib subfolders but is missing in armeabi-v7a. In example or plugin build.gradle or both, forcing gradle to build only for armeabi-v7a with

ndk {
    abiFilters 'armeabi-v7a'

doesn't work and is missing in the lib folder, but works with command line:

flutter run --debug --target-platform android-arm

(more to come)


Renderer::getWindowWidth() and Renderer::getWindowHeight() doesn't work correctly:
they are used in Renderer::initializeGL() to set window buffer size with ANativeWindow_setBuffersGeometry(), without it the window surface is not working and nothing is displayed.

Add source comments.

Implement a way to pass an OpenGL texture from Flutter to NDK.

Implement iOS layer plugin.

(more to come)