SWT integration: NewtCanvasSWT or swt.GLCanvas?

classic Classic list List threaded Threaded
10 messages Options
aqd
Reply | Threaded
Open this post in threaded view
|

SWT integration: NewtCanvasSWT or swt.GLCanvas?

aqd
We're currently developing World Wind based application on Eclipse RCP. I have written new WorldWindowGLCanvas implementations for both *Canvas, and both are running fine though there are occasional black blinkings. Which one should I choose for better reliability/speed and future development?

Here are their full names:

com.jogamp.newt.swt.NewtCanvasSWT
com.jogamp.opengl.swt.GLCanvas



PS: there are event converters to change all NEWT/SWT events to the AWT events which World Wind recognizes. I only need SWT/NEWT to put the canvas in RCP view, not that I actually use any SWT or NEWT functionality.
Reply | Threaded
Open this post in threaded view
|

Re: SWT integration: NewtCanvasSWT or swt.GLCanvas?

gouessej
Administrator
Hi

Please share your source code so that we can do the same for NewtCanvasAWT:
http://forum.jogamp.org/transfer-images-from-TextureData-to-a-Texture-off-of-the-EDT-in-JOGL-tp4032678p4032682.html

com.jogamp.opengl.swt.GLCanvas is heavyweight, a bit more reliable but it has a few limitations that NewtCanvasSWT doesn't have and it might be a bit slower and less flexible than NewtCanvasSWT, Petros would probably be able to give you more accurate answers.

Why not keeping both? I can help you if something goes wrong, don't worry, you're not alone.
Julien Gouesse | Personal blog | Website
aqd
Reply | Threaded
Open this post in threaded view
|

Re: SWT integration: NewtCanvasSWT or swt.GLCanvas?

aqd
Where could I share the code? And why would swt.GLCanvas be slower? I don't find any lock or AWT-related stuff in swt.GLCanvas.

Reply | Threaded
Open this post in threaded view
|

Re: SWT integration: NewtCanvasSWT or swt.GLCanvas?

gouessej
Administrator
Why not using Github, Sourceforge or Bitbucket? NewtCanvasSWT doesn't extend SWT Canvas, it's a bit more lightweight, it doesn't have to let you use software rendering, that's why it can be a bit faster. When you use NEWT, you can indicate to JOGL that you wish to make the context current always on the same thread which can give a small boost.
Julien Gouesse | Personal blog | Website
aqd
Reply | Threaded
Open this post in threaded view
|

Re: SWT integration: NewtCanvasSWT or swt.GLCanvas?

aqd
This post was updated on .
Okay I made it here:

swt.GLCanvas version: https://gist.github.com/AqD/c37762dd68ba14d907f7  (updated with a sample RCP view)
NewtCanvasSWT version: https://gist.github.com/AqD/b283b67e0624381095e2


* The NEWT-SWT version is based on ga-worldwind-suite's NEWT-AWT canvas.
Reply | Threaded
Open this post in threaded view
|

Re: SWT integration: NewtCanvasSWT or swt.GLCanvas?

Wade Walker
Administrator
In reply to this post by aqd
aqd wrote
I have written new WorldWindowGLCanvas implementations for both *Canvas, and both are running fine though there are occasional black blinkings.
Usually in RCP when I'd see my canvas blink, it would end up being a window background redraw for some underlying window that I had forgotten to turn off :) Either that or some window would overlay my GL canvas by accident and cause a redraw event on it which I wouldn't handle correctly.
aqd
Reply | Threaded
Open this post in threaded view
|

Re: SWT integration: NewtCanvasSWT or swt.GLCanvas?

aqd
Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: SWT integration: NewtCanvasSWT or swt.GLCanvas?

gouessej
Administrator
In reply to this post by aqd
Thank you. Maybe I'm a bit naive. Why can't you get rid of AWT? Nice job anyway.
Julien Gouesse | Personal blog | Website
aqd
Reply | Threaded
Open this post in threaded view
|

Re: SWT integration: NewtCanvasSWT or swt.GLCanvas?

aqd
Because World Wind uses AWT input events for picking etc. But AWT Toolkit is only initialized, not really used afterwards. The animator and SWT UI run in independent threads and have nothing to do with AWT internally.
Reply | Threaded
Open this post in threaded view
|

Re: SWT integration: NewtCanvasSWT or swt.GLCanvas?

gouessej
Administrator
I assume it would be difficult to rewrite this part of WWJ so that the picking could be implemented without AWT. I'll have to contact WWJ's maintainers.
Julien Gouesse | Personal blog | Website