Example #1
0
SDL_Rect GuiWindow::getAbsolutePosition()
{
   SDL_Rect out = getPosition();

   for (GuiWindow* wnd = getParent(); wnd != NULL; wnd = wnd->getParent() )
   {
      SDL_AddRectPosition( out, wnd->getPosition() );
   }

   return out;
}
Example #2
0
void GuiWindow::getAncestors(WindowList *captured)
{
   WindowList backward;

   for ( GuiWindow* curr = this; curr != NULL; curr = curr->getParent() )
   {
      backward.push_back(curr);
   }

   for ( auto it = backward.rbegin(); it != backward.rend(); it++ )
   {
      captured->push_back(*it);
   }
}