Code: Select all
CEGUI::System::getSingleton().renderGUI()
Moderators: CEGUI MVP, CEGUI Team
Code: Select all
CEGUI::System::getSingleton().renderGUI()
Code: Select all
CEGUI::Direct3D9Renderer::bootstrapSystem(m_pDirect3DDevice);
// initialise the required dirs for the DefaultResourceProvider
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "datafiles/schemes/");
rp->setResourceGroupDirectory("imagesets", "datafiles/imagesets/");
rp->setResourceGroupDirectory("fonts", "datafiles/fonts/");
rp->setResourceGroupDirectory("layouts", "datafiles/layouts/");
rp->setResourceGroupDirectory("looknfeels", "datafiles/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", "datafiles/lua_scripts/");
// set the default resource groups to be used
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
// load in the scheme file, which auto-loads the TaharezLook imageset
CEGUI::SchemeManager::getSingleton().create( "TaharezLook.scheme" );
// load in a font. The first font loaded automatically becomes the default font.
CEGUI::FontManager::getSingleton().create( "DejaVuSans-10.font" );
CEGUI::System::getSingleton().setDefaultFont( "DejaVuSans-10" );
CEGUI::System::getSingleton().setDefaultMouseCursor( "TaharezLook", "MouseArrow" );
m_wndRoot = CEGUI::WindowManager::getSingleton().loadWindowLayout( "submarine.layout" );
CEGUI::System::getSingleton().setGUISheet( m_wndRoot );
//CEGUI::System::getSingleton().getGUISheet()->hide();
//subscribing events here
Code: Select all
m_pDirect3DDevice->BeginScene();
//drawing all objects here
// draw GUI
CEGUI::System::getSingleton().renderGUI();
m_pDirect3DDevice->EndScene();
Code: Select all
<Window Type="DefaultWindow" Name="wndRoot" >
<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
<Property Name="Alpha" Value="0" />
<Property Name="AlwaysOnTop" Value="False" />
<Window Type="TaharezLook/FrameWindow" Name="wndMenu" >
<Property Name="InheritsAlpha" Value="False" />
<Property Name="Visible" Value="True" />
<Property Name="Font" Value="DejaVuSans-10" />
<Property Name="AlwaysOnTop" Value="True" />
<Property Name="TitlebarFont" Value="DejaVuSans-10" />
<Property Name="RollUpEnabled" Value="False" />
<Property Name="TitlebarEnabled" Value="True" />
<Property Name="UnifiedPosition" Value="{ {0.25, 0}, {0.25, 0} }" />
<Property Name="UnifiedSize" Value="{ {0.5, 0}, {0.5, 0} }" />
<Property Name="DragMovingEnabled" Value="False" />
<Property Name="CloseButtonEnabled" Value="False" />
//some other subwindows
</Window>
</Window>
CrazyEddie wrote:CEGUI does not save and restore the D3D states, so you should do that around the call the System::renderGUI.
CE.
Code: Select all
//check device
bool ret = true;
switch(m_pDirect3DDevice->TestCooperativeLevel())
{
case D3DERR_DEVICELOST:
ret = false;
break;
case D3DERR_DEVICENOTRESET:
{
m_font->OnLostDevice();
//reset device
if(FAILED(m_pDirect3DDevice->Reset(&m_PresentParameters)))
{
assert(false);
SMCLog::DebugPrint("[GUI]","Reset() failed!");
ret = false;
break;
}
//init scene again
InitScene();
m_font->OnResetDevice();
}
break;
}
return ret;
Users browsing this forum: No registered users and 16 guests