Load GUI from XML
This commit is contained in:
28
ImageProvider.hh
Normal file
28
ImageProvider.hh
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef __OPENGLPLAYGROUND_IMAGEPROVIDER_HH__
|
||||
#define __OPENGLPLAYGROUND_IMAGEPROVIDER_HH__
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#include "common.hh"
|
||||
#include "Singleton.hh"
|
||||
|
||||
class ImageProvider : public Singleton<ImageProvider> {
|
||||
private:
|
||||
ImageProvider();
|
||||
friend class Singleton<ImageProvider>;
|
||||
|
||||
public:
|
||||
SDL_Surface* getImage(std::string const& name);
|
||||
|
||||
void cleanup();
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, SDLSurfaceUPtr> imageCache_;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user