ork::ResourceDescriptor Class Reference
[resource]

A resource descriptor, contains all the data to create an actual Resource. More...

#include <ResourceDescriptor.h>

Inheritance diagram for ork::ResourceDescriptor:
ork::Object

List of all members.

Public Member Functions

 ResourceDescriptor (const TiXmlElement *descriptor, unsigned char *data, unsigned int size)
 Creates a new resource descriptor.
virtual ~ResourceDescriptor ()
 Deletes this resource descriptor.
unsigned char * getData () const
 Returns the ASCII or binary data part of this resource descriptor.
unsigned int getSize () const
 Returns the size in bytes of the ASCII or binary data part of this resource descriptor.
virtual void clearData ()
 Deletes the ASCII or binary data part of this resource descriptor.

Public Attributes

const TiXmlElement * descriptor
 The XML part of this resource descriptor.

Detailed Description

A resource descriptor, contains all the data to create an actual Resource.

This data is described with an XML element and with an optional ASCII or binary data section. For example, for a texture, the XML part describes the texture options (internal format, min and mag filter, min and max LOD, etc), while the binary data part contains the texture data itself. For a shader the XML part describes default values for the shader uniforms, while the binary data part contains the shader source code. And so on for other resources.


Constructor & Destructor Documentation

ork::ResourceDescriptor::ResourceDescriptor ( const TiXmlElement *  descriptor,
unsigned char *  data,
unsigned int  size 
)

Creates a new resource descriptor.

Parameters:
descriptor the XML part of this resource descriptor.
data the ASCII of binary data part of the descriptor.
size the size of the ASCII or binary part in bytes.
virtual ork::ResourceDescriptor::~ResourceDescriptor (  )  [virtual]

Deletes this resource descriptor.

This deletes both the XML and the binary data part.


Member Function Documentation

virtual void ork::ResourceDescriptor::clearData (  )  [virtual]

Deletes the ASCII or binary data part of this resource descriptor.

unsigned char* ork::ResourceDescriptor::getData (  )  const

Returns the ASCII or binary data part of this resource descriptor.

unsigned int ork::ResourceDescriptor::getSize (  )  const

Returns the size in bytes of the ASCII or binary data part of this resource descriptor.


Member Data Documentation

The XML part of this resource descriptor.

This part can describe optional elements that cannot be stored in the resource itself, such as the internal format for a texture, default uniform values for a shader, etc. The tag of the descriptor is the type of the resource (e.g. texture1D, texture2D, shader, program, mesh, etc).


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