Hi,

I've seen some discussions about the mouse cursor, but it doesn't answer my 
question. 

How can I set a cursor with the function setCursor. When I make a setCursor :


Code:

osgViewer::GraphicsWindow::MouseCursor mouseCursor;
mouseCursor = osgViewer::GraphicsWindow::DestroyCursor;
gw->setCursor(mouseCursor);




 it does absolutely nothing. 

The only way I can have a cursor, is to do :


Code:

while(!viewer.done())
    {
        viewer.frame();
        gw->setCursor(mouseCursor);
    }




And it does not a proper set, it sets the new cursor only when the mouse is not 
moving.

I watched the source code, and I find it a bit confusing : 

osgViewer/GraphicsWindowWin32.cpp

GraphicsWindowWin32::setCursor( MouseCursor mouseCursor )


Code:

if (mouseCursor != LeftRightCursor && 
        mouseCursor != UpDownCursor && 
        mouseCursor != TopLeftCorner && 
        mouseCursor != TopRightCorner && 
        mouseCursor != BottomLeftCorner && 
        mouseCursor != BottomRightCorner)
    {
        _appMouseCursor = mouseCursor;
    }




then :

Code:

case WM_NCHITTEST :

...
...

default:
          if (_traits->useCursor && _appMouseCursor != InheritCursor)
               setCursor(LeftArrowCursor);
          break;






so if I set a cursor, _appMouseCursor will be equal to the new cursor, but will 
be erased by the case WM_NCHITTEST;

Is there something I'm missing?

Thank you.

Romain.

------------------------
Romain Charbit

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10917#10917





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

Reply via email to