I'm new here and started to use CEGUI yesterday. I have read all beginner tutorials and now I want to render one gui window within my engine
Tehrefore I copied the code from the tutorials/samples and successfully rendered a "Hello World" window. As a next step I created a simple LAYOUT file with the layout editor, but wenn I want to add the layout file to my root window I get the following error
Unbehandelte Ausnahme bei 0x773bb727 in Brute-Engine.exe: Microsoft C++-Ausnahme: CEGUI::InvalidRequestException an Speicherposition 0x002fc570..
Here is the code:
Code: Select all
BruteGUI::BruteGUI(void) : m_pGUIRenderer(CEGUI::Direct3D10Renderer::create(BruteGlobals::g_D3DDevice))
{
CEGUI::Direct3D10Renderer &m_pGUIRenderer;
CEGUI::DefaultResourceProvider *m_pGUIResourceProvider;
CEGUI::Window* myRoot;
CEGUI::System::create(m_pGUIRenderer);
m_pGUIResourceProvider = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
m_pGUIResourceProvider->setResourceGroupDirectory("schemes", "../Content/GUI/Schemes/");
m_pGUIResourceProvider->setResourceGroupDirectory("imagesets", "../Content/GUI/Imagesets/");
m_pGUIResourceProvider->setResourceGroupDirectory("fonts", "../Content/GUI/Fonts/");
m_pGUIResourceProvider->setResourceGroupDirectory("layouts", "../Content/GUI/Layouts/");
m_pGUIResourceProvider->setResourceGroupDirectory("looknfeels", "../Content/GUI/Look/");
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::FontManager::getSingleton().create("Commonwealth-10.font");
CEGUI::SchemeManager::getSingleton().create("VanillaSkin.scheme");
CEGUI::System::getSingleton().setDefaultFont( "Commonwealth-10" );
myRoot = CEGUI::WindowManager::getSingleton().createWindow( "DefaultWindow", "root" );
CEGUI::System::getSingleton().setGUISheet( myRoot );
myRoot->addChildWindow (CEGUI::WindowManager::getSingleton().loadWindowLayout ("test1.layout")); // Here I get the error
}
And here is my layout file test1.layout
Code: Select all
<?xml version="1.0" ?>
<GUILayout>
<Window Type="DefaultWindow" Name="root">
<Window Type="VanillaSkin/FrameWindow" Name="testWindow">
<Property Name="UnifiedPosition" Value="{ {0.25, 0}, {0.25, 0} }" />
<Property Name="UnifiedSize" Value="{ {0.5, 0}, {0.5, 0} }" />
<Property Name="Text" Value="Hello World!" />
</Window>
</Window>
</GUILayout>
I hope you can help me, because I really don't know whats wrong with the code.