本文整理汇总了C++中DisplayPtr::config方法的典型用法代码示例。如果您正苦于以下问题:C++ DisplayPtr::config方法的具体用法?C++ DisplayPtr::config怎么用?C++ DisplayPtr::config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DisplayPtr
的用法示例。
在下文中一共展示了DisplayPtr::config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: configAddDisplay
/**
* Adds the element to the configuration.
*
* @pre configCanHandle(element) == true
* @post (display of same name already loaded) ==> old display closed, new one opened<br>
* (display is new) ==> (new display is added)<br>
* Draw Manager is notified of the display change.
*/
bool DisplayManager::configAddDisplay(jccl::ConfigElementPtr element)
{
vprASSERT(configCanHandle(element)); // We must be able to handle it first of all
vprDEBUG_BEGIN(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "------- DisplayManager::configAddDisplay -------\n" << vprDEBUG_FLUSH;
// Find out if we already have a window of this name
// If so, then close it before we open a new one of the same name
// This basically allows re-configuration of a window
DisplayPtr cur_disp = findDisplayNamed(element->getName());
if (cur_disp != NULL) // We have an old display
{
vprDEBUG(vrjDBG_DISP_MGR,vprDBG_CONFIG_LVL) << "Removing old window: " << cur_disp->getName().c_str() << vprDEBUG_FLUSH;
closeDisplay(cur_disp,true); // Close the display and notify the draw manager to close the window
}
// --- Add a display (of the correct type) ---- //
if (element->getID() == std::string("display_window")) // Display window
{
DisplayPtr newDisp = Display::create(); // Create the display
newDisp->config(element);
addDisplay(newDisp,true); // Add it
vprDEBUG(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "Adding display: " << newDisp->getName().c_str() << std::endl << vprDEBUG_FLUSH;
vprDEBUG(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "Display: " << newDisp << std::endl << vprDEBUG_FLUSH;
}
vprDEBUG_END(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "------- DisplayManager::configAddDisplay Done. --------\n" << vprDEBUG_FLUSH;
return true;
}