From Wojciech Lewandowski and Robert Osfield, add CMake build option for controlling the Windows/NVidia multi-monitor workaround.

This commit is contained in:
Robert Osfield 2008-10-07 14:36:46 +00:00
parent 0daf1f007a
commit 09e6261e9a
2 changed files with 22 additions and 0 deletions

View File

@ -7,6 +7,7 @@ ELSE (DYNAMIC_OPENSCENEGRAPH)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF(DYNAMIC_OPENSCENEGRAPH)
SET(LIB_NAME osgViewer) SET(LIB_NAME osgViewer)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
SET(LIB_PUBLIC_HEADERS SET(LIB_PUBLIC_HEADERS
${HEADER_PATH}/CompositeViewer ${HEADER_PATH}/CompositeViewer
@ -39,6 +40,18 @@ SET(LIB_EXTRA_LIBS)
IF(WIN32) IF(WIN32)
#
# Enable workaround for OpenGL driver issues when used in multithreaded/multiscreen with NVidia drivers on Windows XP
# For example: osgviewer dumptruck.osg was showing total garbage (screen looked like shattered, splashed hedgehog)
# There were also serious issues with render to texture cameras.
# Workaround repeats makeCurrentContext call as it was found that this causes the problems to dissapear.
#
OPTION(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND "Set to ON if you have NVidia board and drivers earlier than 177.92 ver" ON)
MARK_AS_ADVANCED(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
IF(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
ADD_DEFINITIONS(-DOSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
ENDIF(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS} SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS}
${HEADER_PATH}/api/Win32/GraphicsWindowWin32 ${HEADER_PATH}/api/Win32/GraphicsWindowWin32
${HEADER_PATH}/api/Win32/PixelBufferWin32 ${HEADER_PATH}/api/Win32/PixelBufferWin32

View File

@ -1664,6 +1664,14 @@ bool GraphicsWindowWin32::makeCurrentImplementation()
return false; return false;
} }
// 2008/10/03
// Few days ago NVidia released WHQL certified drivers ver 178.13.
// These drivers (as well as former beta ver 177.92) were free from the bug described below.
// So it looks like its high time to undef the workaround.
// If you happen to still use earlier drivers and have problems consider changing to new ones or
// activate OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND macro def through CMake advanced vars.
#ifdef OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND
// 2008/05/12 // 2008/05/12
// Workaround for Bugs in NVidia drivers for windows XP / multithreaded / dualview / multicore CPU // Workaround for Bugs in NVidia drivers for windows XP / multithreaded / dualview / multicore CPU
// affects GeForce 6x00, 7x00, 8x00 boards (others were not tested) driver versions 174.xx - 175.xx // affects GeForce 6x00, 7x00, 8x00 boards (others were not tested) driver versions 174.xx - 175.xx
@ -1688,6 +1696,7 @@ bool GraphicsWindowWin32::makeCurrentImplementation()
return false; return false;
} }
} }
#endif
if (!::wglMakeCurrent(_hdc, _hglrc)) if (!::wglMakeCurrent(_hdc, _hglrc))
{ {