Login  Register

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

Posted by Xerxes Rånby on Jun 10, 2015; 1:56am
URL: https://forum.jogamp.org/JOGL-2-0-OpenGL-OpenGL-ES-backend-for-LibGDX-tp4027689p4034628.html

gouessej thank you for updating the JogAmp JOGL LibGDX port to use JOGL 2.3.1 !

I have a pull request for you that re-enable OpenGL ES 2 use,
two issues had sneaked in that triggered early during GL 2 FBO detection.
https://github.com/gouessej/libgdx/pull/5


Some quick notes how to test the gdx-backend-jogamp backend with existing libgdx gradle games/projects:
After running
mvn install
inside libgdx sourcetree to build and install gdx-backend-jogamp in the local maven repository.
1. edit the build.grade file of the libgdx games/project and make sure that mavenLocal() got added to repositorys like this:
    repositories {
        mavenCentral()
        mavenLocal()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
    }

2. add the compiled gdx-backend-jogamp and version number to the project desktop dependencies, like this:
project(":desktop") {
    apply plugin: "java"


    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-jogamp:1.5.6-SNAPSHOT"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
    }
}

3. Update the desktop DesktopLauncher.java file to use the JogAmp JOGL port, like this:
package com.mygdx.game.desktop;

import com.badlogic.gdx.backends.jogamp.JoglApplication;
import com.badlogic.gdx.backends.jogamp.JoglApplicationConfiguration;
import com.mygdx.game.RPiGemo;

public class DesktopLauncher {
        public static void main (String[] arg) {
                JoglApplicationConfiguration config = new JoglApplicationConfiguration();
                new JoglApplication(new RPiGemo(), config);
        }
}

4. then build the libgdx grade project as usual, preferably using eclipse.
The project will now run fine on your desktop dev machine.

5. To have the project running on a ARM GNU/Linux system you have to insert you own compiled libgdxarm.so into the gdx-platform-1.6.2-natives-desktop.jar
This will be fixed when ARM GNU/Linux support is merged into libgdx: https://github.com/libgdx/libgdx/pull/3196
The project will then run fine on the RaspberryPi 2