Jump to content
  • Advertisement
Sign in to follow this  
freem

OpenGL Simple GUI library to use with openGL

This topic is 1171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello.

I hope this is the right place to ask this.
I am writing a small first person RPG, based on a 2D tile map (so, no complex collisions is needed but 3D rendering and decent GUI are), targeting desktop systems (with these good old keyboards and mouses!).
I have what I would call intermediate C++ skills, but this project is the first one I work on where I need 3D rendering. I have chosen OpenGL because
I work on Debian, and that it have an implementation for both Windows and major Posix-compliant systems.

I am a pure newbie when it comes to 3D stuff, and I never was good in maths. I can learn those, though, and intend to, when I'll have reached decent rendering and logic engines in term of number of features. Eye-candy-ness can wait.
I already have a very rough 3D renderer, but now I need to do basic GUIs, for things like configuration or showing inventory.

What I need is a really basic GUI library, able to accept text input and display icons, in movable and re-sizable windows (movable and re-sizable by the user, in-game, not through an external tool).
Ideally, it would *not* try to support exotic stuff like XML/HTML/CSS/JS (I already have to learn glsl, you know...).
Simply, placing/sizing windows with something like 'window.move(xpos, ypos);window.resize(width,height);' would be far enough, and if more is wished in future, I would already have at least something to play with.

The library I am currently using to "connect" the OS display/input is GLFW, but if the libraries you know does not support it, but instead SDL or SFML, and are not too dependent with those, I could do the port of the lib.
Writing such a library should not be too difficult (ok, I know that text is pretty horrible when it comes to i18n, but as long as I can display something I'm fine)... if I was not that bad at understanding OpenGL shaders.

But, if you do not know about such a library, if you can point me a link toward a minimal code which just print a sprite over a 3D scene, I would be pretty grateful too.

I have found AntTweakBar, which does almost what I need:
_ damn simple public API,
_ text input,
_ windows that the user can manipulate easily...
but unfortunately it does not support icons printing, and the code quality is... I'll just say, poor. I tried to add the feature myself but I went lost in the 20KLoC of the 2 main source files, between zombie code, god objects, global variables, C allocation of C++ classes and more...

Any help will be really welcome on this.

Share this post


Link to post
Share on other sites
Advertisement

I have nothing to contribute except that I've come to think that "simple" and "GUI library that works with OpenGL" are two things that simply don't happen together.

Share this post


Link to post
Share on other sites
What's this for? If it's for debug and tools, you might be able to use https://github.com/ocornut/imgui.

If you're trying to get something for your in-game GUI, you probably aren't going to find anything "simple." http://cegui.org.uk or http://mygui.info or http://librocket.com are on the simple* side for GUIs, and should cover your needs.

* Insofar as GUIs are simple.

Share this post


Link to post
Share on other sites
What's this for? If it's for debug and tools, you might be able to use https://github.com/ocornut/imgui.
No, it is for the in-game GUI.

If you're trying to get something for your in-game GUI, you probably aren't going to find anything "simple." http://cegui.org.uk or http://mygui.info or http://librocket.com are on the simple* side for GUIs, and should cover your needs.
Well, by simple, I meant easy of use in the software, not easy to make a beautiful thing. Before having beautiful stuff, I want features implemented :) I'll take a look at those two.

TurboBadger looks nice https://github.com/fruxo/turbobadger
I gave it a very quick shot, but were unable to compile it (a CMakeLists.txt file is missing, I'll report it to the author later, I would like to try to fix it myself before. Thanks you all for the replies, guys.

Share this post


Link to post
Share on other sites

Just a word of warning that mixing software drawing via the OS windowing system with hardware drawing via OpenGL is almost certainly not what you want.  It may sound attractive, but it's highly likely to cause you a host of interoperability, compatibility and performance problems.

Share this post


Link to post
Share on other sites
mhagain: I do not do this. I only use opengl stuff to draw. Plus, I doubt it would be possible with the API GLFW3 exposes anyway.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!