An XMLResourceLoader that produces compiled resources for a CompiledResourceLoader. More...
#include <ResourceCompiler.h>
Public Member Functions | |
ResourceCompiler (const string &resourceFile, const string &resourceDataFile) | |
Creates a new ResourceCompiler. | |
virtual | ~ResourceCompiler () |
Deletes this ResourceCompiler. | |
virtual string | findResource (const string &name) |
Returns the path of the resource of the given name. | |
virtual ptr< ResourceDescriptor > | loadResource (const string &name) |
Loads the ResourceDescriptor of the given name. |
An XMLResourceLoader that produces compiled resources for a CompiledResourceLoader.
This class concatenates and stores the resources it loads into two files. The first file contains source code that builds the XML descriptors of the resources. The second file contains the resource data (shader source code, texture data, mesh data, etc). The first file can be included in the source code of a CompiledResourceLoader subclass, and the second file can be passed as argument to the constructor of this subclass:
class MyResourceLoader : public CompiledResourceLoader { public: MyResourceLoader(const string &resourceDataFile) : CompiledResourceLoader(resourceDataFile) { #include "resourceFile" } };
ork::ResourceCompiler::ResourceCompiler | ( | const string & | resourceFile, | |
const string & | resourceDataFile | |||
) |
Creates a new ResourceCompiler.
resourceFile | the file that will contain the source code to build the XML descriptors of the loaded resources. | |
resourceDataFile | the file that will contain the data of the loaded resources. |
virtual ork::ResourceCompiler::~ResourceCompiler | ( | ) | [virtual] |
Deletes this ResourceCompiler.
virtual string ork::ResourceCompiler::findResource | ( | const string & | name | ) | [virtual] |
Returns the path of the resource of the given name.
name | the name of a resource. |
exception | if the resource is not found. |
Reimplemented from ork::XMLResourceLoader.
virtual ptr<ResourceDescriptor> ork::ResourceCompiler::loadResource | ( | const string & | name | ) | [virtual] |
Loads the ResourceDescriptor of the given name.
name | the name of the ResourceDescriptor to be loaded. |
Reimplemented from ork::XMLResourceLoader.