From Ralf Habacker, "the appended patch fixes the problem reported on http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-January/006110.html. "

> Using QOSGWidget - QWidget + osgViewer creating the graphics context.
>
> Windows Error #2000: [Screen #0] GraphicsWindowWin32::setWindow() - Unable
> to create OpenGL rendering context. Reason: The pixel format is invalid.
>
>
>
> And then the following fate error pops up:
>
>
>
> The instruction at "0x014c7ef1" referenced memory at "0x000000a4", The
> memory could not be "read".
>
> Click on Ok to terminate the program
>
> Click on CANCEL to debug the program
>
>
This commit is contained in:
Robert Osfield
2008-09-18 12:57:15 +00:00
parent 8dd9c54229
commit 4923c88bd0

View File

@@ -1140,7 +1140,13 @@ bool GraphicsWindowWin32::setWindow( HWND handle )
//
// Create the OpenGL rendering context associated with this window
//
if (!setPixelFormat())
{
reportErrorForScreen("GraphicsWindowWin32::setWindow() - Unable to set the inherited window pixel format", _traits->screenNum, ::GetLastError());
_hdc = 0;
_hwnd = 0;
return false;
}
_hglrc = ::wglCreateContext(_hdc);
if (_hglrc==0)
{