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:

// 3d code
// 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.

  • \$\begingroup\$ possible duplicate of Making a HUD/GUI with OpenGL (LWJGL) \$\endgroup\$ – MichaelHouse May 18 '12 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 '12 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\$ – MichaelHouse May 18 '12 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 '12 at 16:42

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.