PDA

View Full Version : Drawing GUI widgets?



Zyx_2000
09-05-2010, 09:03 AM
Hi!

I am developing a GUI library that will be used for some games I'm planning to make. I have most of the code done (event handling, layout, etc.), BUT I haven't made any progress with the actual drawing, since I don't know any good way of doing it. What I want to be able to draw is:
Colored rectangles (for buttons, text edit controls, etc.)
Textured rectangles
Lines (for borders)
Text I'm planning to draw it all with version 3.3, and 2.1 where 3.x is unavailable. I will probably have to render the rectangles first (done using two triangles each in 3.3), then the lines, and the text last. I will use FreeType to generate the bitmaps needed for text rendering. My questions are:
What is an efficient way to send all the necessary vertex/color data to the GPU? How should it be sorted?
What is the best way to render text from bitmaps loaded by FreeType?Thank you on beforehand for any advice I get.