Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

The_Fallen

Implementing a GUI

This topic is 5710 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

Hi, I''m looking for some good ressources about implementing a simple GUI in OpenGL. I''ve already written some code, but I think, it''s not really nice... My biggest problem: How to implement the 2d drawing? At the moment I''m dynamically drawing in a texture and draw it to screen in ortho mode. But I hold the texture in memory within a simple two dimensional array and so I have to write functions for everything (lines, text, etc) by myself, and that''s not really what I want. Any idea, how to do this better? thx, fallen

Share this post


Link to post
Share on other sites
Advertisement
That''s how I do it, and it works pretty fine. Of course, the text is a separate thing, I made a function that just draws the text, wherever I want, and the buttons are textures.

Share this post


Link to post
Share on other sites
Hmm, okay, thx.
Then I try to optimize my existing code...
But it drops from about 400fps to 150fps when creating the texture and drawing it...

Share this post


Link to post
Share on other sites
Are you redrawing your gui every frame?
If so, look into using the glAddSwapHintRectWIN windows extension to cut down on the amount of screen being redrawn, perhaps that will help out.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!