Ocular Engine
Ocular::Core::MultiResource Class Reference

#include <MultiResource.hpp>

Inheritance diagram for Ocular::Core::MultiResource:

Public Member Functions

virtual void addSubResource (Resource *resource, std::string const &name)
virtual ResourcegetSubResource (std::string const &name)
virtual void getSubResourceNames (std::vector< std::string > &names)
virtual void getSubResources (std::vector< Resource * > &resources)
virtual uint32_t getNumSubResources () const
- Public Member Functions inherited from Ocular::Core::Resource
 Resource (File const &source)
virtual void unload ()
virtual void forceLoad ()
File getSourceFile () const
void setSourceFile (File const &file)
void setIsInMemory (bool inMemory)
bool isInMemory () const
void setSize (uint64_t size)
uint64_t getSize () const
ResourceType getResourceType () const
void setName (std::string const &name)
std::string const & getName () const
std::string const & getMappingName () const
void setMappingName (std::string const &name)
ResourceMetadatagetMetadata () const
void setMetadata (ResourceMetadata *metadata)

Protected Attributes

std::unordered_map< std::string, Resource * > m_SubResources
- Protected Attributes inherited from Ocular::Core::Resource
ResourceType m_Type
File m_SourceFile
bool m_IsInMemory
uint64_t m_SizeInMemory
std::string m_Name
std::string m_MappingName

Detailed Description

Certain Resource files (such as OBJ) may define multiple individual resources. To handle this, we have a MultiResource.

The MultiResource describes the individual Resources found within, which can then be retrieved either directly from the MultiResources or via the Resources system.

If retrieving from the Resources system, then the MultiResource can be treated as a folder, with the individual Resources stored inside. For example, if we have an OBJ file named "SomeOBJ" with two meshes stored inside ("pCube1" and "pSphere1"), we can retrieve the individual meshes as follows:


The documentation for this class was generated from the following files: