int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height) { GLUTwindow *window; window = __glutCreateWindow(__glutWindowList[win - 1], x, y, width, height, /* not game mode */ 0); #if !defined(_WIN32) && !defined(__OS2__) { GLUTwindow *toplevel; toplevel = __glutToplevelOf(window); if (toplevel->cmap != window->cmap) { __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK); } } #endif return window->num + 1; }
/* CENTRY */ void APIENTRY glutDestroyWindow(int win) { GLUTwindow *window = __glutWindowList[win - 1]; if (__glutMappedMenu && __glutMenuWindow == window) { __glutFatalUsage("destroying menu window not allowed while menus in use"); } #if !defined(WIN32) /* If not a toplevel window... */ if (window->parent) { /* Destroying subwindows may change colormap requirements; recalculate toplevel window's WM_COLORMAP_WINDOWS property. */ __glutPutOnWorkList(__glutToplevelOf(window->parent), GLUT_COLORMAP_WORK); } #endif __glutDestroyWindow(window, window); }