Hi Daniel,

I have heard others being successful at getting this working, but don't have
the code first hand.  My best guess would be to try adding a realize();
before the frame loop.

If you get it working then perhaps you could tweak the OSG's QT example to
work using this method :-)

Robert.

On 5/3/07, Kallfass, Daniel, SDGE1 <[EMAIL PROTECTED]> wrote:

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/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to