ork::ResourceCompiler Class Reference
[resource]

An XMLResourceLoader that produces compiled resources for a CompiledResourceLoader. More...

#include <ResourceCompiler.h>

Inheritance diagram for ork::ResourceCompiler:
ork::XMLResourceLoader ork::ResourceLoader ork::Object

List of all members.

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< ResourceDescriptorloadResource (const string &name)
 Loads the ResourceDescriptor of the given name.

Detailed Description

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"
    }
};

Constructor & Destructor Documentation

ork::ResourceCompiler::ResourceCompiler ( const string &  resourceFile,
const string &  resourceDataFile 
)

Creates a new ResourceCompiler.

Parameters:
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.


Member Function Documentation

virtual string ork::ResourceCompiler::findResource ( const string &  name  )  [virtual]

Returns the path of the resource of the given name.

Parameters:
name the name of a resource.
Returns:
the path of this resource.
Exceptions:
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.

Parameters:
name the name of the ResourceDescriptor to be loaded.
Returns:
the ResourceDescriptor of the given name, or NULL if the resource is not found.

Reimplemented from ork::XMLResourceLoader.


Generated on Mon Oct 18 09:36:11 2010 for ork by  doxygen 1.6.1