Hi Shuxing,

I'm afraid I can't directly help out with getting this working as I
don't have a windows box, or any expertise with Win32 API.  The
QOSGWidget does work under Linux, but Windows does have its own little
issues that the QOSGWidget possibly isn't handling.

The pixel format being reported as invalid rings a bell, I recall
users/contributors to the osgviewerMFC coming across issues like this,
so perhaps this example might be able to provide a bit of guidance.
All check the osg-users archives for discussion about this example
perhaps this will shed some light.  My guess the solution will be
making sure the QWidget is created with a pixel format that supports
later creation of an OpenGL context.

Robert.

On Jan 8, 2008 1:54 AM, Shuxing Xiao <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Last time, Robert recommend me to use the new QOSGWidget in development
> release 2.3.0, I've tried for a long time with anything I can do, but I
> still can't get the example working, and I don't know why.
>
> My programming environment is windows 2003 server, visual studio 2005,
> GeForce FX 5200.
>
>
>
> I run it under the command window with the following command:
>
>
>
> E:\osg\OpenSceneGraph\bin>osgviewerQTd.exe --QOSGWidget
> e:/osg/OpenSceneGraph-Data/cow.osg
>
>
>
> The output is:
>
>
>
> 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
>
>
>
> However, it's absolutely fine to use the old QAdapterWidget, the window is
> ok, the rendering is great.
>
> E:\osg\OpenSceneGraph\bin>osgviewerQTd.exe --QAdapterWidget
> e:/osg/OpenSceneGraph-Data/cow.osg
>
> Using AdapterWidget - QGLWidget subclassed to integrate with osgViewer using
> its embedded graphics window support.
>
>
>
> Is there anybody who has successfully run the example with QOSGWidget which
> is derived directly from QWidget? Or it's just me who can't run this.
>
> Can anybody give me any clue? Thanks very much in advance.
> _______________________________________________
> 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

Reply via email to