Hi,

GraphicsWindowWin32::setWindow currently creates a context with no regards to 
the Traits, like createWindow does.

That is, it calls ::wglCreateContext to create a context, not the member method 
createContextImplementation(), which takes into an account the Traits.

In my situation, this prevents a GL 3.x context from being created.

Therefore I think the code should read:


Code:
bool GraphicsWindowWin32::setWindow( HWND handle )
{
    if (!setPixelFormat())
    {
        reportErrorForScreen("GraphicsWindowWin32::setWindow() - Unable to set 
the inherited window pixel format", _traits->screenNum, ::GetLastError());
        ::ReleaseDC(_hwnd, _hdc);
        _hdc  = 0;
        _hwnd = 0;
        return false;
    }

    // -- wrong
    //_hglrc = ::wglCreateContext(_hdc);
    // ++ correct
    _hglrc = createContextImplementation();
    if (_hglrc==0)
    {
        reportErrorForScreen("GraphicsWindowWin32::setWindow() - Unable to 
create OpenGL rendering context", _traits->screenNum, ::GetLastError());
        ::ReleaseDC(_hwnd, _hdc);
        _hdc  = 0;
        _hwnd = 0;
        return false;
    }
}




Cheers,
Fred

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=38217#38217





_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to