Update of /cvsroot/libufo/ufo-0.5/src/ux
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7102/src/ux
Modified Files:
uxwgldriver.cpp
Log Message:
Fixed texture sharing for WGL target.
Index: uxwgldriver.cpp
===================================================================
RCS file: /cvsroot/libufo/ufo-0.5/src/ux/uxwgldriver.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** uxwgldriver.cpp 21 May 2005 15:19:36 -0000 1.6
--- uxwgldriver.cpp 29 Oct 2005 15:36:16 -0000 1.7
***************
*** 159,162 ****
--- 159,163 ----
UFO_WGL_PROC(HGLRC,wglCreateContext,(HDC))
UFO_WGL_PROC(BOOL,wglDeleteContext,(HGLRC))
+ UFO_WGL_PROC(BOOL,wglShareLists,(HGLRC, HGLRC))
#undef UFO_WGL_PROC
***************
*** 1082,1085 ****
--- 1083,1087 ----
}
+ static HGLRC s_wgl_shared_context = NULL;
bool
UXWGLDevice::show() {
***************
*** 1135,1138 ****
--- 1137,1145 ----
m_glContext = m_wglDriver->wglCreateContext(m_dc);
makeContextCurrent();
+ if (s_wgl_shared_context == NULL) {
+ s_wgl_shared_context = m_glContext;
+ } else {
+ m_wglDriver->wglShareLists(m_glContext, s_wgl_shared_context);
+ }
//setSizeHints();
***************
*** 1155,1158 ****
--- 1162,1168 ----
void
UXWGLDevice::hide() {
+ if (s_wgl_shared_context == m_glContext) {
+ s_wgl_shared_context = NULL;
+ }
m_wglDriver->wglDeleteContext(m_glContext);
m_glContext = NULL;
|