Create multiple windows with glutCreateWindow

Hello there!
This is my first post here and maibee my 10th hour of C++/OF,… and I got to say, this is great! Thanks a lot Zach and Theo! Keep up the good work!

I’m trying to create another window to put all my GUI stuffs, I tried this code but it just make my app crash:

  
  
int winId = glutGetWindow();  
  
glutInitWindowSize(200,600);  
glutInitWindowPosition(20,20);  
glutCreateWindow("test");  
glutSetWindow(winId);  
  

Any idea why OF doesn’t like that?

I got this strange error message but i don’t know what to do with that…Can someone tell me what does i mean:

Glut: Fatal Error in openframeworks: redisplay needed for window 3, but no display callback.

Thanks!

The error indicates you need to set a function for GLUT to call whenever it needs to redraw the screen you can do that via the function

  
void glutDisplayFunc(void (*func)(void));   

Where the parameter is a pointer to a function that takes no parameters and returns void.

There is a post about this somewhere else… but it seems like there is a bug in the search function, so can’t search anything right now.

I managed to get multiple windows with some hacking.

Thank you guys!
If someone is interested, i had to call also another glut function to make it work:

  
  
    glutPostRedisplay();  
  

It work now, but it’s kind of messy…
THanks again![/quote]