Christian
Christian

Reputation: 241

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?

Upvotes: 4

Views: 3319

Answers (1)

kallyena
kallyena

Reputation: 61

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

Upvotes: 2

Related Questions