org.ogre4j
Interface IResource

All Superinterfaces:
IAllocatedObject<IResourceAllocPolicy>, INativeObject, IResourceAllocatedObject, IStringInterface
All Known Subinterfaces:
ICompositor, IFont, IGpuProgram, IHighLevelGpuProgram, IMaterial, IMesh, IPatchMesh, ISkeleton, ISkeletonInstance, ITexture, IUnifiedHighLevelGpuProgram
All Known Implementing Classes:
Compositor, Font, GpuProgram, HighLevelGpuProgram, Material, Mesh, PatchMesh, Resource, Skeleton, SkeletonInstance, Texture, UnifiedHighLevelGpuProgram

public interface IResource
extends INativeObject, IStringInterface, IResourceAllocatedObject


Nested Class Summary
static interface IResource.IListener
           
static interface IResource.IListenerList
           
 
Method Summary
 void _dirtyState()
          Manually mark the state of this resource as having been changed.
 void _fireBackgroundLoadingComplete()
          Firing of background loading complete event
 void _fireBackgroundPreparingComplete()
          Firing of background preparing complete event
 void _notifyOrigin(java.lang.String origin)
           
 void addListener(IResource.IListener lis)
          Register a listener on this resource.
 void changeGroupOwnership(java.lang.String newGroup)
          Change the resource group ownership of a .
 void escalateLoading()
          Escalates the loading of a background loaded resource.
 IResourceManager getCreator()
           
 java.lang.String getGroup()
           
 long getHandle()
           
 Resource.LoadingState getLoadingState()
          Returns the current loading state.
 java.lang.String getName()
          Gets resource name.
 java.lang.String getOrigin()
          Get the origin of this resource, e.g. a script file name.
 int getSize()
          Retrieves info about the size of the resource.
 int getStateCount()
          Returns the number of times this resource has changed state, which generally means the number of times it has been loaded.
 boolean isBackgroundLoaded()
          Returns whether this has been earmarked for background loading.
 boolean isLoaded()
          Returns true if the has been loaded, false otherwise.
 boolean isLoading()
          Returns whether the resource is currently in the process of background loading.
 boolean isManuallyLoaded()
          Is this resource manually loaded?
 boolean isPrepared()
          Returns true if the has been prepared, false otherwise.
 boolean isReloadable()
          Returns true if the is reloadable, false otherwise.
 void load(boolean backgroundThread)
          Loads the resource, if it is not already.
 void prepare()
          Prepares the resource for load, if it is not already.
 void reload()
          Reloads the resource, if it is already loaded.
 void removeListener(IResource.IListener lis)
          Remove a listener on this resource.
 void setBackgroundLoaded(boolean bl)
          Tells the resource whether it is background loaded or not.
 void touch()
          'Touches' the resource to indicate it has been used.
 void unload()
          Unloads the resource; this is not permanent, the resource can be reloaded later if required.
 
Methods inherited from interface org.ogre4j.IStringInterface
copyParametersTo, getParamDictionary_const, getParamDictionary, getParameter, getParameters, setParameter, setParameterList
 
Methods inherited from interface org.xbig.base.INativeObject
delete, disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Method Detail

prepare

void prepare()
Prepares the resource for load, if it is not already. One can call before , but this is not required as will call itself, if needed. When OGRE_THREAD_SUPPORT==1 both and are thread-safe. When OGRE_THREAD_SUPPORT==2 however, only is thread-safe. The reason for this function is to allow a background thread to do some of the loading work, without requiring the whole render system to be thread-safe. The background thread would call while the main render loop would later call . So long as remains thread-safe, subclasses can arbitrarily split the work of loading a resource between and . It is best to try and do as much work in , however, since this will leave less work for the main render thread to do and thus increase FPS.


load

void load(boolean backgroundThread)
Loads the resource, if it is not already.


reload

void reload()
Reloads the resource, if it is already loaded.


isReloadable

boolean isReloadable()
Returns true if the is reloadable, false otherwise.


isManuallyLoaded

boolean isManuallyLoaded()
Is this resource manually loaded?


unload

void unload()
Unloads the resource; this is not permanent, the resource can be reloaded later if required.


getSize

int getSize()
Retrieves info about the size of the resource.


touch

void touch()
'Touches' the resource to indicate it has been used.


getName

java.lang.String getName()
Gets resource name.


getHandle

long getHandle()

isPrepared

boolean isPrepared()
Returns true if the has been prepared, false otherwise.


isLoaded

boolean isLoaded()
Returns true if the has been loaded, false otherwise.


isLoading

boolean isLoading()
Returns whether the resource is currently in the process of background loading.


getLoadingState

Resource.LoadingState getLoadingState()
Returns the current loading state.


isBackgroundLoaded

boolean isBackgroundLoaded()
Returns whether this has been earmarked for background loading.


setBackgroundLoaded

void setBackgroundLoaded(boolean bl)
Tells the resource whether it is background loaded or not.


escalateLoading

void escalateLoading()
Escalates the loading of a background loaded resource.


addListener

void addListener(IResource.IListener lis)
Register a listener on this resource.


removeListener

void removeListener(IResource.IListener lis)
Remove a listener on this resource.


getGroup

java.lang.String getGroup()

changeGroupOwnership

void changeGroupOwnership(java.lang.String newGroup)
Change the resource group ownership of a .


getCreator

IResourceManager getCreator()

getOrigin

java.lang.String getOrigin()
Get the origin of this resource, e.g. a script file name.


_notifyOrigin

void _notifyOrigin(java.lang.String origin)

getStateCount

int getStateCount()
Returns the number of times this resource has changed state, which generally means the number of times it has been loaded. Objects that build derived data based on the resource can check this value against a copy they kept last time they built this derived data, in order to know whether it needs rebuilding. This is a nice way of monitoring changes without having a tightly-bound callback.


_dirtyState

void _dirtyState()
Manually mark the state of this resource as having been changed.


_fireBackgroundLoadingComplete

void _fireBackgroundLoadingComplete()
Firing of background loading complete event


_fireBackgroundPreparingComplete

void _fireBackgroundPreparingComplete()
Firing of background preparing complete event



Copyright © 2007 netAllied GmbH. All Rights Reserved.