Hi Jose,

I can't know what the error might be for such little information and
without know anything about WindowForms.  May I suggest look at the
CVS version of the OSG as it has a number of examples dedicated to
show how to integrate with other 3rd party windowing toolkits.  Look
for the osgsimpleviewer* examples, these are all based on the new
osgViewer::SimpleViewer.

SimpleViewer is written specifically for the purpose of making it easy
to integrate with other windowing toolkits, a role that
osgUtil::SceneView once filled.  SimpleView is higher level though,
providing more features out of the bag such as ability to handle
events, camera minaipulators and support for the database pager
inbuilt.

Robert.

On 1/23/07, José Antonio Iglesias Guitián <[EMAIL PROTECTED]> wrote:

    Hi all OSG users,

I have encountered problems trying to render in a Windows Forms window
using OSG sceneview class.
I create a WindowsForms PictureBox component and obtain its handle in a
class that inherits from System::Windows::Forms::Form

    hwnd = (HWND) this->pictureBox1->Handle.ToPointer();

I pass this handle, called hwnd as a parameter to my OSG as follows:

    Osg = gcnew COpenSceneGraph(this, hwnd);

Inside the constructor of my OSG class I have the follow line:

    m_hDC = GetDC(hwnd);
    if (m_hDC)
    {
               MySetPixelFormat(m_hDC);  //function to set up the pixel
format
               HGLRC hglrc = wglCreateContext(m_hDC);
                wglMakeCurrent(m_hDC, hglrc);
                InitGL();
                _sceneview->setSceneData(loadedModel.get());
                _sceneview->setClearColor(osg::Vec4(0.0,1.0,0.0,1));
                _sceneview->init();
    }


In my render main function I call _sceneview->update() , cull() and draw()
and the problem is that I cannot see anything in the pictureBox as a result
of sceneview calls.


Has anybody tried something similar and knows what could be my error?
Thank you very much for help.


_______________________________________________
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