本文整理汇总了C++中WindowEventProducerRefPtr::connectMouseReleased方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowEventProducerRefPtr::connectMouseReleased方法的具体用法?C++ WindowEventProducerRefPtr::connectMouseReleased怎么用?C++ WindowEventProducerRefPtr::connectMouseReleased使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowEventProducerRefPtr
的用法示例。
在下文中一共展示了WindowEventProducerRefPtr::connectMouseReleased方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// Initialize WIN32 & OpenSG and set up the scene
int main(int argc, char **argv)
{
// OSG init
osgInit(argc,argv);
{
// create the scene
NodeRecPtr scene = makeTorus(.5, 2, 16, 16);
//Create a Window object
WindowEventProducerRefPtr TheWindow = createNativeWindow();
//Apply window settings
TheWindow->setUseCallbackForDraw(true);
TheWindow->setUseCallbackForReshape(true);
//TheWindow->setFullscreen(true);
//Initialize Window
TheWindow->initWindow();
commitChanges();
// create the SimpleSceneManager helper
SimpleSceneManager sceneManager;
TheWindow->setDisplayCallback(boost::bind(display, &sceneManager));
TheWindow->setReshapeCallback(boost::bind(reshape, _1, &sceneManager));
// tell the manager what to manage
sceneManager.setWindow(TheWindow);
sceneManager.setRoot (scene);
//Attach to the Mouse Events
TheWindow->connectMouseClicked(boost::bind(mouseClicked, _1));
TheWindow->connectMousePressed(boost::bind(mousePressed, _1, &sceneManager));
TheWindow->connectMouseReleased(boost::bind(mouseReleased, _1, &sceneManager));
TheWindow->connectMouseMoved(boost::bind(mouseMoved, _1, &sceneManager));
TheWindow->connectMouseDragged(boost::bind(mouseDragged, _1, &sceneManager));
TheWindow->connectMouseEntered(boost::bind(mouseEntered, _1));
TheWindow->connectMouseExited(boost::bind(mouseExited, _1));
TheWindow->connectMouseWheelMoved(boost::bind(mouseWheelMoved, _1, &sceneManager));
//Attach to the Key Events
TheWindow->connectKeyPressed(boost::bind(keyPressed, _1));
TheWindow->connectKeyReleased(boost::bind(keyReleased, _1));
TheWindow->connectKeyTyped(boost::bind(keyTyped, _1));
//Attach to the Window Events
TheWindow->connectWindowOpened(boost::bind(windowOpened, _1));
TheWindow->connectWindowClosing(boost::bind(windowClosing, _1));
TheWindow->connectWindowClosed(boost::bind(windowClosed, _1));
TheWindow->connectWindowIconified(boost::bind(windowIconified, _1));
TheWindow->connectWindowDeiconified(boost::bind(windowDeiconified, _1));
TheWindow->connectWindowActivated(boost::bind(windowActivated, _1));
TheWindow->connectWindowDeactivated(boost::bind(windowDeactivated, _1));
TheWindow->connectWindowEntered(boost::bind(windowEntered, _1));
TheWindow->connectWindowExited(boost::bind(windowExited, _1));
//Create the Documentation Foreground and add it to the viewport
SimpleScreenDoc TheSimpleScreenDoc(&sceneManager, TheWindow);
// show the whole scene
sceneManager.showAll();
// show statistics
sceneManager.setStatistics(true);
//Open Window
Vec2f WinSize(TheWindow->getDesktopSize() * 0.85f);
Pnt2f WinPos((TheWindow->getDesktopSize() - WinSize) *0.5);
TheWindow->openWindow(WinPos,
WinSize,
"01 Native Window");
//Enter main loop
TheWindow->mainLoop();
}
osgExit();
return 0;
}