From: Martin F. <mf...@gm...> - 2010-05-31 06:08:55
|
I recently submitted a bug report to Nvidia about shared display list problems with their drivers, and provided a demo program built upon freeglut. To illustrate the bug, I had to display two or more windows, each with its own unique GL context, but sharing the display lists with the GL context from the first window. The GLUT_USE_CURRENT_CONTEXT flag didn't work in this case, as this results in an entire GL context (not just the display lists) being shared by multiple windows. In the end I came up with a small patch for freeglut that provides the shared display list support I required, via a new GLUT_USE_SHARED_LISTS flag: glutSetOption(GLUT_RENDERING_CONTEXT, GLUT_USE_SHARED_LISTS); This behaves just like the default GLUT_CREATE_NEW_CONTEXT flag glutSetOption(GLUT_RENDERING_CONTEXT, GLUT_CREATE_NEW_CONTEXT); except that any additional contexts (i.e. when creating additional windows) share the display lists with the initial GL context. I've posted the patch in case it may be of use to others, or if there is interest to incorporate this into freeglut itself. To apply the patch to freeglut 2.6.0: % tar xzf freeglut-2.6.0.tar.gz % cd freeglut-2.6.0 % patch -p1 < /path/to/freeglut-2.6.0-sl.patch % ./configure --prefix=/path/to/freeglut/install/location % make install Cheers, Martin |