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

classic Classic list List threaded Threaded
249 messages Options
1234 ... 13
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
Hi

I've just quickly ported the JOGL backend of LibGDX to JOGL 2.0, I still have to check if some features are missing and to switch to NEWT (+ AWT bridge in some cases):
https://github.com/gouessej/libgdx/tree/master/backends/gdx-backend-jogl

I haven't tested it yet. Best regards.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

Xerxes Rånby
This post was updated on .
Thank you, gouessej i will try this on my arm linux devices.

The obvious missing bits are:
1. include all JogAmp gluegen-rt and jogl native jars to add support for ARM/Linux armel and armhf.

2. fix the ant build.xml
dist/gdx-backend-jogl.jar
dist/sources/gdx-backend-jogl-sources.jar
and possibly
dist/lib/ for the JogAmp gluegen, jogl and native jars is missing
after running ant

How do you build and test the jogl backend?
Reply | Threaded
Open this post in threaded view
|

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

Xerxes Rånby
In reply to this post by gouessej
I have pushed some libgdx jogl tests to:
https://github.com/xranby/libgdx.git

You may run the tests from within eclipse

First test results:
The JoglApplication code still depend on the lwjgl openal implementation and natives:
libEGL warning: failed to create a pipe screen for i965
Exception in thread "main" com.badlogic.gdx.utils.GdxRuntimeException: Creating window failed
        at com.badlogic.gdx.backends.jogl.JoglApplication.<init>(JoglApplication.java:91)
...
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
...
        at org.lwjgl.openal.AL.<clinit>(AL.java:59)
        at com.badlogic.gdx.backends.openal.OpenALAudio.<init>(OpenALAudio.java:70)
        at com.badlogic.gdx.backends.jogl.JoglApplication.initialize(JoglApplication.java:120)
        at com.badlogic.gdx.backends.jogl.JoglApplication$2.run(JoglApplication.java:87)
Reply | Threaded
Open this post in threaded view
|

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

Xerxes Rånby
In reply to this post by Xerxes Rånby
Xerxes Rånby wrote
2. fix the ant build.xml
dist/gdx-backend-jogl.jar
dist/sources/gdx-backend-jogl-sources.jar
and possibly
dist/lib/ for the JogAmp gluegen, jogl and native jars is missing
after running ant
Added a jogl-ant work in progress branch to generate the
dist/gdx-backend-jogl.jar and dist/sources/gdx-backend-jogl-sources.jar jars.
here: https://github.com/xranby/libgdx/tree/jogl-ant
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
In reply to this post by Xerxes Rånby
Have you looked at libs/? Yes some JARs are missing.

I have not tested it yet.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

Xerxes Rånby
I did take a look at the libs
I have now re-enabled the *mandatory* GdxNativesLoader.load()
and keep on using lwjgl openal for sound since it is the libgdx primary audio backend.
With this change in place all libgdx tests run using JogAMP JOGL 2!

I have also prepared a pull request for you:
https://github.com/gouessej/libgdx/pull/1

This is my first working libgdx JOGL 2 test run
The first working libgdx JOGL 2 test run


I noticed on jabber that you are working on an update to use the JogAmp JOAL,
Nice it will surely make openal work on more platforms.

Kudos, and have a great day!
Xerxes
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
Xerxes Rånby wrote
I noticed on jabber that you are working on an update to use the JogAmp JOAL,
Nice it will surely make openal work on more platforms.
It's ready, please use it :) Can you look at my source code? I'm not a JOAL expert. I've just accepted your pull request.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

Xerxes Rånby
gouessej wrote
Xerxes Rånby wrote
I noticed on jabber that you are working on an update to use the JogAmp JOAL,
Nice it will surely make openal work on more platforms.
It's ready, please use it :) Can you look at my source code? I'm not a JOAL expert. I've just accepted your pull request.
I took a look, from what i can see it looks OK and it work!
I fixed a typo in the gdx-joal eclipse .project file and then switched to use of gdx-joal for the gdx-backend-jogl backend.

New pull request, with an included mini-tutorial on how to update existing libgdx projects to use the gdx-backend-jogl with gdx-joal!
https://github.com/gouessej/libgdx/pull/2

gdx-invaders running using JogAmp JOGL 2.0 rc11 and JOAL!

Kudos again!
Xerxes
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
Thank you so much, I will implement the missing features soon.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
Xerxes, Mario needs some help to cross compile some libraries to ARM from Ubuntu 64 bits:
http://badlogicgames.com/forum/viewtopic.php?f=17&t=6989&p=32320#p32304

Do you think it is doable?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

Sven Gothel
Administrator
On 01/05/2013 05:24 PM, gouessej [via jogamp] wrote:
> Xerxes, Mario needs some help to cross compile some libraries to ARM from
> Ubuntu 64 bits:
> http://badlogicgames.com/forum/viewtopic.php?f=17&t=6989&p=32320#p32304
>

Great stuff! KUDOS to Xerxes & you!

> Do you think it is possible?

Anything is possible :)

Cross-compiling from GNU/Linux x64 -> [GNU/Linux ARM, Android/Linux ARM]
is quite easy, depending on their build system ofc.

We have all those cross-compilation setup done via our GlueGen ant files,
which we include in other projects (JOGL, JOAL, ..).

GlueGen uses our patched cpptask and our build scripts
within <project>/make/make*arm*.sh simple set properties to define
the target platform, as well as adding the toolchain (gcc, ..) of the cross-compiler
to the PATH env.vars.

~Sven




