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

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

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

piotrekk
This post was updated on .
Hello,

I have a problem with display for Rpi now, as i read there is no way to render a opengl es applications from Rpi via VNC or ssh, i check this with tgihtvnc, turbovnc and ssh, i found this informations on the web:

<a href="http://">http://raspberrypi.stackexchange.com/questions/4491/remote-raspberry-pi-3d-graphic-using-virtualgl-turbovnc

<a href="http://">http://www.reddit.com/r/raspberry_pi/comments/2ezc57/opengl_over_vncssh_is_it_possible_to_run_anything/

<a href="http://">http://raspberrypi.stackexchange.com/questions/28513/egl-and-opengl-es-forwarding-via-ssh

So at now i can not see how running my program on RPi.

Is this any way to see opengl app from Rpi via vnc like app on mac?

ps. i found only this solution:

https://github.com/hanzelpeter/dispmanx_vnc

and a result:



Greetings,

Peter
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
piotrekk wrote
ps. i found only this solution:

https://github.com/hanzelpeter/dispmanx_vnc
It doesn't work with X11, does it?
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 .
gouessej wrote
piotrekk wrote
ps. i found only this solution:

https://github.com/hanzelpeter/dispmanx_vnc
It doesn't work with X11, does it?
Thank you piotrekk for showing this vnc solution, i was not aware that this dispmanx implementation existed.

Everything seen on the raspberry pi using the closed source broadcom drivers is using dispmanx surfaces including the X11 framebuffer.

You can see X11 using this dispmanx_vnc implementation.
mouse movements did work if i enabled evdev and started the server with -r relative option

sudo modprobe evdev
sudo ./dispman_vncserver -r

dispmanx_vnc works ok to remote control a raspberry pi using the text console, including running jogamp jogl demos on the pi from the text console. Performance is quite slow by design when updating complex graphics, the implementation has to take a snapshot and send it over using the vnc protocol.

The implementation injects basic keyboard and mouse events into the linux /dev/uinput to update the /dev/input/event* files, this makes it possible for keyboard and mouse events to be parsed by X11 and our jogamp linux event tracker.

There is noticable delays in the updates of mouse movements. that may be fixed by working on the sourcecode.
https://github.com/hanzelpeter/dispmanx_vnc/blob/master/main.c#L365-L468


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 .
In reply to this post by Xerxes Rånby
Xerxes Rånby wrote
We have to look into why the dispmanx surfaces are not aligned with the top left corner of the screen, it looks like the OpenGL ES window has an offset of +100 pixels in X to the right and -100 pixels in Y down.
The mousepointer dispmanx overlay looks to have a similar offset in the other direction -100 pixels in X to the left and +100 pixels in Y upward.
The root cause is understood

WindowImpl has a default position of 64,64
This caused a misaligned mousepointer and window
seen on the Raspberry Pi that is still unfixed.

We have analysed the bug and proposed ways to properly resolve it in the jogamp irc channel
http://jogamp.org/log/irc/jogamp_20150716145123.html#l209

By overriding the default position to 0,0
we workaround and align them.
https://github.com/xranby/jogl/commit/e6413257a6aaec581e8e33f81c16cc66d477501f

This workaround will be enough to get the mousepointer aligned with libgdx games running in a large window/fullscreen.

We have earmarked the issue:
https://jogamp.org/bugzilla/show_bug.cgi?id=1176
Reply | Threaded
Open this post in threaded view
|

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

Sven Gothel
Administrator
On 07/17/2015 02:26 AM, Xerxes Rånby [via jogamp] wrote:

> We have analysed the bug and proposed ways to properly resolve it in the
> jogamp irc channel
> http://jogamp.org/log/irc/jogamp_20150716145123.html#l209
>
> By overriding the default possition to 0,0
> we workaround and align them.
> https://github.com/xranby/jogl/commit/ee5171af3978702e442db4e7592c41ea8e5f7efa
>
> This workaround will be enough to get the mousepointer aligned with libgdx
> games running in fullscreen/a large window.
Please test w/ Bug 1176 fix as pushed to JOGL:
  <https://jogamp.org/bugzilla/show_bug.cgi?id=1176#c1>

