Safe Haskell | None |
---|
- new :: IO HG3DClass
- delete :: HG3DClass -> IO ()
- createResourceGroup :: HG3DClass -> String -> Bool -> IO ()
- initialiseAllResourceGroups :: HG3DClass -> IO ()
- initialiseResourceGroup :: HG3DClass -> String -> IO ()
- prepareResourceGroup :: HG3DClass -> String -> Bool -> Bool -> IO ()
- loadResourceGroup :: HG3DClass -> String -> Bool -> Bool -> IO ()
- unloadResourceGroup :: HG3DClass -> String -> Bool -> IO ()
- unloadUnreferencedResourcesInGroup :: HG3DClass -> String -> Bool -> IO ()
- clearResourceGroup :: HG3DClass -> String -> IO ()
- destroyResourceGroup :: HG3DClass -> String -> IO ()
- isResourceGroupInitialised :: HG3DClass -> String -> IO Bool
- isResourceGroupLoaded :: HG3DClass -> String -> IO Bool
- resourceGroupExists :: HG3DClass -> String -> IO Bool
- addResourceLocation :: HG3DClass -> String -> String -> String -> Bool -> IO ()
- removeResourceLocation :: HG3DClass -> String -> String -> IO ()
- resourceLocationExists :: HG3DClass -> String -> String -> IO Bool
- undeclareResource :: HG3DClass -> String -> String -> IO ()
- resourceExists :: HG3DClass -> String -> String -> IO Bool
- resourceExistsInAnyGroup :: HG3DClass -> String -> IO Bool
- findGroupContainingResource :: HG3DClass -> String -> IO String
- deleteResource :: HG3DClass -> String -> String -> String -> IO ()
- deleteMatchingResources :: HG3DClass -> String -> String -> String -> IO ()
- setWorldResourceGroupName :: HG3DClass -> String -> IO ()
- getWorldResourceGroupName :: HG3DClass -> IO String
- linkWorldGeometryToResourceGroup :: HG3DClass -> String -> String -> HG3DClass -> IO ()
- unlinkWorldGeometryFromResourceGroup :: HG3DClass -> String -> IO ()
- isResourceGroupInGlobalPool :: HG3DClass -> String -> IO Bool
- shutdownAll :: HG3DClass -> IO ()
- getSingleton :: IO HG3DClass
- getSingletonPtr :: IO HG3DClass
- new'_ :: HG3DClassPtr -> IO ()
- delete'_ :: HG3DClassPtr -> IO ()
- createResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> IO ()
- initialiseResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> IO ()
- initialiseAllResourceGroups'_ :: HG3DClassPtr -> IO ()
- prepareResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> CInt -> IO ()
- loadResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> CInt -> IO ()
- unloadResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> IO ()
- unloadUnreferencedResourcesInGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> IO ()
- clearResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> IO ()
- destroyResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> IO ()
- isResourceGroupInitialised'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()
- isResourceGroupLoaded'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()
- resourceGroupExists'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()
- addResourceLocation'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> Ptr CChar -> CInt -> IO ()
- removeResourceLocation'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> IO ()
- resourceLocationExists'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> Ptr CInt -> IO ()
- undeclareResource'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> IO ()
- resourceExists'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> Ptr CInt -> IO ()
- resourceExistsInAnyGroup'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()
- findGroupContainingResource'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> IO ()
- deleteResource'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> Ptr CChar -> IO ()
- deleteMatchingResources'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> Ptr CChar -> IO ()
- setWorldResourceGroupName'_ :: HG3DClassPtr -> Ptr CChar -> IO ()
- getWorldResourceGroupName'_ :: HG3DClassPtr -> Ptr CChar -> IO ()
- linkWorldGeometryToResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> HG3DClassPtr -> IO ()
- unlinkWorldGeometryFromResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> IO ()
- isResourceGroupInGlobalPool'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()
- shutdownAll'_ :: HG3DClassPtr -> IO ()
- getSingleton'_ :: HG3DClassPtr -> IO ()
- getSingletonPtr'_ :: HG3DClassPtr -> IO ()
Documentation
Create a resource group. A resource group allows you to define a set of resources that can be loaded / unloaded as a unit. For example, it might be all the resources used for the level of a game. There is always one predefined resource group called ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAMEResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAMEResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAMEOnce you have defined a resource group, resources which will be loaded as part of it are defined in one of 3 ways:
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name to give the resource group. |
-> Bool | inGlobalPool - if true the resource will be loaded even a different group was requested in the load method as a parameter. |
-> IO () |
Initialises a resource group. After creating a resource group, adding some resource locations, and perhaps pre-declaring some resources using declareResource()
ResourceFailure to call this method means that loadResourceGroup will do nothing, and any resources you define in scripts will not be found. Similarly, once you have called this method you won't be able to pick up any new scripts or pre-declared resources, unless you call clearResourceGroup, set up declared resources, and call this method again. When you call Root::initialiseRoot::initialise
initialiseAllResourceGroupsSource
Prepares a resource group. Prepares any created resources which are part of the named group. Note that resources must have already been created by calling ResourceManager::createdeclareResource()ResourceGroupManager::linkWorldGeometryToResourceGroup
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name of the resource group to initialise |
-> IO () |
Initialise all resource groups which are yet to be initialised. ResourceGroupManager::intialiseResourceGroup
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name of the resource group to prepare. |
-> Bool | prepareMainResources - If true, prepares normal resources associated with the group (you might want to set this to false if you wanted to just prepare world geometry in bulk) |
-> Bool | prepareWorldGeom - If true, prepares any linked world geometry |
-> IO () |
Loads a resource group. Loads any created resources which are part of the named group. Note that resources must have already been created by calling ResourceManager::createdeclareResource()ResourceGroupManager::linkWorldGeometryToResourceGroup
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name of the resource group to load. |
-> Bool | loadMainResources - If true, loads normal resources associated with the group (you might want to set this to false if you wanted to just load world geometry in bulk) |
-> Bool | loadWorldGeom - If true, loads any linked world geometry |
-> IO () |
Unloads a resource group. This method unloads all the resources that have been declared as being part of the named resource group. Note that these resources will still exist in their respective ResourceManagerResource::isReloadable
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name to of the resource group to unload. |
-> Bool | reloadableOnly - If set to true, only unload the resource that is reloadable. Because some resources isn't reloadable, they will be unloaded but can't load them later. Thus, you might not want to them unloaded. Or, you might unload all of them, and then populate them manually later. |
-> IO () |
Unload all resources which are not referenced by any other object. This method behaves like unloadResourceGroup, except that it only unloads resources in the group which are not in use, ie not referenced by other objects. This allows you to free up some memory selectively whilst still keeping the group around (and the resources present, just not using much memory).
unloadUnreferencedResourcesInGroupSource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name of the group to check for unreferenced resources |
-> Bool | reloadableOnly - If true (the default), only unloads resources which can be subsequently automatically reloaded |
-> IO () |
Clears a resource group. This method unloads all resources in the group, but in addition it removes all those resources from their ResourceManagers, and then clears all the members from the list. That means after calling this method, there are no resources declared as part of the named group any more. Resource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name to of the resource group to clear. |
-> IO () |
Destroys a resource group, clearing it first, destroying the resources which are part of it, and then removing it from the list of resource groups.
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name of the resource group to destroy. |
-> IO () |
Checks the status of a resource group. Looks at the state of a resource group. If initialiseResourceGroup has been called for the resource group return true, otherwise return false.
isResourceGroupInitialisedSource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name to of the resource group to access. |
-> IO Bool |
Checks the status of a resource group. Looks at the state of a resource group. If loadResourceGroup has been called for the resource group return true, otherwise return false.
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name of the resource location; probably a directory, zip file, URL etc. |
-> String | locType - The codename for the resource type, which must correspond to the Archive factory which is providing the implementation. |
-> String | resGroup - The name of the resource group for which this location is to apply. ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME is the default group which always exists, and can be used for resources which are unlikely to be unloaded until application shutdown. Otherwise it must be the name of a group; if it has not already been created with createResourceGroup then it is created automatically. |
-> Bool | recursive - Whether subdirectories will be searched for files when using a pattern match (such as *.material), and whether subdirectories will be indexed. This can slow down initial loading of the archive and searches. When opening a resource you still need to use the fully qualified name, this allows duplicate names in alternate paths. |
-> IO () |
Removes a resource location from the search path.
Method to add a resource location to for a given resource group. Resource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name |
-> String | resGroup |
-> IO () |
Verify if a resource location exists for the given group.
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name of the resource. |
-> String | groupName - The name of the group this resource was declared in. |
-> IO () |
Find out if the named file exists in a group.
Undeclare a resource. Note that this will not cause it to be unloaded if it is already loaded, nor will it destroy a resource which has already been created if initialiseResourceGroup has been called already. Only unloadResourceGroup clearResourceGroup destroyResourceGroup will do that.
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | group - The name of the resource group |
-> String | filename - Fully qualified name of the file to test for |
-> IO Bool |
Find out if the named file exists in any group.
resourceExistsInAnyGroupSource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | filename - Fully qualified name of the file to test for |
-> IO Bool |
Find the group in which a resource exists.
findGroupContainingResourceSource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | filename - Fully qualified name of the file the resource should be found as |
-> IO String | return value - Name of the resource group the resource was found in. An exception is thrown if the group could not be determined. |
Delete a single resource file.
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | filename - The name of the file to delete. |
-> String | groupName - The name of the group in which to search |
-> String | locationPattern - If the resource group contains multiple locations, then usually first matching file found in any location will be deleted. If you want to be more specific, you can include a location pattern here and only locations which match that pattern (as determined by StringUtil::match) will be considered candidates for deletion. |
-> IO () |
Delete all matching resource files.
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | filePattern - The pattern (see StringUtil::match) of the files to delete. |
-> String | groupName - The name of the group in which to search |
-> String | locationPattern - If the resource group contains multiple locations, then usually all matching files in any location will be deleted. If you want to be more specific, you can include a location pattern here and only locations which match that pattern (as determined by StringUtil::match) will be considered candidates for deletion. |
-> IO () |
Sets the resource group that world
resources will use.
This is the group which should be used by SceneManagers implementing world geometry when looking for their resources. Defaults to the DEFAULT_RESOURCE_GROUP_NAME but this can be altered.
setWorldResourceGroupNameSource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | groupName |
-> IO () |
Gets the resource group that world
resources will use.
linkWorldGeometryToResourceGroupSource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | group - The name of the resource group |
-> String | worldGeometry - The parameter which should be passed to setWorldGeometry |
-> HG3DClass | sceneManager - The SceneManager which should be called |
-> IO () |
Clear any link to world geometry from a resource group. Basically undoes a previous call to linkWorldGeometryToResourceGroup.
Associates some world geometry with a resource group, causing it to be loaded / unloaded with the resource group. You would use this method to essentially defer a call to SceneManager::setWorldGeometry
unlinkWorldGeometryFromResourceGroupSource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | group |
-> IO () |
Checks the status of a resource group. Looks at the state of a resource group. If loadResourceGroup has been called for the resource group return true, otherwise return false.
isResourceGroupInGlobalPoolSource
:: HG3DClass | classpointer - pointer of Class instance from which this methods is called. |
-> String | name - The name to of the resource group to access. |
-> IO Bool |
Shutdown all ResourceManagers, performed as part of clean-up.
Override standard Singleton retrieval. Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll. This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.
Override standard Singleton retrieval. Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll. This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.
new'_ :: HG3DClassPtr -> IO ()Source
delete'_ :: HG3DClassPtr -> IO ()Source
createResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> IO ()Source
initialiseResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> IO ()Source
prepareResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> CInt -> IO ()Source
loadResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> CInt -> IO ()Source
unloadResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> IO ()Source
unloadUnreferencedResourcesInGroup'_ :: HG3DClassPtr -> Ptr CChar -> CInt -> IO ()Source
clearResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> IO ()Source
destroyResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> IO ()Source
isResourceGroupInitialised'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()Source
isResourceGroupLoaded'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()Source
resourceGroupExists'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()Source
removeResourceLocation'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> IO ()Source
resourceLocationExists'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> Ptr CInt -> IO ()Source
undeclareResource'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> IO ()Source
resourceExists'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> Ptr CInt -> IO ()Source
resourceExistsInAnyGroup'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()Source
findGroupContainingResource'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> IO ()Source
deleteResource'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> Ptr CChar -> IO ()Source
deleteMatchingResources'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> Ptr CChar -> IO ()Source
setWorldResourceGroupName'_ :: HG3DClassPtr -> Ptr CChar -> IO ()Source
getWorldResourceGroupName'_ :: HG3DClassPtr -> Ptr CChar -> IO ()Source
linkWorldGeometryToResourceGroup'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CChar -> HG3DClassPtr -> IO ()Source
isResourceGroupInGlobalPool'_ :: HG3DClassPtr -> Ptr CChar -> Ptr CInt -> IO ()Source
shutdownAll'_ :: HG3DClassPtr -> IO ()Source
getSingleton'_ :: HG3DClassPtr -> IO ()Source
getSingletonPtr'_ :: HG3DClassPtr -> IO ()Source