libgui/include/resources/Resources.h

34 lines
819 B
C
Raw Normal View History

2017-10-29 10:28:14 +01:00
#ifndef RECOURCES_H_
#define RECOURCES_H_
#include <map>
2018-06-21 20:44:58 +02:00
#include <stdint.h>
2017-10-29 10:28:14 +01:00
//! forward declaration
class GuiImageData;
class GuiSound;
2018-06-21 20:44:58 +02:00
class Resources {
2017-10-29 10:28:14 +01:00
public:
static void Clear();
static bool LoadFiles(const char * path);
2018-06-21 20:44:58 +02:00
static const uint8_t * GetFile(const char * filename);
static uint32_t GetFileSize(const char * filename);
2017-10-29 10:28:14 +01:00
static GuiImageData * GetImageData(const char * filename);
static void RemoveImageData(GuiImageData * image);
static GuiSound * GetSound(const char * filename);
static void RemoveSound(GuiSound * sound);
private:
static Resources *instance;
Resources() {}
~Resources() {}
2018-06-21 20:44:58 +02:00
std::map<std::string, std::pair<uint32_t, GuiImageData *> > imageDataMap;
std::map<std::string, std::pair<uint32_t, GuiSound *> > soundDataMap;
2017-10-29 10:28:14 +01:00
};
#endif