This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Tortuga/client/surface_manager.hpp
T
2013-05-02 22:45:30 +10:00

29 lines
657 B
C++

#ifndef SURFACEMANAGER_HPP_
#define SURFACEMANAGER_HPP_
#include "SDL/SDL.h"
#include <map>
#include <string>
class SurfaceManager {
public:
SurfaceManager();
~SurfaceManager();
SDL_Surface* Load(std::string key, std::string fname);
SDL_Surface* Reload(std::string key, std::string fname);
SDL_Surface* Get(std::string key);
SDL_Surface* Set(std::string key, SDL_Surface* ptr);
void Free(std::string key);
void FreeAll();
SDL_Surface* operator[](std::string key) { return Get(key); };
private:
SDL_Surface* LoadSurface(std::string key, std::string fname);
typedef std::map<std::string, SDL_Surface*> mapType;
mapType surfaceMap;
};
#endif