FreeGLUT API有几个窗口管理功能:
int glutCreateWindow(const char * title );
int glutCreateSubWindow(int window, int x, int y, int width, int height);
void glutDestroyWindow(int window);
void glutSetWindow(int window);
int glutGetWindow(void);
void glutSetWindowTitle(const char* title);
void glutSetIconTitle(const char* title);
void glutReshapeWindow(int width, int height);
void glutPositionWindow(int x, int y);我对此完全不熟悉。我该如何创建四个具有独特标题和位置的窗口呢?似乎一旦使用glutCreateWindow()创建了第二个窗口,就无法再次访问第一个窗口。
到目前为止,我可以用glutCreateWindow("window 1");创建一个窗口,然后用glutReshapeWindow(width, height)和glutPositionWindow(x, y)重塑和重新定位它,但是我不知道如何同时管理多个窗口。
我在Windows XP上运行MinGW/MSYS,如果这有帮助的话。
发布于 2010-08-01 13:32:32
每次使用glutCreateWindow创建窗口时,它都会返回新窗口的窗口ID。您可以将它存储在一个变量中,并在以后通过glutSetWindow使用它来访问窗口。
还要注意的是,您通常会在创建窗口后为其设置显示函数。
https://stackoverflow.com/questions/3366727
复制相似问题