Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use android.media.effect.Effect

Can anyone help to point me in the right direction how to use these GPU accelerated Effects available since Android 4.0 on a Bitmap?

The documentation states for example "They must be bound to a GL_TEXTURE_2D texture image". But what would be the best way to do this?

The first step to create a Effect should be "Call EffectContext.createWithCurrentGlContext() from your OpenGL ES 2.0 context." But when I do this in my activity it fails with exception "Attempting to initialize EffectContext with no active GL context". But then how do I get an active GL context?

like image 892
Christian Avatar asked Sep 19 '26 15:09

Christian


1 Answers

because you create an Effect in your Activity, so it throws an Exception. You should create it in method onSurfaceCreated of Renderer interface.

like image 195
kallyena Avatar answered Sep 21 '26 03:09

kallyena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!