views:

1846

answers:

1

I am trying to set up an Android emulator to do some playing around with OpenGL ES on it, but I am stymied by the fact that, every time I run my program on it, it unceremoniously grenades itself. The problem (at least the first nasty red error line in the log) is a missing package called libhgl.so. This is the OpenGL driver file required for running OpenGL ES on Android devices, but for some reason, my emulator doesn't have it. Does anyone know where I can get drivers for the emulator, or how to get an emulator that already has them?

+1  A: 

In this link:

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

it 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 guess that indicates that the missing file will only exist on the device itself, but that the app should run with the software driver on the emulator. The numerous screenshots on the web of OpenGL apps on the Android emulator also indicates that OpenGL should work fine on the emulator. Any other possible reasons why you are not able to get OpenGL going?

Marius Kjeldahl
I think I see what you're saying... libhgl.so is the hardware implementation and wouldn't be present on the emulator. The program shouldn't even be looking for it. I'll fool around a bit and see if I can find what's looking for libhgl, and try and either get rid of it or point it at libagl.
iandisme
Yes, but from what I've seen on the web the fact that it doesn't find it shouldn't necessarily stop your program from running, assuming it can find the software implementation and resolve the missing functions to that library instead. I agree, it really shouldn't be looking if not necessary, but maybe that is just the way they implemented it? I.e. keep trying libs until symbol is resolved?
Marius Kjeldahl