Tell me more ×
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
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
show 3 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.