#include <resourcepool.h>
Lilith pre-loads all its resources and expects them to not be deleted for the duration of the engine object. You may created resources "on demand", add them to the pool, and use them. But be *very* careful deleted a resource if you do this. Lilith does not lock or use "shaded pointers" to manage the resources.
The correct order of initialization and deletion:
Public Member Functions | |
| void | SetImportPath (const std::string &path) |
| Set a relative or absolute path the will be appended to *all* future load calls. | |
| bool | LoadRequiredAssets () |
| Load all the assets Lilith requires to run. | |
| const Texture * | LoadTexture (const std::string &filename, const std::string &textureName, int textureId=0, int flags=0) |
| const Texture * | GetTexture (const std::string &textureName, U32 textureId) |
| StaticResource * | LoadStaticRes (const std::string &filename, const std::string &name, U32 flags) |
| MD2Resource * | LoadMD2Res (const std::string &name, const std::string &md2MeshFilename, const std::string &skinTextureFilename, const std::string &md2WeaponFilename, const std::string &weaponTextureFilename) |
| const StaticResource * | GetStaticRes (const std::string &name) |
| Get a pointer to a static mesh resource. | |
| const MD2Resource * | GetMD2Res (const std::string &name) |
| Get a pointer to an MD2 animation resource. | |
| const Texture* lilith3d::ResourcePool::LoadTexture | ( | const std::string & | filename, | |
| const std::string & | textureName, | |||
| int | textureId = 0, |
|||
| int | flags = 0 | |||
| ) | [inline] |
Loads a single 2D textures, with all the options.
| filename | Filename of the texture | |
| textureName | String part of the name. | |
| textureId | Integer part of the name. (Usually 0). | |
| flags | NO_MIPMAP, EMITS_LIGHT |
| const Texture* lilith3d::ResourcePool::GetTexture | ( | const std::string & | textureName, | |
| U32 | textureId | |||
| ) | [inline] |
Query for a texture.
| textureName | String part of the name. | |
| textureId | Integer part of the name. |
| StaticResource* lilith3d::ResourcePool::LoadStaticRes | ( | const std::string & | filename, | |
| const std::string & | name, | |||
| U32 | flags | |||
| ) | [inline] |
Load a static mesh resource.
| filename | filename | |
| name | name to give the resource | |
| flags | SMOOTH_SHADING if the model should be smooth shaded at all vertices, else 0 for hard shading |
| MD2Resource* lilith3d::ResourcePool::LoadMD2Res | ( | const std::string & | name, | |
| const std::string & | md2MeshFilename, | |||
| const std::string & | skinTextureFilename, | |||
| const std::string & | md2WeaponFilename, | |||
| const std::string & | weaponTextureFilename | |||
| ) | [inline] |
Load an MD2 animation resource.
| name | Name of the MD2 resource | |
| md2MeshFilename | Filename of the .md2 mesh file for the main mesh. | |
| skinTextureFilename | Filename of the skin texture. (.bmp, .pcx, .tga, etc.) | |
| md2WeaponFilename | Filename of the .md2 file for the weapon | |
| weaponTextureFilename | Filename of the weapon texture. (.bmp, .pcx, .tga, etc.) |
1.5.1-p1