HGamer3D-Ogre-Binding-0.1.8: Library to enable 3D game development for Haskell - Ogre Bindings

Safe HaskellSafe-Infered

HGamer3D.Bindings.Ogre.ClassResourceGroupManager

Synopsis

Documentation

newSource

Arguments

:: IO HG3DClass 

deleteSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance which is going to be deleted.

-> IO () 

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:

createResourceGroupSource

Arguments

:: 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

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO () 

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

initialiseResourceGroupSource

Arguments

:: 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

prepareResourceGroupSource

Arguments

:: 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

loadResourceGroupSource

Arguments

:: 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

unloadResourceGroupSource

Arguments

:: 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

Arguments

:: 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

clearResourceGroupSource

Arguments

:: 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.

destroyResourceGroupSource

Arguments

:: 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

Arguments

:: 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 

isResourceGroupLoadedSource

Arguments

:: 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.

resourceGroupExistsSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> String

name

-> IO Bool 

addResourceLocationSource

Arguments

:: 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

removeResourceLocationSource

Arguments

:: 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.

resourceLocationExistsSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> String

name

-> String

resGroup

-> IO Bool 

undeclareResourceSource

Arguments

:: 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.

resourceExistsSource

Arguments

:: 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 

resourceExistsInAnyGroupSource

Arguments

:: 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 out if the named file exists in any group.

findGroupContainingResourceSource

Arguments

:: 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.

Find the group in which a resource exists.

deleteResourceSource

Arguments

:: 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.

Delete a single resource file.

deleteMatchingResourcesSource

Arguments

:: 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

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> String

groupName

-> IO () 

Gets the resource group that world resources will use.

getWorldResourceGroupNameSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO String 

linkWorldGeometryToResourceGroupSource

Arguments

:: 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

Arguments

:: 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

Arguments

:: 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 

shutdownAllSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO () 

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.

Shutdown all ResourceManagers, performed as part of clean-up.