e2d::core::Utilities Class Reference

List of all members.

Detailed Description

Easy2D has a set of subsystems working together to help you run your game application. These subsystems are all singletons, but they may be accessed via these Utilities for convenience. Also, in here are some static methods that were useful inside the engine, and may be useful for your application as well.

Public Member Functions

audio::AudioManagerAudio (void)
 Returns an instance of AudioManager.
core::FpsFps (void)
 Returns an instance of Fps.
KeyboardKeys (void)
 Returns an instance of Keyboard.
core::MouseMouse (void)
 Returns an instance of Mouse.
ResourceMapResources (void)
 Returns an instance of ResourceMap.
graphics::VideoVideo (void)
 Returns an instance of Video.

Static Public Member Functions

static void GetTextFromFile (char **text, const char *filename)
 Reads text from a text file.
static void UnGZip (const char *from, int fromlen, const char *to, int maxlen)
 Decompresses a GZipped string.

Member Function Documentation

void e2d::core::Utilities::GetTextFromFile ( char **  text,
const char *  filename 
) [static]

Reads the whole text file and puts its contents into the char pointer passed as parameter. The resulting string is null-terminated.

text Pointer to char where the contents of the file will be stored.
filename Path to the text file.
Exception if file opening fails.

void e2d::core::Utilities::UnGZip ( const char *  from,
int  fromlen,
const char *  to,
int  maxlen 
) [static]

Inflates a gzip compressed string into another string. The "to" pointer must be already allocated, and you must inform its maximum size in bytes to the decompressing method.

This method uses zlib for decompression.
from Compressed string.
fromlen Compressed string length, in bytes.
to Pointer to decompressed string, must be pre-allocated.
maxlen Decompressed maximum string length, in bytes.
Exception if any decompressing error occurs. See zlib.h for error descriptions.

Generated on Tue Dec 8 10:32:44 2009 for Easy2D by  doxygen 1.5.6