Neo
0.5.0
Developer Documentation
|
The Level class contains all scenes and assets that are loaded. More...
#include <Level.h>
Public Member Functions | |
Level (void) | |
~Level (void) | |
void | clear (void) |
void | clearScenes (void) |
FXManager * | getFXManager (void) |
FXRef * | createFX (ShaderRef *vertexShaderRef, ShaderRef *pixelShaderRef) |
DataManager * | getFontManager (void) |
DataManager * | getTextureManager (void) |
DataManager * | getShaderManager (void) |
DataManager * | getSoundManager (void) |
DataManager * | getMeshManager (void) |
DataManager * | getArmatureAnimManager (void) |
DataManager * | getTexturesAnimManager (void) |
DataManager * | getMaterialsAnimManager (void) |
FontRef * | loadFont (const char *filename, unsigned int fontsize=128) |
Loads a font from a file and returns the new FontRef object. More... | |
MeshRef * | loadMesh (const char *filename, const bool preload=true) |
Loads a mesh from a file and returns the new MeshRef object. More... | |
ArmatureAnimRef * | loadArmatureAnim (const char *filename, const bool preload=true) |
TexturesAnimRef * | loadTexturesAnim (const char *filename, const bool preload=true) |
MaterialsAnimRef * | loadMaterialsAnim (const char *filename, const bool preload=true) |
TextureRef * | loadTexture (const char *filename, const bool mipmap=true, const bool preload=true) |
Loads a texture from a file and returns the new TextureRef object. More... | |
SoundRef * | loadSound (const char *filename, const bool preload=true) |
Loads a sound from a file and returns the new SoundRef object. More... | |
ShaderRef * | loadShader (const char *filename, M_SHADER_TYPES type) |
void | sendToUpdateQueue (DataRef *ref) |
Appends a DataRef to the update queue. More... | |
void | sendToClearQueue (DataRef *ref) |
Appends a DataRef to the clear queue. More... | |
void | updateQueueDatas (void) |
Updates all DataRef's in the update queue. More... | |
void | clearQueueDatas (void) |
Clear all DataRef's in the clear queue. More... | |
void | changeCurrentScene (unsigned int id) |
Changes the current scene to the scene with the given ID. More... | |
void | deleteScene (unsigned int id) |
Deletes the scene with the given ID. More... | |
bool | getSceneIndexByName (const char *name, unsigned int *index) |
Retrieves the index of the scene with the given name. More... | |
Scene * | addNewScene (void) |
Creates a new scene and returns a pointer to it. More... | |
Scene * | getSceneByName (const char *name) |
Retrieves the scene with the given name. More... | |
Scene * | getCurrentScene (void) |
Returns the current main scene. More... | |
void | setCurrentSceneId (unsigned int id) |
Changes the current scene. More... | |
void | setCurrentScene (Scene *s) |
unsigned int | getCurrentSceneId (void) |
Returns the current scene ID. More... | |
unsigned int | getScenesNumber (void) |
Returns the number of scenes. More... | |
Scene * | getSceneByIndex (unsigned int id) |
Searches the scene with the given ID. More... | |
Friends | |
class | NeoEngine |
The Level class contains all scenes and assets that are loaded.
When loading a level, all assets like textures, shaders, fonts, sounds and meshes are only loaded once into memory for a maximum of efficiency. As soon as an asset is not used anymore it will be unloaded and the RAM it used will be free'd what allows to clean up during runtime.
Neo::Level::Level | ( | void | ) |
Neo::Level::~Level | ( | void | ) |
Scene* Neo::Level::addNewScene | ( | void | ) |
Creates a new scene and returns a pointer to it.
void Neo::Level::changeCurrentScene | ( | unsigned int | id | ) |
Changes the current scene to the scene with the given ID.
The scene will not change straight away but it will be merely requested to do so in one of the next frames.
id | The new scene ID |
void Neo::Level::clear | ( | void | ) |
void Neo::Level::clearQueueDatas | ( | void | ) |
Clear all DataRef's in the clear queue.
This will call DataRef::clear for every object that is currently in the queue. The queue will be emptied so new requests can be handled.
void Neo::Level::clearScenes | ( | void | ) |
void Neo::Level::deleteScene | ( | unsigned int | id | ) |
Deletes the scene with the given ID.
id | The ID of the scene |
|
inline |
Scene* Neo::Level::getCurrentScene | ( | void | ) |
Returns the current main scene.
|
inline |
Returns the current scene ID.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Searches the scene with the given ID.
Scene* Neo::Level::getSceneByName | ( | const char * | name | ) |
Retrieves the scene with the given name.
name | The name to search for |
bool Neo::Level::getSceneIndexByName | ( | const char * | name, |
unsigned int * | index | ||
) |
Retrieves the index of the scene with the given name.
The ID will be saved into the given pointer.
name | The name to search for |
index | The pointer to an integer to save the ID |
|
inline |
Returns the number of scenes.
|
inline |
|
inline |
|
inline |
|
inline |
ArmatureAnimRef* Neo::Level::loadArmatureAnim | ( | const char * | filename, |
const bool | preload = true |
||
) |
FontRef* Neo::Level::loadFont | ( | const char * | filename, |
unsigned int | fontsize = 128 |
||
) |
Loads a font from a file and returns the new FontRef object.
This method will never return NULL, even if the specified file does not exist or can not be read!
This means you have to ensure the file exists before calling this method!
filename | The path to the file. |
size | The font size to load. |
MaterialsAnimRef* Neo::Level::loadMaterialsAnim | ( | const char * | filename, |
const bool | preload = true |
||
) |
MeshRef* Neo::Level::loadMesh | ( | const char * | filename, |
const bool | preload = true |
||
) |
ShaderRef* Neo::Level::loadShader | ( | const char * | filename, |
M_SHADER_TYPES | type | ||
) |
SoundRef* Neo::Level::loadSound | ( | const char * | filename, |
const bool | preload = true |
||
) |
Loads a sound from a file and returns the new SoundRef object.
This method will never return NULL, even if the specified file does not exist or can not be read!
This means you have to ensure the file exists before calling this method!
filename | The file to load from. |
TextureRef* Neo::Level::loadTexture | ( | const char * | filename, |
const bool | mipmap = true , |
||
const bool | preload = true |
||
) |
Loads a texture from a file and returns the new TextureRef object.
This method will never return NULL, even if the specified file does not exist or can not be read!
This means you have to ensure the file exists before calling this method!
filename | The file to load from. |
mipmap | Indicates if a mip map should be generated for this texture. |
TexturesAnimRef* Neo::Level::loadTexturesAnim | ( | const char * | filename, |
const bool | preload = true |
||
) |
void Neo::Level::sendToClearQueue | ( | DataRef * | ref | ) |
void Neo::Level::sendToUpdateQueue | ( | DataRef * | ref | ) |
|
inline |
void Neo::Level::setCurrentSceneId | ( | unsigned int | id | ) |
Changes the current scene.
id | The ID of the new scene. |
void Neo::Level::updateQueueDatas | ( | void | ) |
Updates all DataRef's in the update queue.
This will call DataRef::update for every object that is currently in the queue. The queue will be emptied so new requests can be handled.
|
friend |