本文整理汇总了C++中osg::SimpleSceneManagerRefPtr::mouseButtonRelease方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleSceneManagerRefPtr::mouseButtonRelease方法的具体用法?C++ SimpleSceneManagerRefPtr::mouseButtonRelease怎么用?C++ SimpleSceneManagerRefPtr::mouseButtonRelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::SimpleSceneManagerRefPtr
的用法示例。
在下文中一共展示了SimpleSceneManagerRefPtr::mouseButtonRelease方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouse
// react to mouse button presses
void mouse(int button, int state, int x, int y)
{
if (state)
_mgr->mouseButtonRelease(button, x, y);
else
_mgr->mouseButtonPress(button, x, y);
glutPostRedisplay();
}
示例2: mouse
// react to mouse button presses
void mouse(int button, int state, int x, int y)
{
if(state)
{
mgr->mouseButtonRelease(button, x, y);
switch(button)
{
case 0:
_navigator.buttonRelease(OSG::Navigator::LEFT_MOUSE, x, y);
break;
case 1:
_navigator.buttonRelease(OSG::Navigator::MIDDLE_MOUSE, x, y);
break;
case 2:
_navigator.buttonRelease(OSG::Navigator::RIGHT_MOUSE, x, y);
break;
case 3:
_navigator.buttonRelease(OSG::Navigator::UP_MOUSE, x, y);
break;
case 4:
_navigator.buttonRelease(OSG::Navigator::DOWN_MOUSE, x, y);
break;
}
_mousebuttons &= ~(1 << button);
_lastx = x;
_lasty = y;
}
else
{
mgr->mouseButtonPress(button, x, y);
switch(button)
{
case 0:
_navigator.buttonPress(OSG::Navigator::LEFT_MOUSE, x, y);
break;
case 1:
_navigator.buttonPress(OSG::Navigator::MIDDLE_MOUSE, x, y);
break;
case 2:
_navigator.buttonPress(OSG::Navigator::RIGHT_MOUSE, x, y);
break;
case 3:
_navigator.buttonPress(OSG::Navigator::UP_MOUSE, x, y);
break;
case 4:
_navigator.buttonPress(OSG::Navigator::DOWN_MOUSE, x, y);
break;
}
_mousebuttons |= 1 << button;
_lastx = x;
_lasty = y;
}
glutPostRedisplay();
}