GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions | Static Public Member Functions | List of all members
gd::ResourcesLoader Class Reference

Class used by games to load resources from files: this is purely an abstraction to most SFML loadFrom* functions. More...

#include <ResourcesLoader.h>

Public Member Functions

void LoadSFMLImage (const gd::String &filename, sf::Image &image)
 
sf::Texture LoadSFMLTexture (const gd::String &filename)
 
void LoadSFMLTexture (const gd::String &filename, sf::Texture &texture)
 
std::pair< sf::Font
*, StreamHolder * > 
LoadFont (const gd::String &filename)
 
sf::SoundBuffer LoadSoundBuffer (const gd::String &filename)
 
gd::String LoadPlainText (const gd::String &filename)
 
char * LoadBinaryFile (const gd::String &filename)
 
long int GetBinaryFileSize (const gd::String &filename)
 

Static Public Member Functions

static ResourcesLoaderGet ()
 
static void DestroySingleton ()
 

Detailed Description

Class used by games to load resources from files: this is purely an abstraction to most SFML loadFrom* functions.

This class is replaced in GDCpp by an equivalent that can load also from memory.

Member Function Documentation

long int gd::ResourcesLoader::GetBinaryFileSize ( const gd::String filename)

Get the size of a file

char * gd::ResourcesLoader::LoadBinaryFile ( const gd::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

std::pair< sf::Font *, StreamHolder * > gd::ResourcesLoader::LoadFont ( const gd::String filename)

Load a SFML Font.

Warning
The function calling LoadFont is the owner of the returned font and buffer (if any): Don't forget to delete them after use.
Returns
A pair containing the loaded font, or NULL if loading failed, and the buffer that need to be kept alive while the font is used (can be NULL if the font was loaded from a file).
gd::String gd::ResourcesLoader::LoadPlainText ( const gd::String filename)

Load a plain text file

sf::Texture gd::ResourcesLoader::LoadSFMLTexture ( const gd::String filename)

Load a SFML texture.

sf::SoundBuffer gd::ResourcesLoader::LoadSoundBuffer ( const gd::String filename)

Load a SFML Sound Buffer


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