~Sven



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

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

Xerxes Rånby
Sven Gothel wrote
On 07/17/2015 02:26 AM, Xerxes Rånby [via jogamp] wrote:
> We have analysed the bug and proposed ways to properly resolve it in the
> jogamp irc channel
> http://jogamp.org/log/irc/jogamp_20150716145123.html#l209
>
> By overriding the default possition to 0,0
> we workaround and align them.
> https://github.com/xranby/jogl/commit/ee5171af3978702e442db4e7592c41ea8e5f7efa
>
> This workaround will be enough to get the mousepointer aligned with libgdx
> games running in fullscreen/a large window.

Please test w/ Bug 1176 fix as pushed to JOGL:
  <https://jogamp.org/bugzilla/show_bug.cgi?id=1176#c1>

~Sven

signature.asc (828 bytes) <http://forum.jogamp.org/attachment/4034919/0/signature.asc>
The fixes for 1176 work very well! Thank you:

here is the libgdx paxbritannica running with full hardware acceleration and an accurate mousepointer on a raspberry pi 2 with an attached "kippah" 5" TFT
Reply | Threaded
Open this post in threaded view
|

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

Mr.Marbles
gdx-backend-jogamp doesn't seem to be compiling.

output from maven:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \dev\workspace\libgdx-jogamp\libgdx\backends\gdx-backend-jogamp\src\com\
badlogic\gdx\backends\jogamp\JoglGraphicsBase.java:[334,21] error: cannot find symbol

Does GraphicsType still exist?
Reply | Threaded
Open this post in threaded view
|

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

Mr.Marbles
Ah I see the problem. I was using the com.badlogic.gdx.Graphics from the libGDX repository which doesn't define the GraphicsType.JoglGL constant. To get this to work I need to use the forked libGDX. Will this always be the case or is this just temporary until JOGL has been integrated into libGDX?
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
Xerxes thinks that it's just temporary, I'm more pessimistic.
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 Mr.Marbles
I've just fixed the Maven build too with Xerxes' help. It's how it works with JogAmp :) huge reactivity :p
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

Headmade
In reply to this post by Xerxes Rånby
Hi,

I tried to get my LibGdx game working on Raspberry Pi 2 (running Raspbian), but I keep getting the error below.

I did the following steps:
- clone https://github.com/gouessej/libgdx/tree/b69245a72fbb1af77c801ba9d4bab70d3da77b90 (I know it's not the latest but this is the version my game is using)
- mvn install
- made my game use this libgdx version, changes equivalent to https://github.com/xranby/libgdx-demo-pax-britannica/commit/4c2bafc104c2d7104dad5299d196423d932cf7c5?diff=split with the exception of using JoglNewtApplication
- Exported the game as a runnable jar Art_Treachery-Headmade_Games-0.5.jar
- I inserted libgdxarm.so and libgdxarmgnueabihf.so into my gdx-platform-1.6.6-SNAPSHOT-natives-desktop.jar However I was unable to build the so files on my raspberry pi so I used the files included in the Pax Brianica demo http://labb.zafena.se/jogamp/vc4/libgdx-demo-pax-britannica-1.6.3-armhf.jar

If there is an easier way or if I did anything wrong please let me know.

The source code can be seen here:
https://github.com/headmadegames/ArtTag/blob/raspberry/desktop/src/headmade/arttag/desktop/ArtTagLauncher.java

The error when I run it on my raspberry is:

