Page 1 of 1

Give example of connection of CEGUI 0.8.4 to SDL 2

Posted: Mon Mar 23, 2015 07:56
by temakonkin
Hi!
Give example of connection of CEGUI 0.8.4 to SDL 2 (C++)

Thanks!

Re: Give example of connection of CEGUI 8.4 to SDL 2

Posted: Mon Mar 23, 2015 09:32
by lucebac

Re: Give example of connection of CEGUI 8.4 to SDL 2

Posted: Tue Mar 24, 2015 12:21
by georger
lucebac wrote:https://bitbucket.org/lucebac/cegui/src/ea8f8c814a4d5dbaa56344218659eb68ce173961/application_templates/SDL2.cpp?at=application-templates-devel

In line 215 the program tries to load application_templates.layout, which isn't shipped in datafiles/layouts/ in the source distribution.

SDL2.cpp

Code: Select all

Window* root = WindowManager::getSingleton().loadLayoutFromFile("application_templates.layout");


I found the example basic layout from the documentation of 0.8.5, copied and pasted it into datafiles/layouts/application_templates.layout, and tried it with the program - ran flawlessly. So, here it is for convenience:

datafiles/layouts/application_templates.layout

Code: Select all

<?xml version="1.0" ?>
<GUILayout version="4">
    <Window type="DefaultWindow" name="root">
        <Window type="TaharezLook/FrameWindow" name="testWindow">
            <Property name="Position" value="{ {0.25, 0}, {0.25, 0} }" />
            <Property name="Size" value="{ {0.5, 0}, {0.5, 0} }" />
            <Property name="Text" value="Hello World!" />
        </Window>
    </Window>
</GUILayout>

Re: Give example of connection of CEGUI 8.4 to SDL 2

Posted: Tue Mar 24, 2015 12:28
by Ident
georger wrote:
lucebac wrote:https://bitbucket.org/lucebac/cegui/src/ea8f8c814a4d5dbaa56344218659eb68ce173961/application_templates/SDL2.cpp?at=application-templates-devel

In line 215 the program tries to load application_templates.layout, which isn't shipped in datafiles/layouts/ in the source distribution.

Thanks for the note.
Lucebac created these awesome application template and it has not been finished yet, I guess he forgot to commit that file. I commented on the line of the code that loads this file, just like you said. Here is his PR which is based on the above linked repository:
https://bitbucket.org/cegui/cegui/pull- ... s-for/diff

You can directly comment on there in the code section if you find other issues or if you have improvements.

Re: Give example of connection of CEGUI 0.8.4 to SDL 2

Posted: Wed Mar 25, 2015 14:55
by temakonkin
Hi!

When compiled produces such a bug

Code: Select all

fatal error: CEGUI/Config.h: No such file or directory


Code::Blocks IDE, GNU GCC compiller....

What do I do?

Re: Give example of connection of CEGUI 0.8.4 to SDL 2

Posted: Wed Mar 25, 2015 15:01
by Ident
Follow forum guidelines first http://www.cegui.org.uk/phpBB2/viewtopi ... =10&t=3351
or I wont answer

Re: Give example of connection of CEGUI 0.8.4 to SDL 2

Posted: Wed Mar 25, 2015 15:16
by lucebac
You missed to set up CEGUI SDK properly.