0
\$\begingroup\$

I'm wondering how one could implement an HUD in LWJGL. I've seen tutorials on this, but they don't seem to work. I know the basic structure goes like this:

init3d();
// 3d code
init2d();
// HUD

To which, of course, init3d and init2d are the GL Initialization codes. And also, how would you draw the images for the HUD (or should I ask that in a separate question)?

If this is too vague, let me know and I'll update the question.

\$\endgroup\$
4
  • \$\begingroup\$ possible duplicate of Making a HUD/GUI with OpenGL (LWJGL) \$\endgroup\$
    – House
    May 18, 2012 at 16:11
  • \$\begingroup\$ I know it is, but that one seemed to use a different engine. Sorry, I'm a newbie at OpenGL, so I don't know how to convert it \$\endgroup\$
    – MiJyn
    May 18, 2012 at 16:24
  • 2
    \$\begingroup\$ Is your game 3D or 2D? You have tags for 2D and Slick, but then you talk about init3D(). There's no engines involved and you asked about LWJGL, same as the other question. There's no converting to do. \$\endgroup\$
    – House
    May 18, 2012 at 16:37
  • \$\begingroup\$ It's 3D, but the question is about how to put a 2D image to 3D. And what about SDL_GL_SwapBuffers? How would I do that? \$\endgroup\$
    – MiJyn
    May 18, 2012 at 16:42

1 Answer 1

3
\$\begingroup\$

The easiest way to handle this is to use a library that's specifically designed for GUIs. Check out Nifty GUI. It works with OpenGL + LWJGL + Slick. Follow the getting started guide and read the tutorials. Finally, check out the source code for the examples. This will get you on your way the quickest, without needing to worry so much about the lower level graphics involved.

\$\endgroup\$
4
  • \$\begingroup\$ ok thanks! I knew there must have been a simpler way lol \$\endgroup\$
    – MiJyn
    May 18, 2012 at 17:34
  • \$\begingroup\$ Sure thing, if this answers your question you can accept the answer to show that. \$\endgroup\$
    – House
    May 18, 2012 at 17:39
  • \$\begingroup\$ once I figure out how to work it :D \$\endgroup\$
    – MiJyn
    May 18, 2012 at 17:46
  • \$\begingroup\$ That's fair enough. \$\endgroup\$
    – House
    May 18, 2012 at 17:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .