SIGN IN SIGN UP

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.

0 0 14 C++
#include "eventsObject.h"
//--------------------------------------------------------------
eventsObject::eventsObject(){
2022-09-30 01:38:49 -03:00
counter = 0;
}
//--------------------------------------------------------------
void eventsObject::enable(){
2022-09-30 01:38:49 -03:00
ofAddListener(ofEvents().update, this, &eventsObject::update);
}
//--------------------------------------------------------------
void eventsObject::disable(){
2022-09-30 01:38:49 -03:00
ofRemoveListener(ofEvents().update, this, &eventsObject::update);
}
//--------------------------------------------------------------
void eventsObject::update(ofEventArgs & args){
2022-09-30 01:38:49 -03:00
counter += 0.3;
int intCounter = (int)counter;
ofNotifyEvent(newFloatEvent, counter, this);
ofNotifyEvent(newIntEvent, intCounter, this);
}