Resource Provider

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Sat Dec 04, 2004 22:43

Yeah I knew about the DataContainer memory leak already, I was more after a general review to see if this is what you envisioned. Good point about the exception memory leak in DefaultResourceProvider::loadRawDataContainer though as I overlooked that.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Sun Dec 05, 2004 00:39

I've uploaded a new version to the patch tracker which should fix those memory leaks.

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

Resource Provider

Postby CrazyEddie » Sun Dec 05, 2004 06:30

...I was more after a general review to see if this is what you envisioned.

Aha :) In that case, yes, this is the kind of thing I had in mind when the idea was first discussed :D

I've uploaded a new version to the patch tracker which should fix those memory leaks.

Yep, everything looks fine now. Thanks :)

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Sun Dec 05, 2004 18:31

Ok I went ahead and committed this initial version + the Linux build for it.

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

Resource Provider

Postby CrazyEddie » Sun Dec 05, 2004 20:02

Right okay. I have now updated the MSVC builds to include the new files.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Tue Dec 07, 2004 02:55

Ok I'm ready to commit the rest of the resource provider changes, but wanted to check something first. With the current system you have to instanciate the appropriate resource provider singleton yourself before you start loading resources. This probably isn't ideal, but it does allow the end user to create their own resource providers if they really want to without the need to use the one that the renderer they are using has instanciated.

One thing that I've just thought of is modifying System to take a ResourceProvider pointer in it's constructor. If this wasn't supplied then System would use the appropriate one supplied by the renderer object.

Another option is just limiting the end user to use the resource provider.

Any thoughts?

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

Resource Provider

Postby CrazyEddie » Tue Dec 07, 2004 09:24

I think the best approach would be to pass a ResourceProvider* in the constructor for System. This would be in keeping with the way the other modules that the user creates are passed in (Renderer and ScriptingModule).

CE.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Tue Dec 07, 2004 14:24

I'll make the appropriate mods. This also means I can do away with the resource provider singleton which is a good thing :)

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

Resource Provider

Postby CrazyEddie » Tue Dec 07, 2004 19:07

Ok. Cool :)

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Wed Dec 08, 2004 02:40

Ahh thats much better. The ResourceProvider is no longer a singleton. Now if you want to get the resource provider you can do System::getSingleton().getResourceProvider().

I've also re-factored System a little so that it can take a ResourceProvider object as a constructor argument (as mentioned before). If one isn't supplied, Renderer::createResourceProvider() (or the overridden version i.e. OgreRenderer::createResourceProvider()) will be called to create the appropriate ResourceProvider object. This way none of the existing renderers need to be modified to use the new resource provider.

I'll do some more tests and probably check the code in tomorrow.

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

Resource Provider

Postby CrazyEddie » Wed Dec 08, 2004 09:31

Sounds great.

The virtual Renderer::createResourceProvider() method will be a nice touch, since it will allow (per-renderer) default replacements of the actual default ResourceProvider in a totally transparent way; the user will not need to worry about such things unless they need something custom built. Very cool :D

CE.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Resource Provider

Postby _mental_ » Thu Dec 09, 2004 04:15

I checked in the modifications above. I also checked in the code to link up the resource loading with the classes that consume the data. So as of now CEGUI loads all external files (except the texture stuff) via the resource provider. Hopefully I haven't missed any :)

The next thing is to modify the texture loading in the OGRE renderer to use the OgreResourceProvider rather than its current method.

[edit]
I just thought of something... my latest check in will cause problems with anyone who uses CEGUI and OGRE. The reason is that all CEGUI related files (scheme, imageset, xsd etc) will be loaded through OGRE rather than from the local directory. All of these types of files will have to be moved into a directory that is in the users resource.cfg

Fortunately it takes 24+ hours for anon CVS to catch up with the developer CVS :)

CE, any chance you could post a sticky about that? I'll post something over on the OGRE forums.
[/edit]

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

Resource Provider

Postby CrazyEddie » Thu Dec 09, 2004 09:30

Okay cool. I'll have a good look at this later :D

I've posted a sticky in the Help forum, and I'll also post an item on the front page.

CE.

User avatar
Spoke
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06
Location: Spain
Contact:

Resource Provider

Postby Spoke » Thu Dec 09, 2004 14:13

Hi guys!

While testing this new functionality I notice that XERCES is again a dependencie for the client code. :?

Any plan no removing it?
May the Force be with you!

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

Resource Provider

Postby CrazyEddie » Thu Dec 09, 2004 14:49

Hi guys!

While testing this new functionality I notice that XERCES is again a dependencie for the client code. :?

Hmmm. I never really though of that :o Is it a major issue? I remember you did all the work before to factor out that dependency :)

Any plan no removing it?

It's complicated by the fact that the resource provider system is making use of templates; which is good because it enables everything to be done in a type safe manner. Removal of the dependancy is possible, though at the moment the only way I see of doing it would leave the system in a less robust state :(

CE.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests