Robert,
> Yes, but its only support under Windows so far. X11 and OSX will come along
> later.
> What you do is create a osg::Traits object with
> osgViewer::GraphicsWindowWin32::WindowData attached to it.
Thank you very much for your response with the hint to use WindowData. I have
tried the following code, but I still get an exception when OSG tries to render
a scene:
MyThread::run() {
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new
osg::GraphicsContext::Traits;
traits->x = 0;
traits->y = 0;
traits->width = width();
traits->height = height();
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;
osg::ref_ptr<osgViewer::GraphicsWindowWin32::WindowData> wdata = new
osgViewer::GraphicsWindowWin32::WindowData( internalWinId() ); //Pass QT
QWidget WindowHandle
traits->inheritedWindowData = wdata.get();
osg::ref_ptr<osg::GraphicsContext> gc =
osg::GraphicsContext::createGraphicsContext(traits.get());
gc->setClearColor(osg::Vec4f(0.2f,0.2f,0.6f,1.0f));
gc->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
getCamera()->setGraphicsContext(gc.get());
while( true ) {
frame();
}
}
I get an exception at lightmodel::apply line 55 at lightmodel.cpp:
static bool s_separateSpecularSupported = strncmp((const
char*)glGetString(GL_VERSION),"1.2",3)>=0;
which points to an invalid OpenGL context.
> arghhgh my RSI is killing me, could someone else jump in here and explain.
Sorry for my painful question. Get well soon!
Thanks,
Daniel
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/