wasabia / flutter_gl

cross-platform call OpenGL API by Dart through dart:ffi. Provides OpenGL with Texture Widget on Flutter.
245 stars 60 forks source link

Image example #13

Closed sokryptk closed 2 years ago

sokryptk commented 2 years ago

Can you add an example where you use images/videos and manipulate them?

Would be helpful for beginners like me.

Thanks!

wasabia commented 2 years ago

Hi @krypticallusion

no example now,

for images is same to webgl or opengl decode image get pixels then upload to texture, use NativeArray for pixels https://github.com/wasabia/three_dart/blob/7a62955a2dc98dfddf1d2d18c74fe19ac3fa5657/lib/three3d/renderers/webgl/WebGLTextures.dart#L903

videos need write native code decode videos, you can get share opengl context https://github.com/wasabia/flutter_gl#share-opengl-context-with-flutter_gl

then you can create your opengl context with the share context, decode video with your context then return Texture, use Texture with flutter_gl

sokryptk commented 2 years ago

Thanks for the explaination!