Login  Register

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

Posted by krishnak on Feb 17, 2013; 11:45am
URL: https://forum.jogamp.org/JOGL-2-0-OpenGL-OpenGL-ES-backend-for-LibGDX-tp4027689p4028241.html

I am posting the full code - it is  just a sample app from the tutorial.

package mygame;

import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;




/**
 * test
 * @author normenhansen
 */
public class Main extends SimpleApplication {

    public static void main(String[] args) {
        Main app = new Main();
        app.start();
    }

    @Override
    public void simpleInitApp() {
        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
        Geometry geom = new Geometry("Box", b);

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Blue);
        geom.setMaterial(mat);

        rootNode.attachChild(geom);
    }

    @Override
    public void simpleUpdate(float tpf) {
        //TODO: add update code
    }

    @Override
    public void simpleRender(RenderManager rm) {
        //TODO: add render code
    }
    public void start()
    {
    settings.setRenderer("JOGL");
    settings.setAudioRenderer("JOAL");
    }
}


OUTPUT
Exception in thread "main" java.lang.NullPointerException jME3_SDK_3.0RC2-linux.sh

        at mygame.Main.start(Main.java:49)
        at mygame.Main.main(Main.java:22)

As you can see - the stack trace doesn't say much. If I remove the start or comment those settings.setRenderer - I get the code running with lwjgl.

Do I need to build JMonkey from source from google code in order to get JOGL working ? I am currently checking out the code using SVN to try to build it from source

Till now I have been using jME3_SDK_3.0RC2-linux.sh

I have tried the code on JMonkeyEngine (Netbeans) as well as with Eclipse - the error remains the same.