Hello Guest

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

  • 3 Replies
  • 11427 Views
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?
Thanks!

Re: OpenGL ES: is it not ready or am I just doing something wrong?
« Reply #1 on: November 06, 2012, 03:14:40 »
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.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: OpenGL ES: is it not ready or am I just doing something wrong?
« Reply #2 on: November 06, 2012, 12:21:11 »
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:

Code: [Select]
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.

Re: OpenGL ES: is it not ready or am I just doing something wrong?
« Reply #3 on: November 06, 2012, 13:05:12 »
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.