Moai SDK  1.5 revision 1 (MoaiEdition)
MOAIGfxResource Class Reference
Inheritance diagram for MOAIGfxResource:
MOAIGfxState MOAIIndexBuffer MOAIShader MOAITextureBase MOAIFrameBufferTexture MOAIImageTexture MOAITexture

List of all members.

Function List

  getAge
  softRelease

Function Documentation

Returns the 'age' of the graphics resource. The age is the number of times MOAIRenderMgr has rendered a scene since the resource was last bound. It is part of the render count, not a timestamp. This may change to be time-based in future releases.


function getAge ( MOAIGfxResource self )
Parameters:
self ( MOAIGfxResource )
Returns:
age ( number )

Attempt to release the resource. Generally this is used when responding to a memory warning from the system. A resource will only be released if it is renewable (i.e. has a renew callback or contains all information needed to reload the resources on demand). Using soft release can save an app in extreme memory circumstances, but may trigger reloads of resources during runtime which can significantly degrade performance.


function softRelease ( MOAIGfxResource self [, number age ] )
Parameters:
self ( MOAIGfxResource )
age ( number ) Optional. Release only if the texture hasn't been used in X frames.
Returns:
released ( boolean )