Brewing-Team / Coffee-Engine

A little game engine brewed for learning how to brew a game engine!
https://brewing-team.github.io/Coffee-Engine/
MIT License
2 stars 0 forks source link

Resource Management Implementation #16

Open mdoradom opened 3 weeks ago

mdoradom commented 3 weeks ago

The Resource Management Structure will consist in the next management structures:

Pseudocode:


// Resource Loader
Ref<T> ResourceLoader::Load(path)
{
    //detect resource type
   if(ResourceRegistry::Exist(resource))
   {
        return resource;
   }
    else
    {
          resource r = ResourceImporter....
          ResourceRegistry::Add(r)
          return r;
    }
}

//Resource Importer

//Check if the imported resource is cached...
//If not cache it and load it
if is cached load the cached file

//Usage Example

        Ref<Texture> a = ResourceLoader::Load<Texture>(path);
HugoPlacer commented 1 week ago

The base of the Resource Management is implemented. Few things that are missing: