Removed spaces from end of lines
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*
|
||||
* This file is Copyright (C) 2007 - Andr<64> Garneau (andre@pixdev.com) and licensed under OSGPL.
|
||||
@@ -599,7 +599,7 @@ Win32WindowingSystem::~Win32WindowingSystem()
|
||||
osg::Referenced::getDeleteHandler()->setNumFramesToRetainObjects(0);
|
||||
osg::Referenced::getDeleteHandler()->flushAll();
|
||||
}
|
||||
|
||||
|
||||
unregisterWindowClasses();
|
||||
}
|
||||
|
||||
@@ -707,10 +707,10 @@ bool Win32WindowingSystem::getSampleOpenGLContext( OpenGLContext& context, HDC w
|
||||
osgGraphicsWindowWithoutCursorClass.c_str(),
|
||||
NULL,
|
||||
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_DISABLED,
|
||||
windowOriginX,
|
||||
windowOriginY,
|
||||
1,
|
||||
1,
|
||||
windowOriginX,
|
||||
windowOriginY,
|
||||
1,
|
||||
1,
|
||||
NULL,
|
||||
NULL,
|
||||
::GetModuleHandle(NULL),
|
||||
@@ -783,7 +783,7 @@ bool Win32WindowingSystem::getSampleOpenGLContext( OpenGLContext& context, HDC w
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int Win32WindowingSystem::getNumScreens( const osg::GraphicsContext::ScreenIdentifier& si )
|
||||
unsigned int Win32WindowingSystem::getNumScreens( const osg::GraphicsContext::ScreenIdentifier& si )
|
||||
{
|
||||
return si.displayNum==0 ? ::GetSystemMetrics(SM_CMONITORS) : 0;
|
||||
}
|
||||
@@ -923,7 +923,7 @@ bool Win32WindowingSystem::setScreenSettings( const osg::GraphicsContext::Screen
|
||||
deviceMode.dmFields |= DM_BITSPERPEL;
|
||||
deviceMode.dmBitsPerPel = static_cast<DWORD>(resolution.colorDepth);
|
||||
}
|
||||
|
||||
|
||||
return changeScreenSettings(si, displayDevice, deviceMode);
|
||||
}
|
||||
|
||||
@@ -1056,7 +1056,7 @@ GraphicsWindowWin32::GraphicsWindowWin32( osg::GraphicsContext::Traits* traits )
|
||||
else setCursor(NoCursor);
|
||||
|
||||
init();
|
||||
|
||||
|
||||
if (valid())
|
||||
{
|
||||
setState( new osg::State );
|
||||
@@ -1065,7 +1065,7 @@ GraphicsWindowWin32::GraphicsWindowWin32( osg::GraphicsContext::Traits* traits )
|
||||
if (_traits.valid() && _traits->sharedContext)
|
||||
{
|
||||
getState()->setContextID( _traits->sharedContext->getState()->getContextID() );
|
||||
incrementContextIDUsageCount( getState()->getContextID() );
|
||||
incrementContextIDUsageCount( getState()->getContextID() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1098,10 +1098,10 @@ void GraphicsWindowWin32::init()
|
||||
_valid = _initialized;
|
||||
|
||||
// 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.
|
||||
// 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 make the workaround inactive by default.
|
||||
// If you happen to still use earlier drivers and have problems consider changing to new ones or
|
||||
// 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
|
||||
|
||||
@@ -1109,14 +1109,14 @@ void GraphicsWindowWin32::init()
|
||||
// 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
|
||||
// pre 174.xx had other issues so reverting is not an option (statitistics, fbo)
|
||||
// drivers release 175.16 is the latest currently available
|
||||
//
|
||||
// drivers release 175.16 is the latest currently available
|
||||
//
|
||||
// When using OpenGL in threaded app ( main thread sets up context / renderer thread draws using it )
|
||||
// first wglMakeCurrent seems to not work right and screw OpenGL context driver data:
|
||||
// 1: succesive drawing shows a number of artifacts in TriangleStrips and TriangleFans
|
||||
// first wglMakeCurrent seems to not work right and screw OpenGL context driver data:
|
||||
// 1: succesive drawing shows a number of artifacts in TriangleStrips and TriangleFans
|
||||
// 2: weird behaviour of FramBufferObjects (glGenFramebuffer generates already generated ids ...)
|
||||
// Looks like repeating wglMakeCurrent call fixes all these issues
|
||||
// wglMakeCurrent call can impact performance so I try to minimize number of
|
||||
// wglMakeCurrent call can impact performance so I try to minimize number of
|
||||
// wglMakeCurrent calls by checking current HDC and GL context
|
||||
// and repeat wglMakeCurrent only when they change for current thread
|
||||
|
||||
@@ -1157,10 +1157,10 @@ bool GraphicsWindowWin32::createWindow()
|
||||
Win32WindowingSystem::osgGraphicsWindowWithoutCursorClass.c_str(),
|
||||
_traits->windowName.c_str(),
|
||||
windowStyle,
|
||||
_windowOriginXToRealize,
|
||||
_windowOriginYToRealize,
|
||||
_windowWidthToRealize,
|
||||
_windowHeightToRealize,
|
||||
_windowOriginXToRealize,
|
||||
_windowOriginYToRealize,
|
||||
_windowWidthToRealize,
|
||||
_windowHeightToRealize,
|
||||
NULL,
|
||||
NULL,
|
||||
::GetModuleHandle(NULL),
|
||||
@@ -1289,7 +1289,7 @@ void GraphicsWindowWin32::destroyWindow( bool deleteNativeWindow )
|
||||
{
|
||||
if (_destroying) return;
|
||||
_destroying = true;
|
||||
|
||||
|
||||
if (_graphicsThread && _graphicsThread->isRunning())
|
||||
{
|
||||
// find all the viewers that might own use this graphics context
|
||||
@@ -1298,7 +1298,7 @@ void GraphicsWindowWin32::destroyWindow( bool deleteNativeWindow )
|
||||
{
|
||||
osgViewer::View* view = dynamic_cast<osgViewer::View*>((*it)->getView());
|
||||
osgViewer::ViewerBase* viewerBase = view ? view->getViewerBase() : 0;
|
||||
if (viewerBase && viewerBase->areThreadsRunning())
|
||||
if (viewerBase && viewerBase->areThreadsRunning())
|
||||
{
|
||||
viewerBase->stopThreading();
|
||||
}
|
||||
@@ -1489,9 +1489,9 @@ static void PreparePixelFormatSpecifications( const osg::GraphicsContext::Traits
|
||||
case osg::DisplaySettings::SWAP_DEFAULT:
|
||||
// Wojtek Lewandowski 2010-09-28:
|
||||
// Keep backward compatibility if no method is selected via traits
|
||||
// and let wglSwapExchangeARB flag select swap method.
|
||||
// However, I would rather remove this flag because its
|
||||
// now redundant to Traits::swapMethod and it looks like
|
||||
// and let wglSwapExchangeARB flag select swap method.
|
||||
// However, I would rather remove this flag because its
|
||||
// now redundant to Traits::swapMethod and it looks like
|
||||
// WGL_SWAP_EXCHANGE_ARB is the GL default when no WGL_SWAP attrib is given.
|
||||
// To be precise: At least on Windows 7 and Nvidia it seems to be a default.
|
||||
if ( allowSwapExchangeARB )
|
||||
@@ -1521,28 +1521,28 @@ static int ChooseMatchingPixelFormat( HDC hdc, int screenNum, const WGLIntegerAt
|
||||
{
|
||||
// = openGLContext.getTraits()
|
||||
reportErrorForScreen("ChooseMatchingPixelFormat() - wglChoosePixelFormatARB extension not found, trying GDI", screenNum, ::GetLastError());
|
||||
PIXELFORMATDESCRIPTOR pixelFormat = {
|
||||
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
|
||||
1, // version number
|
||||
PFD_DRAW_TO_WINDOW | // support window
|
||||
PFD_SUPPORT_OPENGL | // support OpenGL
|
||||
(_traits->doubleBuffer ? PFD_DOUBLEBUFFER : NULL) | // double buffered ?
|
||||
PIXELFORMATDESCRIPTOR pixelFormat = {
|
||||
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
|
||||
1, // version number
|
||||
PFD_DRAW_TO_WINDOW | // support window
|
||||
PFD_SUPPORT_OPENGL | // support OpenGL
|
||||
(_traits->doubleBuffer ? PFD_DOUBLEBUFFER : NULL) | // double buffered ?
|
||||
(_traits->swapMethod == osg::DisplaySettings::SWAP_COPY ? PFD_SWAP_COPY : NULL) |
|
||||
(_traits->swapMethod == osg::DisplaySettings::SWAP_EXCHANGE ? PFD_SWAP_EXCHANGE : NULL),
|
||||
PFD_TYPE_RGBA, // RGBA type
|
||||
PFD_TYPE_RGBA, // RGBA type
|
||||
_traits->red + _traits->green + _traits->blue, // color depth
|
||||
_traits->red ,0, _traits->green ,0, _traits->blue, 0, // shift bits ignored
|
||||
_traits->red ,0, _traits->green ,0, _traits->blue, 0, // shift bits ignored
|
||||
_traits->alpha, // alpha buffer ?
|
||||
0, // shift bit ignored
|
||||
0, // no accumulation buffer
|
||||
0, 0, 0, 0, // accum bits ignored
|
||||
0, // shift bit ignored
|
||||
0, // no accumulation buffer
|
||||
0, 0, 0, 0, // accum bits ignored
|
||||
_traits->depth, // 32 or 16 bit z-buffer ?
|
||||
_traits->stencil, // stencil buffer ?
|
||||
0, // no auxiliary buffer
|
||||
PFD_MAIN_PLANE, // main layer
|
||||
0, // reserved
|
||||
0, 0, 0 // layer masks ignored
|
||||
};
|
||||
0, // no auxiliary buffer
|
||||
PFD_MAIN_PLANE, // main layer
|
||||
0, // reserved
|
||||
0, 0, 0 // layer masks ignored
|
||||
};
|
||||
int pixelFormatIndex = ::ChoosePixelFormat(hdc, &pixelFormat);
|
||||
if (pixelFormatIndex == 0)
|
||||
{
|
||||
@@ -1801,7 +1801,7 @@ bool GraphicsWindowWin32::setWindowDecorationImplementation( bool decorated )
|
||||
//
|
||||
|
||||
::InvalidateRect(NULL, NULL, TRUE);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1885,7 +1885,7 @@ bool GraphicsWindowWin32::realizeImplementation()
|
||||
reportErrorForScreen("GraphicsWindowWin32::realizeImplementation() - Unable to show window", _traits->screenNum, ::GetLastError());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!::UpdateWindow(_hwnd))
|
||||
{
|
||||
reportErrorForScreen("GraphicsWindowWin32::realizeImplementation() - Unable to update window", _traits->screenNum, ::GetLastError());
|
||||
@@ -1909,8 +1909,8 @@ bool GraphicsWindowWin32::makeCurrentImplementation()
|
||||
if( _applyWorkaroundForMultimonitorMultithreadNVidiaWin32Issues )
|
||||
{
|
||||
if( ::wglGetCurrentDC() != _hdc ||
|
||||
::wglGetCurrentContext() != _hglrc )
|
||||
{
|
||||
::wglGetCurrentContext() != _hglrc )
|
||||
{
|
||||
if (!::wglMakeCurrent(_hdc, _hglrc))
|
||||
{
|
||||
reportErrorForScreen("GraphicsWindowWin32::makeCurrentImplementation() - Unable to set current OpenGL rendering context", _traits->screenNum, ::GetLastError());
|
||||
@@ -2050,7 +2050,7 @@ void GraphicsWindowWin32::requestWarpPointer( float x, float y )
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
getEventQueue()->mouseWarped(x,y);
|
||||
}
|
||||
|
||||
@@ -2103,7 +2103,7 @@ void GraphicsWindowWin32::useCursor( bool cursorOn )
|
||||
if (_traits->useCursor == false)
|
||||
{
|
||||
setCursor(NoCursor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsWindowWin32::setCursor( MouseCursor mouseCursor )
|
||||
@@ -2119,10 +2119,10 @@ void GraphicsWindowWin32::setCursorImpl( MouseCursor mouseCursor )
|
||||
_mouseCursor = mouseCursor;
|
||||
HCURSOR newCursor = getOrCreateCursor( mouseCursor);
|
||||
if (newCursor == _currentCursor) return;
|
||||
|
||||
|
||||
_currentCursor = newCursor;
|
||||
_traits->useCursor = (_currentCursor != NULL) && (_mouseCursor != NoCursor);
|
||||
|
||||
|
||||
if (_mouseCursor != InheritCursor)
|
||||
::SetCursor(_currentCursor);
|
||||
}
|
||||
@@ -2203,7 +2203,7 @@ HCURSOR GraphicsWindowWin32::getOrCreateCursor(MouseCursor mouseCursor)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return _mouseCursorMap[mouseCursor];
|
||||
}
|
||||
|
||||
@@ -2303,10 +2303,10 @@ void GraphicsWindowWin32::adaptKey( WPARAM wParam, LPARAM lParam, int& keySymbol
|
||||
{
|
||||
keySymbol = osgGA::GUIEventAdapter::KEY_KP_Enter;
|
||||
}
|
||||
|
||||
|
||||
unmodifiedKeySymbol = keySymbol;
|
||||
|
||||
if ((keySymbol & 0xff00)==0)
|
||||
|
||||
if ((keySymbol & 0xff00)==0)
|
||||
{
|
||||
char asciiKey[2];
|
||||
int numChars = ::ToAscii(wParam, (lParam>>16)&0xff, keyState, reinterpret_cast<WORD*>(asciiKey), 0);
|
||||
@@ -2334,13 +2334,13 @@ LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, UINT uMsg, W
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
// Wojtek Lewandowski 2010-09-28:
|
||||
// All web docs on Windows Aero and OpenGL compatibiltiy
|
||||
// Wojtek Lewandowski 2010-09-28:
|
||||
// All web docs on Windows Aero and OpenGL compatibiltiy
|
||||
// suggest WM_ERASEBKGND should be handled with non NULL value return.
|
||||
// This sugesstion may be irrelevant for our window class
|
||||
// as default brush pattern is not set so erase flag is forwarded to WM_PAINT
|
||||
// This sugesstion may be irrelevant for our window class
|
||||
// as default brush pattern is not set so erase flag is forwarded to WM_PAINT
|
||||
// and gets ignored when WM_PAINT is handled.
|
||||
// But it will certainly be safer and not make things worse
|
||||
// But it will certainly be safer and not make things worse
|
||||
// if we handle this message to be sure everything is done as suggested.
|
||||
case WM_ERASEBKGND :
|
||||
return TRUE;
|
||||
@@ -2397,7 +2397,7 @@ LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, UINT uMsg, W
|
||||
case WM_MBUTTONUP :
|
||||
case WM_RBUTTONUP :
|
||||
/////////////////////
|
||||
|
||||
|
||||
{
|
||||
::ReleaseCapture();
|
||||
|
||||
@@ -2469,7 +2469,7 @@ LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, UINT uMsg, W
|
||||
|
||||
if (windowX!=_traits->x || windowY!=_traits->y || windowWidth!=_traits->width || windowHeight!=_traits->height)
|
||||
{
|
||||
resized(windowX, windowY, windowWidth, windowHeight);
|
||||
resized(windowX, windowY, windowWidth, windowHeight);
|
||||
getEventQueue()->windowResize(windowX, windowY, windowWidth, windowHeight, resizeTime);
|
||||
}
|
||||
}
|
||||
@@ -2514,7 +2514,7 @@ LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, UINT uMsg, W
|
||||
//InheritCursor. InheritCursor lets the user manage the cursor externally.
|
||||
if (_mouseCursor != InheritCursor)
|
||||
{
|
||||
if (_traits->useCursor)
|
||||
if (_traits->useCursor)
|
||||
::SetCursor( _currentCursor);
|
||||
else
|
||||
::SetCursor(NULL);
|
||||
@@ -2526,7 +2526,7 @@ LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, UINT uMsg, W
|
||||
case WM_SETFOCUS :
|
||||
///////////////////
|
||||
|
||||
// Check keys and send a message if the key is pressed when the
|
||||
// Check keys and send a message if the key is pressed when the
|
||||
// focus comes back to the window.
|
||||
// I don't really like this hard-coded loop, but the key codes
|
||||
// (VK_* constants) seem to go from 0x08 to 0xFE so it should be
|
||||
|
||||
Reference in New Issue
Block a user