signature.asc (909 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

noxo
Couldn't resist myself playing few hours on LibGDX and Raspberry PI today..

Here's some findings:
==============
LIBGDX native libraries compiled on Raspberry PI fine by slightly modifying existing Linux ANT build scripts.
What I did was just remove -m32 and -msse flags. Not sure if additional stuff is needed for cross compile
environment, and if additional options are needed to opmitize for ARM/RPI.

The compiled library is also in my fork of libGDX, if anyone want to try :)
https://github.com/noxo/libgdx/blob/master/prebuild-raspberry-pi/gdx-natives-arm.jar

I also tried quick and dirty of getting rid of GLCanvas sitting in JPanel, and moving everything under GLWindow to
get UI running on Raspberry PI... The UI is now showing up on RPI (with and without X), but I wasn't able
to receive mouse events into Window.  Game works perfectly on PC under GLWindow. I haven't played a
lot with JOGL, so might be some noob stuff that I'm missing out.

Everything is checked in Github, so free feel to try & comment  



Reply | Threaded
Open this post in threaded view
|

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

Xerxes Rånby
noxo wrote
Couldn't resist myself playing few hours on LibGDX and Raspberry PI today..

Here's some findings:
==============
LIBGDX native libraries compiled on Raspberry PI fine by slightly modifying existing Linux ANT build scripts.
What I did was just remove -m32 and -msse flags. Not sure if additional stuff is needed for cross compile
environment, and if additional options are needed to opmitize for ARM/RPI.

The compiled library is also in my fork of libGDX, if anyone want to try :)
https://github.com/noxo/libgdx/blob/master/prebuild-raspberry-pi/gdx-natives-arm.jar

I also tried quick and dirty of getting rid of GLCanvas sitting in JPanel, and moving everything under GLWindow to
get UI running on Raspberry PI... The UI is now showing up on RPI (with and without X), but I wasn't able
to receive mouse events into Window.  Game works perfectly on PC under GLWindow. I haven't played a
lot with JOGL, so might be some noob stuff that I'm missing out.

Everything is checked in Github, so free feel to try & comment
WOW! and welcome! :)

It is odd that you do not receive mouse events because I think you should both from within and outside X11:
The Raspberry Pi OpenGL ES paints hardware accelerated directly on top of the frame-buffer from the console. Therefore we do not have the luxury of having an existing high level windowing toolkit that can feed us keyboard and mouse events on the Raspberry Pi.
For Raspberry Pi mouse input we use a "LinuxMouseTracker" that reads directly from the Linux kernels /dev/input/mice device file:
The LinuxMouseTracker code used by the Raspberry Pi NEWT is implemented here:
https://github.com/sgothel/jogl/blob/master/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java

* When I run the JogAmp JOGL tests like the Gears demo i notice that this mouse tracker only kicks in and activate after i have pressed the middle mouse button.
Quick instructions on how to run the JOGL Gears demo using NEWT on the Raspberry Pi to try the mouse tracker: https://gist.github.com/55de4fd65bfadae26203

Keyboard and joystick input on the RaspberryPi is still a TODO.
New code has to be added that supports all HID input devices directly from the console.

It looks like working on input libs is the king thing to do for January 2013.
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
In reply to this post by noxo
Thanks noxo, but there are still some references to AWT in your code (Robot, KeyEvent, ...).
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
In reply to this post by Xerxes Rånby
The NEWT port is available, it works but I will have to improve a few things.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

noxo
Great, will try it out :) I definitely have a lot unfinished stuff in my fork.. were just trying out the thing :)
Reply | Threaded
Open this post in threaded view
|

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

noxo
Merged jogl-backend changes from your repo.. still those mouse capturing issues on Raspberry PI.. but setting
up NEWT is pretty close what I had, so I sort of were expecting same to occur.

Have to check actually my JOGL version, maybe there has been some work done on that lately.

Would be nice to start work on that console based input listener...
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
noxo wrote
Merged jogl-backend changes from your repo.. still those mouse capturing issues on Raspberry PI.. but setting
up NEWT is pretty close what I had, so I sort of were expecting same to occur.

Have to check actually my JOGL version, maybe there has been some work done on that lately.

Would be nice to start work on that console based input listener...
HID support? For the moment, Xerxes or me will have to cleanly detect the Raspberry Pi and force OpenGL ES 2 in this case. I have committed some other features but I'm too tired to test them now. I need a break. It would be really great to get some input on Raspberry Pi.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

noxo
gouessej wrote
HID support? For the moment, Xerxes or me will have to cleanly detect the Raspberry Pi and force OpenGL ES 2 in this case. I have committed some other features but I'm too tired to test them now. I need a break. It would be really great to get some input on Raspberry Pi.
:) Yep HID support for console.. but that's another story.

I tried forcing of OpenGL ES 2 on RPI .. but that didn't help on issues I'm having on this platform. I'll try with your latest changes in evening.

Anyway, really nice work from you to have this JOGL backend for libGDX, there are not that many high level Gaming
API's available on Java with OpenGL ES support.
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
noxo wrote
I tried forcing of OpenGL ES 2 on RPI .. but that didn't help on issues I'm having on this platform. I'll try with your latest changes in evening.
I hope it works now.

noxo wrote
Anyway, really nice work from you to have this JOGL backend for libGDX, there are not that many high level Gaming
API's available on Java with OpenGL ES support.
JMonkeyEngine 3 supports OpenGL-ES too, maybe a few things can cause some troubles.
Julien Gouesse | Personal blog | Website
1234 ... 13