Re: [osg-users] setCursor problem
Thanks for this answer, I followed some threads about the subject but I got lost with what is working and what is not. thanks again. Romain. Romain Charbit -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10947#10947 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] setCursor problem
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 osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] setCursor problem
Hi Romain, if you followed the thread I initiated on osg-submissions list, you'd realize that the current code can only show the left arrow. So in other words, don't change your code, and apply the patches I submitted. I am sure Robert will take care of this soon. Regards, -Fred - Romain Charbit a écrit : 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 osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org