Page 1 of 1

IResourceSystem

Posted: 07 Apr 2015, 23:55
by Rick
I'm looking at some older code and I find this line but it says there is no IResourceSystem:
Noesis::Core::Ptr<Noesis::Resource::ResourceProvider> provider = *new Noesis::Resource::LocalResourceProvider(path.c_str());

// errors on this line	
NsGetSystem<Noesis::Resource::IResourceSystem>()->AddProvider(provider.GetPtr());

What would be the new way to do this?

Re: IResourceSystem

Posted: 08 Apr 2015, 00:34
by jsantos
Hi!

In noesisGUI v1.2 we have simplified our API. Now all the integrating functionality is inside the NoesisGUI.h file. The functions you are looking for are:
/// Adds a local directory to the list of providers used to load resources
NS_GUI_CORE_API void AddResourceProvider(const NsChar* rootFolder);

/// Adds a custom provider to the list of providers used to load resources
NS_GUI_CORE_API void AddResourceProvider(Resource::IResourceProvider* provider);
Also, in v1.2, our API is exposed in a single file (that you should use as a precompiled header) inside a single namespace:
#include <NoesisGUI.h>
using namespace Noesis;
Including that way, your function would be Noesis::GUI::AddResourceProvider

All this information is detailed in our Integration Tutorial (source code included).

Cheers.

Re: IResourceSystem

Posted: 08 Apr 2015, 02:20
by Rick
Thank you this helped!