[osg-users] How to hide mouse cursor?

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Mon May 11 10:10:58 PDT 2020


To make it work, I have moved it to after viewer.realize(); like that:

    viewer.realize();
    osgViewer::Viewer::Windows windows;
    viewer.getWindows(windows);
    for(auto &window : windows) {
        window->useCursor(false);
        window->setCursor(osgViewer::GraphicsWindow::NoCursor);
    }
    while ( !viewer.done() )
    {
        viewer.frame();
    }
    return 0;


On Thursday, March 28, 2019 at 10:39:48 AM UTC-3, Anatoly Dovzhik wrote:
>
> Hi. I wanna hide my mouse (commented in main function) but it doesn't 
> work. What do i do wrong? 
>
> here's my main: 
>
> Code: 
> int main() 
> { 
>     osg::Node *scene = osgDB::readNodeFile("../resourses/lz.osg"); 
>     osgViewer::Viewer *viewer = new osgViewer::Viewer(); 
>
>
>     //DON'T WORK 
>     osgViewer::Viewer::Windows windows; 
>     viewer->getWindows(windows); 
>     for(auto &window : windows) { 
>         window->useCursor(false); 
>         window->setCursor(osgViewer::GraphicsWindow::NoCursor); 
>     } 
>
>
>     viewer->setSceneData(scene); 
>     return viewer->run(); 
> } 
>
>
>
>
> ... 
>
> Thank you! 
>
> Cheers, 
> Anatoly 
>
> ------------------ 
> Read this topic online here: 
> http://forum.openscenegraph.org/viewtopic.php?p=75744#75744 
>
>
>
>
>
> _______________________________________________ 
> osg-users mailing list 
> osg-... at lists.openscenegraph.org <javascript:> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
>

-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/e4739589-3787-4692-accd-1c015a99b627%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200511/6e714654/attachment.html>


More information about the osg-users mailing list