Jump to content
  • Advertisement
phil67rpg

OpenGL graphical user interface

Recommended Posts

Advertisement

you could take the recommendations of the [khronos.org wiki] in the "OpenGL initialization : Context/Window TOolkits" section, under widget toolkits. But in your case, I feel it would be fine to build your GUI in a manner similar to your sprites because I suspect button behavior,  a text entry field and perhaps icon drag and drop would be the height of your needs.  Reinventing the wheel is rarely a good idea, but I think you may do well to get your hands dirty a little with this to perhaps appreciate existing libraries. 

If that proves too difficult, the other approach would be a [ youTube search : openGL c++ gui tutorial ]. Review some of these, collect your thoughts and then we can continue a meaningful conversation on common ground...

The reality is, you may need to try a few options to know what will be best for your project.

Share this post


Link to post
Share on other sites
2 hours ago, GoliathForge said:

But in your case, I feel it would be fine to build your GUI in a manner similar to your sprites because I suspect button behavior,  a text entry field and perhaps icon drag and drop would be the height of your needs.  

how do I build a gui similar to my sprites?

Share this post


Link to post
Share on other sites

can you please ask that in a more specific way. I'm assuming you don't want the default os gui provided but instead hardware rasterized elements. Do you think that 2D gui elements are not rectangles just like sprites? Do gui elements not require vertices and a position on screen just like sprites? If you change the texture of one of your sprites to something that appeared gui-ish, would you be able to tell the difference if you were also checking for mouse screen clicks and responded with an action on a detected good click within the gui image rectangle?

I encourage you to please review some existing gui libraries to get a feel for different approaches, then come back and tell us what you liked and didn't like. 

Share this post


Link to post
Share on other sites

 I want to open a window when a collision occurs with the sprites. I want to show hit points and level and strength and dexterity.

Share this post


Link to post
Share on other sites

You will only get general answers if you post general remarks.

There are too many ways to "open a window ... [and] show hit points ...". Just as @GoliathForge said, go out on a search. Have a look at the many examples and tutorials.

We cannot possibly be better than these tutorials on such a general level as you present to us. If you run into specific problems while working through an example, post them and be very specific. And, by all means, let go of OpenGL 1. It is 20 years old and the knowledge is fading out.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • 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!