Century Embedded Technologies Nano-X SDK and Developer's Guide | ||
---|---|---|
Prev | Appendix D. GLUT Compatibility | Next |
You can make your GLUT window a child of a Fl_Window with the following scheme. The biggest trick is that GLUT insists on show() 'ing the window at the point it is created, which means the Fl_Window parent window must already be shown.
Don't call glutInit().
Create your Fl_Window, and any FLTK widgets. Leave a blank area in the window for your GLUT window.
show() the Fl_Window. Perhaps call show(argc,argv).
Call window->begin() so that the GLUT window will be automatically added to it.
Use glutInitWindowSize() and glutInitWindowPosition() to set the location in the parent window to put the GLUT window.
Put your GLUT code next. It probably does not need many changes. Call window->end() immediately after the glutCreateWindow()!
You can call either glutMainLoop(), Fl::run(), or loop calling Fl::wait() to run the program.