Login  Register

Re: GLJPanel for LibGDX JOGL backend

Posted by Xerxes Rånby on Jun 25, 2015; 9:17am
URL: https://forum.jogamp.org/GLJPanel-for-LibGDX-JOGL-backend-tp4034741p4034757.html

gouessej wrote
adam_law wrote
I think one of the reasons I missed the JOGL backend was that it's not yet merged with the official LibGDX project?
It will be probably never merged into the official LibGDX project but it doesn't prevent anybody from using it. If you really need something "official", you will never use our stuff. We can't force the LibGDX maintainers to accept our pull requests.

adam_law wrote
From what I've read just now, there's a flurry of activity that got the backend up to LibGDX 1.6.2, and there will be a Maven tree up soon with a pre-compiled jar. I think I'll wait for that, if it's coming soon. I tried adding the line for the backend to my gradle build, but it seems that the resource is no longer available e.g. compile "com.badlogicgames.gdx:gdx-backend-jogamp:1.5.6-SNAPSHOT".
Maybe Xerxes knows why.
Trying to combine atrifacts from two different builds using two differrnt version numbers is not recommended, it may work but it is not something that jogamp or libgdx can support. Instead i reccomend that you do the following:

The latest JOGL libgdx port is in sync with LibGDX 1.6.3-SNAPSHOT
if you checkout gouessej's libgdx master tree

git clone https://github.com/gouessej/libgdx
cd libgdx

and run

mvn install

you will build both libgdx 1.6.3-SNAPSHOT and gdx-backend-jogamp 1.6.3-SNAPSHOT and install them both into your own local maven repository.

I highly recommend that you use the combination of libgdx and gdx-backedn-jogamp artifacts produced from one build because that is a combination that we can support.

Inside your applications projects build.gradle file you then add mavenLocal() to the list of repositorys
and use 1.6.3-SNAPSHOT as the version of libgdx you want to use.

If your build.gradle file looks like this then you will always use the latest libgdx + jogamp backend snapshot version from your local maven repository!

<code>
import groovy.json.JsonSlurper

buildscript {

    ant.get(src: 'http://libgdx.badlogicgames.com/libgdx-site/service/getVersions?release=false', dest: 'versions.json')
    def versionFile = file('versions.json')
    def json
    if (versionFile.exists()) {
        json = new JsonSlurper().parseText(versionFile.text)
    } else throw new GradleException("Unable to retrieve latest versions, please check your internet connection")

    ext {
        gdxVersion = json.libgdxSnapshot
        roboVMVersion = json.robovmVersion
        roboVMGradleVersion = json.robovmPluginVersion
        androidToolsVersion = json.androidBuildtoolsVersion
        androidSDKVersion = json.androidSDKVersion
        androidGradleToolsVersion = json.androidGradleToolVersion
        gwtVersion = json.gwtVersion
        gwtGradleVersion = json.gwtPluginVersion
    }

    repositories {
        mavenLocal()
        jcenter()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    }

}

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = "1.0"
    ext {
        appName = "Pax-Britannica"
    }

    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    }
}

project(":core") {
    apply plugin: "java"

    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
    }
}

project(":desktop") {
    apply plugin: "java"

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

tasks.eclipse.doLast {
    delete ".project"
}
</code>