Page 1 of 1

Getting access to a list of ResourceGroups

Posted: Mon Apr 18, 2005 10:21 pm
by pagan
Greetings all,

I just started using OGRE v1.0 [Azathoth] this past week and already I have a couple of questions:

First, I would like to iterate through all the ResourceDeclarations in a ResourceGroup to display them in a sort of resource browser. However I noticed that ResourceGroupManager::getResourceGroup is a protected function. Would it be possible to get public access to a (constant?) ResourceGroup reference? If not, is there another method to get at this resource information?

I already tried ResourceGroupManager::listResourceNames. However this does not provide me with the type of resource the name refers to, or the ResourceGroup it belongs to.

A related question, is there a plan to provide a list of created ResourceGroups that the ResourceGroupManager is aware of? I could keep track of these groups myself of course, but I wouldn't mind if Ogre provided the information it already knows about.

Thanks for your time,
and thank to the Ogre team for all their great work!

- pagan

Posted: Tue Apr 19, 2005 1:32 pm
by sinbad
How's this?

Code: Select all

		/** Get a list of the currently defined resource groups. 
		@note This method intentionally returns a copy rather than a reference in
			order to avoid any contention issues in multithreaded applications.
		@returns A copy of list of currently defined groups.
		*/
		StringVector getResourceGroups(void);
		/** Get the list of resource declarations for the specified group name. 
		@note This method intentionally returns a copy rather than a reference in
			order to avoid any contention issues in multithreaded applications.
		@param groupName The name of the group
		@returns A copy of list of currently defined resources.
		*/
		ResourceDeclarationList getResourceDeclarationList(const String& groupName);
I've committed it, anyway. :) Update on the v1-0 branch to get the implementation.

Posted: Tue Apr 19, 2005 2:24 pm
by pagan
Wow!! Never expected such a quick response =)
That is indeed exactly what I'm looking for. Many thanks!

(If I get anything useful working, I'll be sure to post it here)