Sign in to follow this  
billconan

OpenGL Is there anything called cross-platform GDI+?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this