bool manageEvents(Viewport* viewport, Events *flags) { SDL_Event event; // Process events until game exit, or there's none left while(SDL_PollEvent(&event)) { if(!manageEvent(event, viewport, flags)) return false; } return true; }
void ofxWidget::newEvent(ofxWidgetsEvent event, ofxWidgetEventArgs & args){ //ofLog(OF_LOG_VERBOSE,name + " newEvent: " + toString(event)); //ofLog(OF_LOG_VERBOSE,name + " newEvent: from " + toString(state)); ofxWidgetsState prevState = state; state = manageEvent(event,args,state); if(state!=prevState){ if(state==OFX_WIDGET_FOCUSED){ bool focused = true; ofNotifyEvent(focusedEvent,focused, this); } if(state==OFX_WIDGET_UNFOCUSED){ bool focused = false; ofNotifyEvent(focusedEvent,focused, this); } } //ofLog(OF_LOG_VERBOSE,name + " newEvent: to " + toString(state)); }
void manageEvents(Viewport* viewport, Events *flags, Action *actionList) { SDL_Event event; // Process events until game exit, or there's none left SDL_PollEvent(&event); manageEvent(event, viewport, flags, actionList); }