Beginner needs help with his first Window

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

beuschl
Just popping in
Just popping in
Posts: 2
Joined: Fri Sep 24, 2010 10:51

Beginner needs help with his first Window

Postby beuschl » Fri Sep 24, 2010 10:59

Hi

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.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Beginner needs help with his first Window

Postby Kulik » Fri Sep 24, 2010 11:34

Either catch the exception and tell us what's in it OR post the log.

beuschl
Just popping in
Just popping in
Posts: 2
Joined: Fri Sep 24, 2010 10:51

Re: Beginner needs help with his first Window

Postby beuschl » Fri Sep 24, 2010 12:54

ok good tipp with the exception ;)

At first I got the message, that a Window with the name "root" already exists. Therefore I deleted the line <Window Type="DefaultWindow" Name="root"> of the test1.layout file
Now I get another Exception

GUILayout_xmlHandler::startElement - layout loading has been aborted since no WindowFactory is available for 'VanillaSkin/FrameWindow' objects.

I don't know what to do now. Did I forgot something to intialise?

edit: ok, if I change the code to the TaharezLook instead of the VanillaSkin, everything works fine! But maybe it would be good to know why my posted code doesn't work with the VanillaSkin

IR3uL
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Aug 25, 2010 00:32
Location: Buenos Aires - Argentina

Re: Beginner needs help with his first Window

Postby IR3uL » Fri Sep 24, 2010 15:49

1st: read this http://www.cegui.org.uk/phpBB2/viewtopic.php?f=10&t=3351

2nd: Can you post the log?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Beginner needs help with his first Window

Postby CrazyEddie » Mon Sep 27, 2010 13:06

The window type is 'Vanilla/FrameWindow' not 'VanillaSkin/FrameWindow'.

CE


Return to “Help”

Who is online

Users browsing this forum: No registered users and 10 guests