RunnableTask.run(): A caught exception occured on thread
main-Display-.x11_:0.0-2-EDT-1: RunnableTask[executed false, tTotal 1
ms, tExec 0 ms, tQueue 1 ms, attachment null, throwable
java.lang.RuntimeException: java.lang.RuntimeException: Waited 5000ms
for: <e8b6be, 357fb2>[count 1, qsz 0, owner <main-AWTAnimator#00>] -
<main-Display-.bcm.vc.iv_nil-1-EDT-1>]
java.lang.RuntimeException: java.lang.RuntimeException: Waited 5000ms
for: <e8b6be, 357fb2>[count 1, qsz 0, owner <main-AWTAnimator#00>] -
<main-Display-.bcm.vc.iv_nil-1-EDT-1>
        at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:249)
        at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:163)
        at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:427)
        at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2585)
        at jogamp.newt.WindowImpl.setPosition(WindowImpl.java:2711)
        at jogamp.newt.driver.x11.X11UnderlayTracker.windowMoved(X11UnderlayTracker.java:140)
        at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4174)
        at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4105)
        at jogamp.newt.WindowImpl.positionChanged(WindowImpl.java:4329)
        at jogamp.newt.WindowImpl.sizePosMaxInsetsChanged(WindowImpl.java:4493)
        at jogamp.newt.driver.x11.DisplayDriver.DispatchMessages0(Native Method)
        at jogamp.newt.driver.x11.DisplayDriver.dispatchMessagesNative(DisplayDriver.java:112)
        at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4237)
        at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4231)
        at jogamp.newt.WindowImpl.createNative(WindowImpl.java:673)
        at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1130)
        at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1185)
        at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:133)
        at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:372)
Caused by: java.lang.RuntimeException: Waited 5000ms for: <e8b6be,
357fb2>[count 1, qsz 0, owner <main-AWTAnimator#00>] -
<main-Display-.bcm.vc.iv_nil-1-EDT-1>
        at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
        at jogamp.newt.WindowImpl$SetPositionAction.run(WindowImpl.java:2684)
        at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:150)
        ... 1 more
DefaultEDT.run(): Caught exception occured on thread
main-Display-.x11_:0.0-2-EDT-1: RunnableTask[executed true, tTotal
7221 ms, tExec 7220 ms, tQueue 1 ms, attachment null, throwable
java.lang.RuntimeException: java.lang.RuntimeException: Waited 5000ms
for: <e8b6be, 357fb2>[count 1, qsz 0, owner <main-AWTAnimator#00>] -
<main-Display-.bcm.vc.iv_nil-1-EDT-1>]
java.lang.RuntimeException: java.lang.RuntimeException: Waited 5000ms
for: <e8b6be, 357fb2>[count 1, qsz 0, owner <main-AWTAnimator#00>] -
<main-Display-.bcm.vc.iv_nil-1-EDT-1>
        at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:249)
        at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:163)
        at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:427)
        at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2585)
        at jogamp.newt.WindowImpl.setPosition(WindowImpl.java:2711)
        at jogamp.newt.driver.x11.X11UnderlayTracker.windowMoved(X11UnderlayTracker.java:140)
        at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4174)
        at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4105)
        at jogamp.newt.WindowImpl.positionChanged(WindowImpl.java:4329)
        at jogamp.newt.WindowImpl.sizePosMaxInsetsChanged(WindowImpl.java:4493)
        at jogamp.newt.driver.x11.DisplayDriver.DispatchMessages0(Native Method)
        at jogamp.newt.driver.x11.DisplayDriver.dispatchMessagesNative(DisplayDriver.java:112)
        at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4237)
        at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4231)
        at jogamp.newt.WindowImpl.createNative(WindowImpl.java:673)
        at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1130)
        at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1185)
        at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:133)
        at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:372)
Caused by: java.lang.RuntimeException: Waited 5000ms for: <e8b6be,
357fb2>[count 1, qsz 0, owner <main-AWTAnimator#00>] -
<main-Display-.bcm.vc.iv_nil-1-EDT-1>
        at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
        at jogamp.newt.WindowImpl$SetPositionAction.run(WindowImpl.java:2684)
        at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:150)
        ... 1 more
Reply | Threaded
Open this post in threaded view
|

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

Xerxes Rånby
In your main method use JoglNewtApplicationConfiguration and JoglNewtApplication like this:
https://github.com/xranby/libgdx-demo-pax-britannica/commit/67954bd09de5264b081009692a0e5720507cbcf4

NEWT work on the Raspberry Pi, NEWT uses an Broadcom Dispman X surface.

The reason AWT fail is that the OpenGL ES driver cant render to an AWT X11 window. It is a limitation in the Broadcom OpenGL ES driver that it cant operate on X11 windows.

http://jogamp.org/jogl/doc/NEWT-Overview.html
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 Headmade
Hi

