PDA

View Full Version : OpenInventor: SoTimerSensor callback problem



matt_weird
05-06-2003, 09:15 AM
hi!

i'm trying to get to work the SoTimerSensor callback function in MFC dll, but it does't work well, i.e. when i set up all the stuff for the SoTimerObject, it then doesn't call that function I specified in the setFunction method.

the code looks as follows:

SoTimerSensor* timerSens = new SoTimerSensor;

static void sensCallback(void *data, SoSensor *);

void SomeClass::someMember()
{
UpdateData(TRUE);
timerSens->setFunction(sensCallback);
timerSens->unschedule();
timerSens->setBaseTime(SbTime(0.0));
timerSens->setInterval(SbTime(0.01));
timerSens->schedule();
double basetime = timerSens->getBaseTime().getValue();
double interval = timerSens->getInterval().getValue();
SoSensorCB *c_func = timerSens->getFunction();
BOOL isSched = timerSens->isScheduled();
}

static void sensCallback(void *data, SoSensor *)
{
//some code to execute
}


What's the problem?

Thanx!

matt_weird
05-08-2003, 07:27 AM
OK, i've done that thing with SetTimer. Works better -- rather than duzznt http://www.opengl.org/discussion_boards/ubb/smile.gif

But the Q still remains.