GLW and multi canvas with LWJGL 3

Started by alefzero, November 25, 2014, 17:43:37

Previous topic - Next topic

alefzero

Hi everyone,

I have been a happy user of LWJGL 2 for quite some time now and I have always used the "Display" class for setting up a canvas to then add it to swing components (es: JPanels, JFrames etc..) , then I had to switch to the AWTGLCanvas class because I needed to have more than one canvas in the same Swing component. It works ok but the decrease in performance is very noticeable. So basically I am asking you if with LWJGL 3 it is now possible to have more than one canvas in the same swing component using "displays" instead of AWTGLCanvas. I know that GLW allows the creation of multiple windows, so is there the possibility to use GLW to create multiple canvas or other GL objects to add to the same swing component?

I have read some tutorials about GLW, but it seems people are just creating multiple windows.

Thanks in advance.

spasi

No, it isn't supported. In fact, LWJGL 3 has no AWT/Swing integration.

advanced_set

QuoteI had to switch to the AWTGLCanvas class because I needed to have more than one canvas in the same Swing component

You may emulate a lot of these (multiple views, etc) with multiple windows on GLWF.  In theory it is possible to create a "floating window" interface, i.e. one or more main windows rendering stuff and smaller windows with interface components (a floating toolbar, etc.). GIMP and the several Mac applications used to work in this way.

So the main (OpenGL) windows would not have a performance penalty. Not sure if you could create these smaller windows using swing/etc and communicate with EDT through messages or if you would have to resort to GLWF + an opengl gui toolkit for these too.



spasi

It also looks like GLFW will have support for tool windows in the 3.2 release.

alefzero

Forgive my ignorance, but what do they mean with "tool windows"?

spasi

It's normal windows, but with special decorations and possibly modal functionality. Do an image search for "WS_EX_TOOLWINDOW" to see some examples on Windows.