OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

How to hide mouse cursor?


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Ligvest (Anatoly Dovzhik)
Newbie


Joined: 27 Mar 2019
Posts: 7

PostPosted: Thu Mar 28, 2019 1:40 pm    Post subject:
How to hide mouse cursor?
Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ligvest (Anatoly Dovzhik)
Newbie


Joined: 27 Mar 2019
Posts: 7

PostPosted: Mon Apr 01, 2019 7:10 am    Post subject:
Reply with quote

Ok. I inherited my manipulator class from osgGA::StandardManipulator and overrided method virtual void home(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
like this:
Code:
void FreeCameraManipulator::home(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us)
{
    std::vector<osgViewer::GraphicsWindow*> windows;
    dynamic_cast<osgViewer::Viewer*>(&us)->getWindows(windows);
    for(osgViewer::GraphicsWindow* window : windows){
        window->useCursor(false);
    }
}


And now it works!
Cheers,
Anatoly
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Custom cursor problem? tom General 7 Wed Sep 18, 2019 4:44 pm View latest post
No new posts Different views hide/show different n... icf80 General 13 Wed Apr 17, 2019 9:56 am View latest post
No new posts Mouse Events are impossible to work with Steal General 0 Fri Mar 15, 2019 4:02 pm View latest post
No new posts show mouse cursor in embedded osg Meldryt General 1 Thu Feb 28, 2019 5:13 pm View latest post
No new posts Qt not passing mouse to callbacks bclay General 0 Fri Feb 22, 2019 3:04 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP