Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - marktilbrook

Pages: [1]
1
General / Help with SFML Book
« on: August 21, 2017, 10:27:57 pm »
Hi all,

I am following the SFML Game Development book, however, my C++ knowledge is still average, therefore, I am finding it difficult understanding the ResourceManager part of the section, i was wondering, is it possible to build games without a resource manager and what is the best way to just add sprites and textures. Below is the resourceManager thing im talking about, i just want to try continue with the book by avoiding this but im not sure if thats possible



template <typename Resource, typename Identifier>
class ResourceHolder
{
        public:
                void                                            load(Identifier id, const std::string& filename);

                template <typename Parameter>
                void                                            load(Identifier id, const std::string& filename, const Parameter& secondParam);

                Resource&                                       get(Identifier id);
                const Resource&                         get(Identifier id) const;


        private:
                void                                            insertResource(Identifier id, std::unique_ptr<Resource> resource);


        private:
                std::map<Identifier, std::unique_ptr<Resource>> mResourceMap;
};
 

Pages: [1]