CodePudding user response:
Viewer. AddEventHandler (new osgGA: : StateSetManipulator (viewer. The getCamera () - & gt; GetOrCreateStateSet ()));//window size change event
Viewer. AddEventHandler (new osgViewer: : WindowSizeHandler);
//add some commonly used state
Viewer. AddEventHandler (new osgViewer: : StatsHandler);
//after setting the above, can realize the following functions
//click S will display frame rate
//click W will show the grid
//click F will flow from and to minimize the change of back and forth between
//click on L will show light
================================
Attention to the problem of switch to input method