CL_ResourceManagerThe ClanLib resource manager. DescriptionThe resource manager is used to retrieve resources from a given resource source. This can either be a resource script file (used as input to the datafile compiler), or a datafile with all the resources included into one large gzipped resource file. To speedup loading of resources in a game, you can load entire sections of resources at once. When a resource in the section is requested, it is returned instantly without having to access the disk. This is especially useful to make sure all the game resources are loaded before the game is started. Resources are normally not retrieved using the get_resource() function. Instead, you should load the resource using the appropiate resource type class. For instance, a surface is easiest loaded like this: CL_ResourceManager res_manager("my_datafile.dat", true); CL_Surface *my_surface = CL_Res_Surface::load("my_surface", res_manager); Getting the same resource twice won't create a new instance of the resource, but you will still have to clean up the resource after yourself. In other words: If you load a resource twice, you only have to delete it once. Class membersstatic CL_ResourceManager *create( const char *config_file, CL_InputSourceProvider *provider = NULL, bool read_directly_from_source=false, bool delete_inputsource_provider=false) See AlsoNone |