Example #1
0
 const SUCCESS loop() override
 {
     stringstream ss;
     switch(counter)
     {
     case NAME:
         ss<<"Window is titled "<<win->getName();
         counter = POSITION;
         break;
     case POSITION:
         (ss<<"Window is at position ")<<win->getPosition();
         counter = SIZE;
         break;
     case SIZE:
         ss<<"Window has dimensions "<<win->getSize();
         counter = ID;
         break;
     case ID:
         ss<<"Window has ID "<<int(win->getID());
         counter = STAHP;
         break;
     case STAHP:
         runner->stop();
         break;
     default:
         return FAILED;
     }
     query = ss.str();
     SDL_Delay(delay);
     return SUCCEEDED;
 }
Example #2
0
 const SUCCESS loop() override
 {
     SDL_SetRenderDrawColor(ren->getRenderer(), 255, 0, 0, 0);
     SUCCESS ret = SUCCEEDED;
     for(auto i = points.begin(); i != current; i++)
     {
         ret |= SDL_RenderDrawLine(ren->getRenderer(), i->x(), i->y(), (i+1)->x(), (i+1)->y());
     }
     
     if(++current == points.end())
         ender->stop();
     
     SDL_SetRenderDrawColor(ren->getRenderer(), 0, 0, 0, 0);
     
     return ret;
 }