#ifndef TEXTUREMANAGER_H_INCLUDED
#define TEXTUREMANAGER_H_INCLUDED

#include "Engine.h"

//Class to manage game textures
class cTextureManager
{
    private:
    protected:
    public:
       std::vector<SDL_Surface*> m_Surfaces;

       ~cTextureManager()
       {
         //Clear the list
         for (unsigned int indx = 0; indx < m_Surfaces.size(); indx++)
            SDL_FreeSurface(m_Surfaces[indx]);
       }

       SDL_Surface* loadSurface(std::string Filename)
       {
         SDL_Surface *Tmp = SDL_LoadBMP(Filename.c_str());
         SDL_Surface* bmp = NULL;

         if(Tmp)
         {
            bmp = SDL_DisplayFormat(Tmp);
            SDL_FreeSurface(Tmp);

             if(bmp)
                m_Surfaces.push_back(bmp);
         }

         return bmp;
       }
};

#endif // TEXTUREMANAGER_H_INCLUDED
