Login  Register

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

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

Peter wrote
YEAH! It works!!! Thank you so much Xerxes!
 thank you for verifying that the fixes worked!
I have sent a pull request to gouessej for these two regressions.
https://github.com/gouessej/libgdx/pull/6

Peter wrote
So now i need this, as you sad:

"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 "

How can i do that? Can you explain it step by step?
First build the libgdx.so file, I will explain how by using the patch from my libgdx pull request that is under review.
https://github.com/libgdx/libgdx/pull/3196

lets start by applying the ARM 32 GNU/Linux cross compile support patch.
git cherry-pick 9f5f99a2e7532827c631d54abc331c8c83df1dea

On my x86_64 development machine i will first install a cross compile toolchain that can cross compile for armhf.
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

then i will run from inside the libgdx sourcetree
cd gdx/jni
ant -f build-linux32-arm.xml
ant -f build-linux32-armgnueabihf.xml

after this you will find the two freshly cross compiled libraries in:
libgdx/gdx/libs/linux32arm/libgdxarm.so
and
libgdx/gdx/libs/linux32armhf/libgdxarmgnueabihf.so

good now we need to copy these to libs to a place where they are picked up when you run your game or project on the Raspberry Pi 2.


I have only tested to export my project for use on my Pi's using eclipse runnable jars so i will explain this way of deploying.

After you have exported your project as a runnable jar using eclipse:
Export -> Java -> Runnable jar file
Select the Launch configuration that matches your DesktopLauncher
Select the export destination directory and jar file name.

Select Library handling * Package required libraries into generated JAR (one jar)
OR
Library handling * Copy required libraries into a sub-folder next to the generated JAR

Then click on Finnish

now you have two options
A) copy the generated libgdx/gdx/libs/linux32arm/libgdxarm.so next to the exported jar file
B) open the gdx-platform-1.6.3-natives-desktop.jar that has been bundled inside the exported JAR file or is found in a subfolder next to the exported JAR file.
JAR files are basically .zip files thus you can open a jar file using the gnome Archive Manager and then add the libgdxarm.so to the JAR file (zip)

A) is probably the easiest and will work because libgdx will try to load libgdxarm.so from the java.library.path and the launch directory when it fail to find the library inside the jar.