本文整理汇总了C++中ogre::RenderWindow::destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderWindow::destroy方法的具体用法?C++ RenderWindow::destroy怎么用?C++ RenderWindow::destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::RenderWindow
的用法示例。
在下文中一共展示了RenderWindow::destroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeRenderWindow
Ogre::RenderWindow* RenderSystem::makeRenderWindow( intptr_t window_id, unsigned int width, unsigned int height )
{
static int windowCounter = 0; // Every RenderWindow needs a unique name, oy.
Ogre::NameValuePairList params;
Ogre::RenderWindow *window = NULL;
std::stringstream window_handle_stream;
window_handle_stream << window_id;
#ifdef Q_OS_MAC
params["externalWindowHandle"] = window_handle_stream.str();
#else
params["parentWindowHandle"] = window_handle_stream.str();
#endif
params["externalGLControl"] = true;
// Set the macAPI for Ogre based on the Qt implementation
#ifdef QT_MAC_USE_COCOA
params["macAPI"] = "cocoa";
params["macAPICocoaUseNSView"] = "true";
#else
params["macAPI"] = "carbon";
#endif
std::ostringstream stream;
stream << "OgreWindow(" << windowCounter++ << ")";
// don't bother trying stereo if Ogre does not support it.
#if !OGRE_STEREO_ENABLE
force_no_stereo_ = true;
#endif
// attempt to create a stereo window
bool is_stereo = false;
if (!force_no_stereo_)
{
params["stereoMode"] = "Frame Sequential";
window = tryMakeRenderWindow( stream.str(), width, height, ¶ms, 100);
params.erase("stereoMode");
if (window)
{
#if OGRE_STEREO_ENABLE
is_stereo = window->isStereoEnabled();
#endif
if (!is_stereo)
{
// Created a non-stereo window. Discard it and try again (below)
// without the stereo parameter.
ogre_root_->detachRenderTarget(window);
window->destroy();
window = NULL;
stream << "x";
is_stereo = false;
}
}
}
if ( window == NULL )
{
window = tryMakeRenderWindow( stream.str(), width, height, ¶ms, 100);
}
if( window == NULL )
{
ROS_ERROR( "Unable to create the rendering window after 100 tries." );
assert(false);
}
if (window)
{
window->setActive(true);
//window->setVisible(true);
window->setAutoUpdated(false);
}
stereo_supported_ = is_stereo;
ROS_INFO_ONCE("Stereo is %s", stereo_supported_ ? "SUPPORTED" : "NOT SUPPORTED");
return window;
}