Hi Paul,
thanks, but unfortunately this does not help as the method
GraphicsWindowWin32::createContextImplementation() does not get called
at all, and the glContextVersion does not get parsed ( at my site ).
This brings me back to my doubts and original question, probably I use
the wrong way to create the GL3 context, so what is the right way ?
I am sorry, I am getting lost in the osg code here. Have no idea what to
do to get this particular method called.
Thank you
Cheers, PP
Hi -- A simple search of the source code shows that glContextVersion
is parsed in only one place: GraphicsContextWin32.cpp, line 1678. Set
a breakpoint there in the debugger and step through the following
lines of code to ensure you're getting the right context.
-Paul
On 10/11/2011 1:32 AM, PP CG wrote:
Hello community,
I compiled osg for GL3, and created a glContextVersion( "3.3" ) GL
context. In my simple test application Camera Manipulation and
MatrixTransforms are working as usual without me writing any
transformation shader. Is this possible ?
As I have doubts about this I guess that I have setup the GL context
in a wrong way, so how does one set it up properly ?
My way:
osg::GraphicsContext::Traits * traits = new
osg::GraphicsContext::Traits() ;
int width = 1920 , height = 1200 ;
traits -> x = 0 ;
traits -> y = 0 ;
traits -> width = width ;
traits -> height = height ;
traits -> windowDecoration = true ;
traits -> doubleBuffer = true ;
traits -> glContextVersion = std::string( "3.3" ) ;
traits -> windowDecoration = false ;
osg::GraphicsContext * graphicsContext =
osg::GraphicsContext::createGraphicsContext( traits ) ;
osg::Camera * cam = new osg::Camera() ;
cam -> setGraphicsContext( graphicsContext ) ;
cam -> setViewport( 0 , 0 , width , height ) ;
cam -> setClearMask( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ;
cam -> setClearColor( osg::Vec4( 0.0 , 0.0 , 0.0 , 1.0 ) ) ;
cam -> setProjectionMatrixAsPerspective( 30.0f , ( float )width /
( float )height , 1.0 , 1000.0 ) ;
viewer.setCamera( cam ) ;
viewer.setSceneData( xform.get() ) ;
viewer.realize() ;
return viewer.run() ;
Thank you
Cheers, PP
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org