1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
class HelloScene : public is::GameDisplay
{
public:
HelloScene(is::GameSystemExtended &gameSysExt):
GameDisplay(gameSysExt, sf::Color::Black /* => scene color*/) {}
void loadResources()
{
// Load font and texture of the engine
// Allows to load system resource (very important never forgot to call him)
// Also allows the scene to use permanent resources (loaded before this line)
GameDisplay::loadParentResources();
// We load a sound that will be global and permanent in all scenes (Throughout the engine)
m_gameSysExt.GRMaddSound("is_engine_is_cool", is::GameConfig::SFX_DIR + "is_engine_is_cool.wav");
// We load these textures (that will only be used in this scene)
GRMaddTexture("sfml", is::GameConfig::SPRITES_DIR + "sfml.png");
GRMaddTexture("sdl_2", is::GameConfig::SPRITES_DIR + "sdl_2.png");
// We load this font (that will only be used in this scene)
GRMaddFont("yeah", is::GameConfig::FONT_DIR + "yeah.ttf");
// Allows the scene to use sound permanent resources ("is_engine_is_cool.wav" and others)
GRMuseGameSystemSound();
GRMdeleteFont("yeah"); // Manual font Removal
}
}; |