Jump to content
  • Advertisement
Sign in to follow this  
billconan

OpenGL Is there anything called cross-platform GDI+?

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

Dear all, I’m wondering if there is anything called “cross-platform GDI”, a cross-platform 2D api that could be used for a GUI library. I’m writing my own GUI library with Opengl, but I don’t know how to implement some 2D features with GL, For example, a pixturebox that lets users to draw 2D primitives. Plus, I want my GUI Library be more general purpose, not just be perfect for 3D applications. So I want to switch my GUI to a 2D api relevant to GDI. I downloaded the compiz project, a very fantastic Linux GUI implemented with Opengl. I don’t know much about Linux. But it seems that compiz doesn’t actually handle the “2D drawing”, instead it uses other api, say gnome, to draw the GUI onto a texture and applies it to a quad. How did they do this in the QT4? thanks

Share this post


Link to post
Share on other sites
Advertisement
Maybe you should look into GTK+. It's used in numerous open source programs, namely The Gimp. However, don't expect it to have a 'drawing window' or anything like that. That's generally not the job of the GUI library.

As for drawing with OpenGL, it's certainly possible. Maybe rendering to a texture might help you. Look into FBOs for that. You could, for example, draw 1-pixel points on the screen in the drawn shape (or actually just render the shape, if it's a OGl primitive, too), render that to a texture, and bind the texture to the a quad in the drawing spot.

Share this post


Link to post
Share on other sites
Sign in to follow this  

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