OPENGL ES no funciona: no Contexto actual

He probado el programa como se muestra en el libro OpenGL ES2 para Android, pero no funciona !!

¡He probado en Odroid E, samsung s3, samsung y, estrella de samsung !!

the gl version suported returns 2, but i get 11-22 15:09:45.804: E/oGl-es v(9047): 2.0:131072 11-22 15:09:45.804: E/libEGL(9047): call to OpenGL ES API with no current context (logged once per thread) 11-22 15:09:45.804: E/unable to(9047): createShader 11-22 15:09:45.804: E/libEGL(9047): call to OpenGL ES API with no current context (logged once per thread) 11-22 15:09:45.804: E/unable to(9047): createShader 11-22 15:09:45.804: E/libEGL(9047): call to OpenGL ES API with no current context (logged once per thread) 11-22 15:09:45.804: E/Error creating(9047): GL programObject 11-22 15:09:45.812: E/render(9047): set 11-22 15:09:46.062: E/Results of validating program:(9047): 0 11-22 15:09:46.062: E/Results of validating program:(9047): Log: 

A continuación se muestra mi código

 public class Main_OGLT1 extends Activity { MySurface mGLSurfaceView; private boolean renderSet; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mGLSurfaceView = new MySurface(this);//(this); //instantiation ActivityManager actMan = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ConfigurationInfo mConfigInfo = actMan.getDeviceConfigurationInfo(); boolean isES2Compat = (mConfigInfo.reqGlEsVersion >= 0x20000); Log.e("oGl-es v",mConfigInfo.getGlEsVersion()+":"+ mConfigInfo.reqGlEsVersion); if(isES2Compat){ renderSet = true; Log.e("render","set"); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_main__oglt1, menu); return true; } @Override protected void onResume() { // The activity must call the GL surface view's onResume() on activity onResume(). super.onResume(); mGLSurfaceView.onResume(); } @Override protected void onPause() { // The activity must call the GL surface view's onPause() on activity onPause(). super.onPause(); mGLSurfaceView.onPause(); } } 

La clase MySurface:

  public class MySurface extends GLSurfaceView{ public MySurface(Context context) { super(context); // TODO Auto-generated constructor stub setEGLContextClientVersion(2); setRenderer(new MyTestRenderer(getContext())); } } 

El problema es con glSurfaceView, ya que no se ejecuta en el hilo de OpenGL. El glSurfaceView debe estar en el hilo principal de Android.

Aquí encontrará más información al respecto:

Opengl es api sin contexto actual

Contexto de OpenGL ES 2.0 en Android

Espero que esto ayude.

  • OpenGL ES 2.0 PNG canal alfa
  • Libgdx: SpriteBatch, shader de fragmentos en dispositivos Samsung Android funcionan incorrectamente
  • Threading proceso de carga de texturas para el juego opengl android
  • Cómo cargar recursos o activos en GLWallpaper service
  • Error de EGL al intentar ejecutar mapsActivity en el emulador de Android
  • Primeros pasos para crear un efecto de chroma key utilizando la cámara android
  • ¿Por qué está bloqueando glClear en OpenGLES?
  • Pasar atributos personalizados a un shader de fragmentos personalizado
  • Uso de muPDF con efecto curl / flip
  • Android OpenGL Renderizar a un frameBuffer en la resolución original (pequeña) y luego escalarla (viewPort) al tamaño de la pantalla
  • OpenGL se bloquea al vincular el programa, LG Nexus 4
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.