Login  Register

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

Posted by Xerxes Rånby on Jun 15, 2015; 6:35pm
URL: https://forum.jogamp.org/JOGL-2-0-OpenGL-OpenGL-ES-backend-for-LibGDX-tp4027689p4034702.html

Peter wrote
Hello Xerxes,

I have exported sample project from libgdx, when i try to lunch on Rpi i have this:

pi@raspberrypi ~/Desktop $ ls
libgdxarmgnueabihf.so  libgdxarm.so  libgdx-demo-pax-britannica-1.6.3-SNAPSHOT.jar  test.jar  test_lib
pi@raspberrypi ~/Desktop $ java -jar test.jar
glGetError 0x500
glGetError 0x500
Exception in thread "main" com.jogamp.opengl.GLException: Profile GL2 is not available on null, but: [GLProfile[GLES1/GLES1.hw], GLProfile[GLES2/GLES2.hw], GLProfile[GL2ES1/GLES1.hw], GLProfile[GL2ES2/GLES2.hw], GLProfile[GLES2/GLES2.hw]]
        at com.jogamp.opengl.GLProfile.get(GLProfile.java:990)
        at com.jogamp.opengl.GLProfile.get(GLProfile.java:1003)
        at com.badlogic.gdx.backends.jogamp.JoglGraphicsBase.initialize(JoglGraphicsBase.java:62)
        at com.badlogic.gdx.backends.jogamp.JoglGraphics.<init>(JoglGraphics.java:50)
        at com.badlogic.gdx.backends.jogamp.JoglApplication.initialize(JoglApplication.java:83)
        at com.badlogic.gdx.backends.jogamp.JoglApplication.<init>(JoglApplication.java:77)
        at com.mygdx.game.desktop.DesktopLauncher.main(DesktopLauncher.java:24)

my sample app is here: (and it works fine on osx)

http://tinyurl.com/orxho4u

what is wrong?

greetings,

Peter
Hi

When I wrote the code to fix your desktop OpenGL core shader issue by switching to GL2 I forgot to catch the GLException on OpenGL ES 2 systems.

The following commit fixes the above exception.
https://github.com/xranby/libgdx/commit/fac3bc895e5aeb69eb85237936a2fe3cb6a3fbe1
try cherry  pick this commit.

gouessej has merged this commit thus if you use his master branch then all will work.