Headmade, please follow Xerxes' advice and use the very latest version. We only maintain the latest version. I'm trying to build LibGDX but this error gets in my way:
Error:failed to find target android-20

Remind me to NEVER use Android SDK for my own projects. I'm fed up.
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 Headmade
I'm currently fixing one compile error and switching to JOGL 2.3.2.
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 Headmade
LibGDX is up-to-date and working on my repository now.

I insist on the use of the latest version because if something goes wrong, the very first thing that we're going to ask you is to use it as we have a few resources, we don't maintain several branches or versions.

I have no specific tool to make things easier yet, sorry. However, I hope you know the limitations of what you call a "runnable" JAR:
http://gouessej.wordpress.com/2014/11/22/ardor3d-est-mort-vive-jogamps-ardor3d-continuation-ardor3d-is-dead-long-life-to-jogamps-ardor3d-continuation/#executablejar
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

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

Headmade
Thank you for the help.

I'm now using the the latest version (1.7.1-SNAPSHOT).
One thing I noticed is that in the main pom.xml is missing the module
<module>backends/gdx-backend-jogamp</module>

I added it, installed the version and made my game use it. I made sure I use JoglNewtApplicationConfiguration and JoglNewtApplication as can be seen here: https://github.com/headmadegames/ArtTag/blob/raspberry/desktop/src/headmade/arttag/desktop/ArtTagLauncher.java

It's still not working on my Raspberry Pi but I get a different Error now:

Exception in thread "main-AWTAnimator#00"
com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException:
com.jogamp.opengl.GLException: Caught NullPointerException: null on
thread main-AWTAnimator#00
        at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:92)
        at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
        at com.jogamp.opengl.util.Animator$MainLoop.run(Animator.java:204)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.jogamp.opengl.GLException: Caught NullPointerException:
null on thread main-AWTAnimator#00
        at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
        at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327)
        at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
        at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
        at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
        ... 3 more
Caused by: java.lang.NullPointerException
        at com.badlogic.gdx.backends.jogamp.JoglGraphicsBase.display(JoglGraphicsBase.java:165)
        at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
        at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
        at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
        at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
        ... 6 more


Thank you for reminding me of the limitations of an executable jar.
Currently I do not care about these limitations as I just need to get it to run on a single system by the 28th of October. The plan is to exhibit the game in an arcade machine in the British Library. I can provide a proper release later.
Reply | Threaded
Open this post in threaded view
|

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

gouessej
Administrator
It's fixed:
https://github.com/gouessej/libgdx/commit/9bcc8fc302a3d607a4cb5a691b60047a51f05d5e

The backend is often removed when merging, it's annoying. However, the Gradle build works and this is the one I used to check everything works.

I'm investigating...
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 Headmade
I've just fixed the null pointer dereference:
https://github.com/gouessej/libgdx/commit/0d206f2fb3599c426f784b41ae9469210381597a

The initialization of the audio system probably failed on your machine. Please post the logs.
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 Headmade
Headmade wrote
Thank you for reminding me of the limitations of an executable jar.
Currently I do not care about these limitations as I just need to get it to run on a single system by the 28th of October. The plan is to exhibit the game in an arcade machine in the British Library. I can provide a proper release later.
You're welcome. I understand your constraints. I'll do my best to help you. What is the license of your source code? It's important to mention it as if there is no license, it's under the most restrictive one, it's purely copyrighted, see the Bern convention.

Maybe Xerxes can help you to have the sound work on your 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

Headmade
In reply to this post by gouessej
Thank you so much, it's working now.

You were correct, my OpenAL failed to initialize and I somehow missed it.
"AL lib: (EE) ALCplaybackOSS_open: Could not open /dev/dsp: No such file or directory"
Xerxes had already posted a fix for this elsewhere 
A) load the linux kernel driver
sudo modprobe snd_pcm_oss
gouessej wrote
What is the license of your source code?
There is no license at the moment. I am rubbish at the legalities of licensing. Since I'm using some CC-BY-3.0 Music so I'm not sure if I can just slap a license at the whole thing or how to go about excluding the music. I wouldn't mind adding a license so people could use the code or art but I didn't want to get myself into trouble.  
1 ... 910111213