Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- When I call getExtensions() from my Fragment I get the error "call to OpenGL ES API with no current context (logged once per thread)".
- Stacktrace:
- 03-29 20:02:32.221: D/libEGL(902): egl.cfg not found, using default config
- 03-29 20:02:32.242: D/libEGL(902): loaded /system/lib/egl/libGLES_android.so
- 03-29 20:02:32.301: E/libEGL(902): call to OpenGL ES API with no current context (logged once per thread)
- package com.example.stuff;
- import javax.microedition.khronos.egl.EGL10;
- import javax.microedition.khronos.egl.EGLConfig;
- import javax.microedition.khronos.egl.EGLContext;
- import javax.microedition.khronos.egl.EGLDisplay;
- import javax.microedition.khronos.opengles.GL10;
- public class Graphics {
- private GL10 mGL;
- public Graphics() {
- EGL10 egl = (EGL10) EGLContext.getEGL();
- EGLDisplay disp = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
- egl.eglInitialize(disp, new int[] {1, 0});
- int[] configSpec = {EGL10.EGL_NONE};
- EGLConfig[] config = new EGLConfig[1];
- int num_configs[] = new int[1];
- egl.eglChooseConfig(disp, configSpec, config, 1, num_configs);
- EGLContext eglContext = egl.eglCreateContext(
- disp,
- config[0],
- EGL10.EGL_NO_CONTEXT,
- null);
- mGL = (GL10) eglContext.getGL();
- }
- public String getExtensions() {
- return mGL.glGetString(GL10.GL_EXTENSIONS);
- }
- }
Add Comment
Please, Sign In to add comment