Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
graphite/engine/assets/include/asset.hpp

56 lines
825 B
C++
Raw Permalink Normal View History

2024-01-03 16:05:02 -05:00
#pragma once
#include <vector>
#include <string>
#include <typeindex>
class Renderer;
class Asset
{
public:
virtual ~Asset() {}
virtual void Load(Renderer*) {}
virtual void Unload(Renderer*) {}
virtual std::vector<int> GetDependencies()
{
return std::vector<int>();
}
void SetParent(Asset* asset)
{
m_parentAsset = asset;
}
Asset* GetParent() const
{
return m_parentAsset;
}
virtual std::type_index GetType()
{
return typeid(Asset);
}
bool IsLoaded()
{
return m_loaded;
}
virtual std::string GetName()
{
return std::string();
}
virtual std::string GetPath()
{
return std::string();
}
protected:
Asset* m_parentAsset = nullptr;
bool m_loaded = false;
};