Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

GUI and screen updates

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

if (mIsGui) { SDL_Rect area; area.x = 0; area.y = 0; area.w = SDLMain::getScreenWidth(); area.h = SDLMain::getScreenHeight(); mDesktop->paint(SDLMain::getScreen(), 0); SDLMain::updateScreen(); SDL_FillRect(SDLMain::getScreen(), &area, COLOR(SDLMain::getScreen(), 0)); SDLMain::addUpdateRect(area); mDiffTimeGUI = SDL_GetTicks() - desktopDrawStart; } // .. draw non gui stuff at the background of the gui e.g. the game }
That also means that each and every gui component is drawn at each update! There are some (good ones, I think) reasons for this:
Generated on Wed Jul 14 00:45:34 2004 for CSLib by doxygen 1.3.6