Hello Guest

GLW and multi canvas with LWJGL 3

  • 5 Replies
  • 10935 Views
GLW and multi canvas with LWJGL 3
« on: November 25, 2014, 17:43:37 »
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.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: GLW and multi canvas with LWJGL 3
« Reply #1 on: November 25, 2014, 18:07:24 »
No, it isn't supported. In fact, LWJGL 3 has no AWT/Swing integration.

Re: GLW and multi canvas with LWJGL 3
« Reply #2 on: November 25, 2014, 21:59:02 »
Quote
I 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.



*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: GLW and multi canvas with LWJGL 3
« Reply #3 on: November 25, 2014, 23:15:09 »
It also looks like GLFW will have support for tool windows in the 3.2 release.

Re: GLW and multi canvas with LWJGL 3
« Reply #4 on: November 27, 2014, 13:42:32 »
Forgive my ignorance, but what do they mean with "tool windows"?

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: GLW and multi canvas with LWJGL 3
« Reply #5 on: November 27, 2014, 15:18:40 »
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.