Game Develop Core: RessourcesLoader.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
RessourcesLoader.h
Go to the documentation of this file.
1
6 #ifndef RESSOURCESLOADER_H
7 #define RESSOURCESLOADER_H
8 class Music;
9 #include <SFML/Graphics.hpp>
10 #include <SFML/Audio.hpp>
11 #include <string>
12 #undef LoadImage //Undef macro from windows.h
13
14 namespace gd
15 {
16
23 class GD_CORE_API RessourcesLoader
24 {
25 public:
26
30 sf::Texture * LoadSFMLTexture( const std::string & filename );
31
35 sf::Font * LoadFont( const std::string & filename );
36
40 sf::SoundBuffer LoadSoundBuffer( const std::string & filename );
41
45 std::string LoadPlainText( const std::string & filename );
46
52 char* LoadBinaryFile( const std::string & filename );
53
57 long int GetBinaryFileSize( const std::string & filename);
58
59 static RessourcesLoader *GetInstance()
60 {
61 if ( NULL == _singleton )
62 {
63 _singleton = new RessourcesLoader;
64 }
65
66 return ( static_cast<RessourcesLoader*>( _singleton ) );
67 }
68
69 static void DestroySingleton()
70 {
71 if ( NULL != _singleton )
72 {
73 delete _singleton;
74 _singleton = NULL;
75 }
76 }
77 private:
78 RessourcesLoader() {};
79 virtual ~RessourcesLoader() {};
80
81 static RessourcesLoader *_singleton;
82 };
83
84
85 }
86 #endif // RESSOURCESLOADER_H