The lack of OpenGL drivers in the Android emulator

I'm trying to configure the Android emulator to play a little with OpenGL ES on it, but I am confused by the fact that every time I run my program on it, it unceremoniously grenades. The problem (at least the first unpleasant red error line in the log) is the missing libhgl.so package. This is the OpenGL driver file needed to run OpenGL ES on Android devices, but for some reason my emulator does not have it. Does anyone know where I can get drivers for an emulator or how to get an emulator that already has them?

+4
source share
2 answers

In this link:

http://osdir.com/ml/android-porting/2009-06/msg00282.html

He says:

  libEGL.so and libGLESv2.so implements EGL and OpenGL ES through
 libhgl.so and libagl.so.  That is, libhgl.so and libagl.so are
 dlopen () ed by libEGL.so.  All EGL and OpenGL ES calls will finally call
 into libhgl.so and / or libagl.so. 

and here:

http://osdir.com/ml/android-porting/2009-06/msg00288.html

  libagl.so is an pure software impl.  For your accelerated impl., You
 need to provide libhgl.so so that libEGL.so will be able to use it.  It
 is expected that libhgl.so implements and exports both eglXXX and glXXX
 symbols. 

I assume that this means that the missing file will exist only on the device itself, but the application should work with the software driver on the emulator. Numerous screenshots on the Internet of OpenGL applications on the Android emulator also indicate that OpenGL should work fine on the emulator. Any other possible reasons why you cannot get OpenGL?

+4
source

The EGL user space driver loading logic is located in frameworks / native / opengl / libs / EGL / Loader.cpp. There are basically three cases:

  • Work with the emulator in program rendering mode
  • Work with the emulator in OpenGL mode. Here libhgl.so is downloaded for an earlier version of Android.
  • Work with a real device.

The emulator coming with ADT does not work well for case 2. But the emulators have been improved in recent years. You can use the latest version of Android Studio with the best emulator or leapdroid at http://www.leapdroid.com/

+3
source

All Articles