bug with poco and update/draw order

Doing some testing with Todd, and we came up with the following test code:

void testApp::setup(){	  
   printf("%i setup\n", ofGetFrameNum());	  
void testApp::update() {  
   printf("%i update\n", ofGetFrameNum());	  
void testApp::draw() {  
   printf("%i draw\n", ofGetFrameNum());	  

which gave the following results:

0 setup  
0 draw  
1 update  
1 draw  
2 update  
2 draw  
3 update  
3 draw  
4 update  
4 draw  

so on the first frame, update is not called and draw is called directly after setup. So if your draw function is relying on variables to be initialized in update - you crash.

Hey memo I’ve also noticed that, but thought it was a glut thing. Are you sure it’s poco? The notifications are being called from the glut callback so they should be called in the same order as glut calls.

Hey Arturo, I’m not sure at all if the bug is related to poco. In fact I don’t even know why I jumped to that conclusion - it could be glut (or something else in the unknown depths of the core). I think in an earlier version of oF i had done the same printfs to see when all the events were being called and it was fine (as far as i remember). So when i realized it wasnt working now I assumed it was poco…

Yes, it surprised me too, I was having the same problem with unitialized variables. I’ll test 0.05 to see if it’s just glut that work like that or there’s any problem