Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've tackled this topic maybe a dozen of times, but each time I write a GUI library, at some point I look at it and see that it's badly designed (from a programmers point of view). I've looked through many other API's, studied the implementations, however, I keep designing little things wrong, and end up doing significant rewrites.

Are there any sites, articles or books about how to design a programmer API for a GUI library? Or maybe someone could share some tips from his experience?

share|improve this question

closed as too broad by Josh Petrie Dec 4 '13 at 4:16

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Good luck I've found tidbits scattered about in books but never anything comprehensive. –  ClassicThunder Feb 1 '12 at 1:58
Why not try to copy one exactly? –  stephelton Feb 1 '12 at 2:25
@stephelton - well apart from the obvious licencing stuff, there's also the fact that my needs are... specific to say the least. For example the same root UI classes need to support a ASCII version and GL version :P –  Kornel Kisielewicz Feb 1 '12 at 2:32
@KornelKisielewicz: What do you mean by an "ASCII version"? Do you mean text art? In any case, CeGUI already shows how to divorce the rendering aspect of a GUI from the GUI management code, so you don't have to have different root UI classes for different rendering styles. –  Nicol Bolas Feb 1 '12 at 3:42
@Nicol, sure it does. However, it does not divorce positioning and layout, and I need to handle positioning/layout differently depending on the output. So I can't say that no matter what this rectangle is (1,1,300,400) because in a typical 80x25 text mode that is ridiculous. Neither can I operate on percentages, because I have no guarantee that the given 20% will give me at least two lines of text output. –  Kornel Kisielewicz Feb 1 '12 at 3:48

Browse other questions tagged or ask your own question.