article

Amelia@Amazon avatar image
Amelia@Amazon posted

How to fix OpenGL Context Crashes when querying capabilities.

Summary

An Android bugfix has created a requirement to create an OpenGL context in order to query GL Attributes

Issue

When running your app on Android 5.0, you may notice that any OpenGL queries that you have made in previous versions of Android without creating an OpenGL context first will now cause the application to crash. For how to deal with losing your OpenGL Context in Android and how to recover the object properly, Google has a really good video describing how to recover your context.

Resolution

Make sure that your context is valid when performing glSwapBuffers(), eglGetConfigs, etc. It will return EGL_FALSE, If that is the case, you will need to invalidate the context, display, and view of your OpenGL app, then rebuild them to a known good state.

Setting up your OpenGL Environment: http://developer.android.com/training/graphics/opengl/environment.html Game On! - Surviving OpenGL Context Loss: https://www.youtube.com/watch?v=NHVtLC5QOpo

Keywords: Resolution, Context, OpenGL, Bugfix

KB_0024

androidlollipop
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Article

Contributors

brizzlebrazzle contributed to this article