本文整理汇总了C++中cegui::WindowManager::loadLayoutFromContainer方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowManager::loadLayoutFromContainer方法的具体用法?C++ WindowManager::loadLayoutFromContainer怎么用?C++ WindowManager::loadLayoutFromContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::WindowManager
的用法示例。
在下文中一共展示了WindowManager::loadLayoutFromContainer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memBuffer
bool
CFormBackendImp::LoadLayout( GUCEF::CORE::CIOAccess& layoutStorage )
{GUCEF_TRACE;
CEGUI::Window* rootWindow = NULL;
CEGUI::WindowManager* wmgr = CEGUI::WindowManager::getSingletonPtr();
GUCEF_DEBUG_LOG( 0, "Starting layout load for a GUI Form" );
try
{
CORE::CDynamicBuffer memBuffer( layoutStorage );
CEGUI::RawDataContainer container;
container.setData( (CEGUI::uint8*) memBuffer.GetBufferPtr() );
container.setSize( (size_t) memBuffer.GetDataSize() );
rootWindow = wmgr->loadLayoutFromContainer( container );
container.setData( (CEGUI::uint8*) NULL );
container.setSize( (size_t) 0 );
}
catch ( CEGUI::Exception& e )
{
GUCEF_ERROR_LOG( 0, CString( "CEGUI Exception while attempting to load form layout: " ) + e.what() );
return false;
}
// Now that we completed loading lets see what we got from CEGUI
if ( NULL != rootWindow )
{
// Begin by providing a wrapper for the root window
m_rootWindow = CreateAndHookWrapperForWindow( rootWindow );
if ( NULL != m_rootWindow )
{
CString localWidgetName = m_rootWindow->GetName().SubstrToChar( '/', false );
m_widgetMap[ localWidgetName ] = m_rootWindow;
WrapAndHookChildWindows( rootWindow );
// We will directly add the form as a child of the root for now
// Note: This assumes that you have a GUISheet already set, otherwise this will result in a segfault!
CEGUI::Window* globalRootWindow = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow();
if ( NULL != globalRootWindow )
{
globalRootWindow->addChild( rootWindow );
GUCEF_DEBUG_LOG( 0, "Successfully loaded a GUI Form layout" );
return true;
}
else
{
GUCEF_ERROR_LOG( 0, "Failed to add form as a child to the global \"root\" window" );
}
}
rootWindow->hide();
}
GUCEF_DEBUG_LOG( 0, "Failed to load a GUI Form layout" );
return false;
}