i do that, the following is my resize code:

void SS3DCanvas::OnSize(wxSizeEvent& event)
{
    // this is also necessary to update the context on some platforms
    wxGLCanvas::OnSize(event);

    // set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)
    int width = event.GetSize().x, height = event.GetSize().y;
    //GetClientSize(&width, &height);

    width = max(5, width);
    height = max(5, height);

    // update the window dimensions, in case the window has been resized.
    getEventQueue()->windowResize(0, 0, width, height);
    resized(0, 0, width, height);

    m_HUD->OnSize(width, height);

    // This is a HACK to un-stick the canvas windows on startup.
    // For some unknown reason, the canvas windows require a single mouse event before they'll start
    // responding to user events. By posting a single, mouse up event we un-stick the windows so they'll
    // respond to the first user event.
    //wxMouseEvent mouseEvent;
    //mouseEvent.m_x = 10;
    //mouseEvent.m_y = 10;
    //mouseEvent.m_leftDown = true;
    //mouseEvent.SetEventType(wxEVT_MOTION);   
    //wxPostEvent(this, mouseEvent);
}

Thibault Genessay wrote:
Hi Tamer,

Have you tried to pass the new graphics window size to the OSG when it
changes ? Your canvas should intercept the resize events and send the
updated sizes to all OSG views, e.g.
myView->getEventQueue()->windowResize(0, 0, width, height);

Thibault

On Jan 20, 2008 1:37 AM, Tamer El Nashar <[EMAIL PROTECTED]> wrote:
  
Hi,

I am using OSG with wx and I am getting a strange bug on my  canvas when
dragging and dropping on the canvas, specifically after resizing the canvas.
So initially after the canvas is resized and I drag and drop, items show up
in the wrong place.  Then I click once on the canvas and then when I drag
and drop they show up in the write place, as if clicking initializes/fixes
something, then everything works.  I tried sending my own wxMouseEvent in
every size event, and the event does get handled by the osgGA::EventQueue,
however that doesnt work.  Only actually clicking on the canvas fixes the
problem. The code that reports the wrong values is:
osgUtil::LineSegmentIntersector::getWorldIntersectPoint().  After clicking
once on the canvas, the same code reports correct values!  Anyone crossed
this before, or any ideas what it could be?  I wouldn't even qualify as a
OSG novice, so any tips would be much appreciated.





 Thanks in advancce




 Tamer El Nashar

VRSonic Inc.
_______________________________________________
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

  
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to