How to properly unload more than one .scheme file

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

czuger
Just popping in
Just popping in
Posts: 17
Joined: Thu Aug 20, 2009 21:02

How to properly unload more than one .scheme file

Postby czuger » Wed May 19, 2010 01:07

Hello,

I have the following:
Multiple scheme files that use Falagard. Below is an outtake of the relevant XML from two of my scheme files. The assumption here is that the correct looknfeel files etc exist.

Contents of "LookA.scheme"

Code: Select all

<?xml version="1.0" ?>
<GUIScheme Name="LookA">
...
<FalagardMapping WindowType="LookA/Button"      TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="LookA/Button" />
...
</GUIScheme>


Contents of "LookB.scheme"

Code: Select all

<?xml version="1.0" ?>
<GUIScheme Name="LookB">
...
<FalagardMapping WindowType="LookB/Button"      TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="LookB/Button" />
...
</GUIScheme>


The problem I have:
As soon as one of these two schemes are unloaded, it goes and destroys the WindowRendererFactory (In my case, "Falagard/Button"), even tho it is still used by another scheme.
Am I using the .schemes incorrectly, or is there some way to tell CEGUI to track references to the factory?

Thnx for any help.

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

Re: How to properly unload more than one .scheme file

Postby CrazyEddie » Wed May 19, 2010 09:45

This is an area where some weaknesses exist, and to be honest, I'm surprised this topic has not come up more often (if it had, we probably would have addressed it already ;)).

Basically none of the options open to you will be ideal. I think the best advice I can give is to suggest that you separate out the "common" parts into a third scheme so that unloading the others does not affect those common definitions.

Sorry not to have been able to give a 'good' solution to this :)

CE.

User avatar
gring
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Mar 18, 2008 09:26
Location: Sweden

Re: How to properly unload more than one .scheme file

Postby gring » Wed May 19, 2010 13:11

One way of looking at the problem is that the lack of skins, hasn't really made the need for mechanics to change it.

Putting my vote on the looknfeel editor aka skineditor and it will bring indirect solutions to these issues too hopefully :wink:

/Gring

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

Re: How to properly unload more than one .scheme file

Postby CrazyEddie » Thu May 20, 2010 08:44

Yeah, this is so true. With any fortune when the editor becomes available later this year we will finally see a load more skins and can start to address the kinds of issues that will throw up :)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests