Slashdot Mirror


Making a GUI for OpenGL Games?

stuck in a bind asks: "I am currently coding a civilization-type game (in C) but on a galactic scale. OpenGL is used to draw everything so far. However I have been unable to find a decent, nice GUI, practically all of them are coded in C++. The only other options I can think of is coding my own toolkit (too much work, and I would hate to reinvent the wheel here), using SDL to draw 2D bitmaps on top of my OpenGL window. The last option would be to switch to GTK and use the GTK GL widget. What would the educated gamer/programmers of Slashdot recommend?"

3 of 96 comments (clear)

  1. Why not use C++ by bsmoor01 · · Score: 5, Interesting

    OO is pretty much ideal for GUI programming. So why not code up your GUI in C++ and leave the rest of your game in C?

    Is there some reason you're opposed to C++?

  2. Re:what you kind of want is GLUI.... by Xetrov · · Score: 2, Interesting

    From the first line on the GLUI page: "GLUI is a GLUT-based C++..." :)

    I didn't like any of the openGL GUI packages out there so I made my own. It really isn't difficult to draw your own textured QUADs etc over the top of the scene. You can push/pop the attributes as well as the projection matrix, so you can make sure lighting etc is turned off when you draw the gui... RTFM ;)

  3. Re:SDL overlays by BrynM · · Score: 3, Interesting
    As a level designer and player - not a gaming coder, I vote for textured polygons as well for a few reasons:
    • You can avoid changing between 2D and 3D and the resolution pop/time delay for some configurations.
    • The same artists that create your entities and environments can create your GUI widgets giving the game a consistant look and feel. A good example of this can be found in Primal Software's I of the Dragon tech demo (read their news for the demo download).
    • You can probably leverage some of your existing code instead of building something from complete scratch
    • An idea... Work a menu editor into your level editor
    --
    US Democracy:The best person for the job (among These pre-selected choices...)