OpenGL ES: is it not ready or am I just doing something wrong?

Started by WizardStan, October 29, 2012, 00:09:12

Previous topic - Next topic


I've seen a few posts around the internet saying it was working, and even the wiki says it works if you can build it yourself, so I did.  I checked out the most recent from svn, and built compile_native_es and jars_es.  The first hint I got that something wasn't ready was two compile bugs in the native lib: extgl_egl.h doesn't define APIENTRY like extgl.h does, preventing it from compiling on anything other than Windows (fixed by copying the ifndef/define from extgl.h to extgl_egl.h) and extgl_types.h defines GLsync twice (fixed by just commenting one of them out).  So that eventually got me a JAR and an .so.
So I use the first tutorial here to try and get something running.  I get an error
"Exception in thread "main" java.lang.UnsatisfiedLinkError: org.lwjgl.opengl.GLContext.nLoadOpenGLLibrary()V
at org.lwjgl.opengl.GLContext.nLoadOpenGLLibrary(Native Method)"
So it is trying to get the nLoadOpenGLLibrary from the standard GLContext where the ES library has the entry point Java_org_lwjgl_opengles_GLContext_nLoadOpenGLLibrary.  That obviously isn't going to work, I'm clearly doing something wrong.
But tracing through the libraries source code, while the code for calling the GLESContext version of the library exists, there doesn't seem to be any path to get there.  Display.create() will ALWAYS create a DrawableGL first thing and doesn't seem to possess any way of changing that to a DrawableGLES.

Has anyone successfully gotten an OpenGLES application to work that can tell me what I'm doing wrong?


Sorry to be bringing this up again, I just really want to know: either someone has gotten it to work and I'm doing something wrong or it just isn't ready yet.  If it's supposed to be working then I have bugs to report.  If it's not supposed to be working yet then I don't.


Thanks for reporting the compilation problems, they should be fixed now. OpenGL ES should be working, so feel free to report any other issues.

The tutorial you linked will not work for ES because it creates a desktop GL context. You can have a look at the org.lwjgl.test.opengles package for working OpenGL ES samples. The correct way to create an ES context is:

Display.create(new org.lwjgl.opengles.PixelFormat());

Notice how the ES version of PixelFormat is used instead of the one in the org.lwjgl.opengl package. Admittedly this is very bad API, but was the best we could at the time with minimal changes to the library. It will get better in the next major LWJGL release.


Thank you very much! That'd be what I was doing wrong. I've checked out the latest and am rebuilding now.  I'll update my experiments to specify the right pixel format and see if I have any problems, but I don't think I will now.