diff options
Diffstat (limited to 'include/ResourceCache.hpp')
-rw-r--r-- | include/ResourceCache.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/ResourceCache.hpp b/include/ResourceCache.hpp index d35eb8f..256e5a4 100644 --- a/include/ResourceCache.hpp +++ b/include/ResourceCache.hpp @@ -1,13 +1,25 @@ #pragma once #include <SFML/Graphics/Font.hpp> +#include <SFML/Graphics/Texture.hpp> #include <string> +#include <stdexcept> 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 const sf::Texture* getTexture(const std::string &filepath); }; } |