LWJGL Forum

Programming => OpenGL => Topic started by: Unsteady on August 18, 2013, 18:50:16

Title: Any GUI library for LWJGL with OpenGl 3.2?
Post by: Unsteady on August 18, 2013, 18:50:16
Dear community,

I'm trying to make my own game using OpenGl version 3.2, but I need some library to make a GUI. All GUI libraries mentioned in LWJGL Wiki space (TWL, Nifty Gui, Gooei and Feng Gui) use OpenGL pipeline possibilities which are incompatible with 3.2 version. Is there any solution for OpenGl 3.2+ version? If there is no any existing library, maybe someone could explain in two words a concept how to create GUI using native OpenGl 3.2 functionality?

Title: Re: Any GUI library for LWJGL with OpenGl 3.2?
Post by: Cornix on August 18, 2013, 19:34:29
What exactly do you want? Like windows, scrollbars, buttons and stuff like that?
Title: Re: Any GUI library for LWJGL with OpenGl 3.2?
Post by: Unsteady on August 18, 2013, 19:51:19
Yes. I need windows, scrollbars, buttons and other stuff, but I don't have any idea how it can be implemented using OpenGl 3.2.
Title: Re: Any GUI library for LWJGL with OpenGl 3.2?
Post by: quew8 on August 19, 2013, 10:28:19
Well for the visual stuff (which is the only things OpenGL would do) you would have to put the visual data in a vbo. Each component would have a transform associated with it which in most cases would just be its position. For most visual changes (like buttons being depressed) I think changing the texture (either by binding a different texture or manipulating tex coords in shader) would be sufficient. For others you would need to have sub-components with their own transform. (Like in a slider - you have the rail and then the actual slider as a sub-component). Then you have container components that have a list of components drawn inside. As you go down the component tree you concatenate transforms together. Maybe best to implement your own matrix stack.

I recommend trying to model the library after a GUI library you already use - Swing or AWT or JavaFX.
Title: Re: Any GUI library for LWJGL with OpenGl 3.2?
Post by: Unsteady on August 19, 2013, 18:08:27
Thank you for your answer.

Now I know a concept, next quest for me will be visual data representation in a VBO.
Title: Re: Any GUI library for LWJGL with OpenGl 3.2?
Post by: delt0r on August 20, 2013, 15:21:30
Use compatibility mode/profile whatever its called with something like TWL. There is only one computer that doesn't support opengl 3.2+ comparability and that is a fairly old version of Mac OSX with an older card as well. All device manufactures have stated that they have no intention of ever dropping support for comparability profiles. Far too much still uses it. 
Title: Re: Any GUI library for LWJGL with OpenGl 3.2?
Post by: quew8 on August 20, 2013, 16:35:10
No offence, but if we don't innovate because older, slower methods still work, then whats the point? We might as well not bother learning OpenGL 3.2+ at all. 
Title: Re: Any GUI library for LWJGL with OpenGl 3.2?
Post by: delt0r on August 20, 2013, 16:58:18
Its not slower and spending 6 months writing something you didn't need to it not the best way to spend your time.
Title: Re: Any GUI library for LWJGL with OpenGl 3.2?
Post by: Cornix on August 20, 2013, 18:07:07
You could take the time and write it so others dont need to anymore.
If its good work, it can become the next big GUI library which does use OpenGL 3.2.
It has to start somewhere; sometimes you have to make the first step yourself.
Title: Re: Any GUI library for LWJGL with OpenGl 3.2?
Post by: quew8 on August 20, 2013, 22:04:06
@Cornix +32

And I meant slower as in more computationally expensive (or whatever the right word is) , which deprecated methods certainly are, rather than slower to program and implement.