Login  Register

Re: JME3 Unified Renderer - Canvas Use Issue

Posted by Xerxes Rånby on Feb 07, 2013; 2:11am
URL: https://forum.jogamp.org/JME3-Unified-Renderer-Canvas-Use-Issue-tp4028152p4028168.html

Dardzull wrote
How do I get a canvas of some sort (JoglNewtCanvas, JoglCanvas, etc.) out of JME3 so that I can put it into a JFrame?  The following code lets me get a canvas out that does not render.
...
public class appTest extends SimpleApplication
{
...
                    NewtCanvasAWT canvas = ctx.getCanvas();
                    canvas.setVisible(true);
                   
                   JFrame jFrame = new JFrame("Screen");
...

Any help is appreciated.
I assume you run into rendering/exception issues on the raspberry pi:
AWT-OpenGL and hence Swing interoperability code is currently unsupported on the raspberry pi.
https://jogamp.org/bugzilla/show_bug.cgi?id=626

The current  way to use JogAmp JOGL on the Raspberry Pi is to use the NEWT GLWindow. We use NEWT to solve windowing situation because AWT is not available on all platforms.

To initialize a NEWT GLWindow use:
GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
GLWindow glWindow = GLWindow.create(caps);
glWindow.setTitle("Raw GL2ES2 Demo");
glWindow.setSize(width,height);
glWindow.setUndecorated(false);
glWindow.setPointerVisible(true);
glWindow.setVisible(true);
Demo code from, found in jogl-demos: http://labb.zafena.se/?p=547

On the RaspberryPi AWT is running but on an unaccelerated surface hence we gets refused to connect OpenGL rendering output by the libEGL on the Pi because libEGL expects a Broadcom driver specific "dispmanx" native surface, something that the AWT surface is-not.

Heads-up: BroadCom are considering switching their driver from the dispmanx API to OpenWF http://www.khronos.org/openwf/
this *rumor* got  mentioned on the http://elinux.org/RPi_VideoCore_APIs RaspberryPi wiki and originate from some loose mumblings by one of the raspberry pi forum administrators.