-
-// Resource Types
-
-/**
- * Extendable set of resource types
- */
-enum ResourceTypeId
-{
- ResourceBitmap,
- ResourceNativeImage,
- ResourceTargetImage,
- ResourceShader,
- ResourceMesh
-};
-
-/**
- * The abstract base class for resource types.
- */
-struct ResourceType
-{
- /**
- * Constructor.
- * @param[in] typeId resource type id
- */
- ResourceType(ResourceTypeId typeId)
- : id(typeId) {}
-
- /**
- * Destructor.
- */
- virtual ~ResourceType() {}
-
- /**
- * Create a copy of the resource type with the same attributes.
- * @return pointer to the new ResourceType.
- */
- virtual ResourceType* Clone() const = 0;
-
- const ResourceTypeId id;
-
-private:
-
- // Undefined copy constructor.
- ResourceType(const ResourceType& typePath);
-
- // Undefined assignment operator.
- ResourceType& operator=(const ResourceType& rhs);
-};
-
-/**
- * BitmapResourceType describes a bitmap resource, which can be requested
- * from ResourceLoader::LoadResource() or AllocateBitmapImage.
- */
-struct BitmapResourceType : public ResourceType
-{
- /**
- * Constructor.
- * @param[in] attribs parameters for image loading request
- */
- BitmapResourceType(const ImageAttributes& attribs)
- : ResourceType(ResourceBitmap),
- imageAttributes(attribs) {}
-
- /**
- * Destructor.
- */
- virtual ~BitmapResourceType() {}
-
- /**
- * @copydoc ResourceType::Clone
- */
- virtual ResourceType* Clone() const
- {
- return new BitmapResourceType(imageAttributes);
- }
-
- /**
- * Attributes are copied from the request.
- */
- ImageAttributes imageAttributes;
-
-private:
-
- // Undefined copy constructor.
- BitmapResourceType(const BitmapResourceType& typePath);
-
- // Undefined assignment operator.
- BitmapResourceType& operator=(const BitmapResourceType& rhs);
-};
-