Game Develop C++ Platform: gd::RessourcesLoader Class Reference

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
gd::RessourcesLoader Class Reference
Resources management

Class that is used by games to load resources from an Game Develop Executable ( DatFile ) or from an external file. More...

`#include <RessourcesLoader.h>`

## Public Member Functions

sf::Texture * | LoadSFMLTexture (const std::string &filename)
sf::Font * | LoadFont (const std::string &filename)
sf::SoundBuffer | LoadSoundBuffer (const std::string &filename)
std::string | LoadPlainText (const std::string &filename)
char * | LoadBinaryFile (const std::string &filename)
long int | GetBinaryFileSize (const std::string &filename)
bool | HasFile (const std::string &filename)
bool | SetResourceFile (const string &filename)

## Static Public Member Functions

static RessourcesLoader * | GetInstance ()
static void | DestroySingleton ()

## Detailed Description

Class that is used by games to load resources from an Game Develop Executable ( DatFile ) or from an external file.

## Member Function Documentation

long int gd::RessourcesLoader::GetBinaryFileSize | ( | const std::string & | filename) |  |

Get the size of a file

bool gd::RessourcesLoader::HasFile | ( | const std::string & | filename) |  |

Check if a file is present inside resource file.

Returns
  true if filename can be found inside resourcefile.

char * gd::RessourcesLoader::LoadBinaryFile | ( | const std::string & | filename) |  |

Get a buffer for file. Be careful, the buffer will be invalided by any subsequent call to Load[Something]. Make a copy of the buffer if you want it to stay alive longer.

Load a binary text file

sf::Font * gd::RessourcesLoader::LoadFont | ( | const std::string & | filename) |  |

Load a SFML Font

std::string gd::RessourcesLoader::LoadPlainText | ( | const std::string & | filename) |  |

Load a plain text file

sf::Texture * gd::RessourcesLoader::LoadSFMLTexture | ( | const std::string & | filename) |  |

Load a SFML image

sf::SoundBuffer gd::RessourcesLoader::LoadSoundBuffer | ( | const std::string & | filename) |  |

Load a SFML Sound Buffer

bool gd::RessourcesLoader::SetResourceFile | ( | const string & | filename) |  |

Set the name of the resource file to be open.

Returns
  true if file was successfully opened.

The documentation for this class was generated from the following files:

- RessourcesLoader.h
- RessourcesLoader.cpp