#pragma once #include #include #include #include #include #include namespace dchat { class FailedToLoadResourceException : public std::runtime_error { public: FailedToLoadResourceException(const std::string &errMsg) : std::runtime_error(errMsg) {} }; class ResourceCache { public: // Throws FailedToLoadResourceException on failure static const sf::Font* getFont(const std::string &filepath); // Throws FailedToLoadResourceException on failure static sf::Texture* getTexture(const std::string &filepath); static sf::Shader* getShader(const std::string &filepath, sf::Shader::Type shaderType); static Cache* getCache(); }; }