The GUI wihtin this library assumes, that befor each "update round" the complete area ist blanked.
For an example how the gui should be updated see the folloing code (from CSGame):
while (!mQuit)
{
do
{
handleEvents();
if (mPause)
{
SDL_Delay(50);
}
}
while ((mPause) && (!mQuit));
That also means that each and every gui component is drawn at each update! There are some (good ones, I think) reasons for this:
- Computers are now easliy able to do it, they are fast enough!
- It saves all the trouble one has in keeping in mind which things to update, which backgrounds to save, redrawing stuff under the mouse-cursor etc...
- This library was intended this way. It was started of as a means to create a user frontend for "in game" communication. That also implies the possiblity for the game to continue while changing stuff with the gui. The gui itself does not know anything about any game! So it wouldn't know which areas to update! And the game doesn't know about the gui either!
- Again - it makes the whole screen updating very simple! (Believe me! I once wrote a gui library, that only updated areas of the screen where changes occured, including keeping track of game information, it was an updating horror, for people interested, look at the gui of the DOS Vectrex emulator, that's the gui I'm talking about. But at the time I wrote that gui, it was neccessary, computers were not fast enough (or I was a bad programmer :-)))
Generated on Wed Jul 14 00:45:34 2004 for CSLib by
1.3.6