Package WildMagic.LibGraphics.Rendering
Class Bindable
- java.lang.Object
-
- WildMagic.LibGraphics.ObjectSystem.GraphicsObject
-
- WildMagic.LibGraphics.SceneGraph.Spatial
-
- WildMagic.LibGraphics.Rendering.Bindable
-
- All Implemented Interfaces:
java.io.Serializable,NameIdInterface,StreamInterface
- Direct Known Subclasses:
Geometry,IndexBuffer,Program,Texture,VertexBuffer
public class Bindable extends Spatial implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBindable.InfoResource information class.-
Nested classes/interfaces inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
Spatial.CullingMode
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_bSharedprotected java.util.Vector<Bindable.Info>m_kInfoArrayResource information.private static longserialVersionUID-
Fields inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
Culling, Local, m_iStartEffect, m_kEffects, m_kGlobalStates, m_kLights, m_pkParent, World, WorldBound, WorldBoundIsCurrent, WorldIsCurrent
-
-
Constructor Summary
Constructors Constructor Description Bindable()Default constructor:
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceIdentifierGetIdentifier(int i, Renderer pkUser)Use these functions when the resource has multiple representations in VRAM (vertex buffers).ResourceIdentifierGetIdentifier(Renderer pkUser)Use this function when the resource has a unique representation in VRAM (all resources except for vertex buffers).intGetInfoQuantity()Get number of bound resources.booleanGetShared()protected voidGetVisibleSet(Culler rkCuller, boolean bNoCull)Get visible set.booleanIsReload()Get reload flag.booleanIsReload(Renderer pkUser)Get reload flag.voidOnLoad(Renderer pkUser, ReleaseFunction oRelease, ResourceIdentifier pkID)Called when the resource is loaded, creates the Info object to contain the resource.protected voidOnRelease(Renderer pkUser, ResourceIdentifier pkID)Called when the resouce is released.private voidreadObject(java.io.ObjectInputStream in)voidRelease(Renderer pkUser)Release the resource from this renderer.voidReload(boolean bReload)Set to true to reload the texture data to the GPUvoidReload(Renderer pkUser, boolean bReload)voidRemove()Delete memoryvoidSetShared(boolean bShared)protected voidUpdateState(java.util.Vector<java.util.Vector<GlobalState>> akGStack, java.util.Vector<Light> pkLStack)Update state.protected voidUpdateWorldBound()Update world bound.private voidwriteObject(java.io.ObjectOutputStream out)-
Methods inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
AttachEffect, AttachGlobalState, AttachLight, DetachAllEffects, DetachAllGlobalStates, DetachAllLights, DetachEffect, DetachGlobalState, DetachLight, dispose, GetAllObjectsByName, GetDiskUsed, GetEffect, GetEffectQuantity, GetGlobalState, GetGlobalState, GetGlobalStateQuantity, GetLight, GetLightQuantity, GetObjectByID, GetObjectByName, GetParent, GetStartEffect, Link, Load, OnGetVisibleSet, PopState, PropagateBoundToRoot, PropagateStateFromRoot, PushState, Register, Save, SaveStrings, SetParent, SetStartEffect, UpdateBS, UpdateGS, UpdateGS, UpdateRS, UpdateRS, UpdateWorldData
-
Methods inherited from class WildMagic.LibGraphics.ObjectSystem.GraphicsObject
GetID, GetName, GetNextID, GetObjectByIDBase, GetObjectByNameBase, SetName
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_kInfoArray
protected java.util.Vector<Bindable.Info> m_kInfoArray
Resource information.
-
m_bShared
protected boolean m_bShared
-
-
Method Detail
-
GetIdentifier
public ResourceIdentifier GetIdentifier(int i, Renderer pkUser)
Use these functions when the resource has multiple representations in VRAM (vertex buffers).- Parameters:
i- index.pkUser- Renderer- Returns:
- the resource id if it is bound to the renderer, null otherwise.
-
GetIdentifier
public ResourceIdentifier GetIdentifier(Renderer pkUser)
Use this function when the resource has a unique representation in VRAM (all resources except for vertex buffers).- Parameters:
pkUser- Renderer- Returns:
- the resource id if it is bound to the renderer, null otherwise.
-
GetInfoQuantity
public int GetInfoQuantity()
Get number of bound resources.
-
GetShared
public boolean GetShared()
-
OnLoad
public void OnLoad(Renderer pkUser, ReleaseFunction oRelease, ResourceIdentifier pkID)
Called when the resource is loaded, creates the Info object to contain the resource.- Parameters:
pkUser- Renderer the resources are bound to.oRelease- the release function to call.pkID- the resource identifier ID.
-
Release
public void Release(Renderer pkUser)
Release the resource from this renderer.- Parameters:
pkUser- Renderer.
-
Remove
public void Remove()
Delete memory
-
IsReload
public boolean IsReload(Renderer pkUser)
Get reload flag.- Returns:
- reload flag.
-
IsReload
public boolean IsReload()
Get reload flag.- Returns:
- reload flag.
-
Reload
public void Reload(boolean bReload)
Set to true to reload the texture data to the GPU- Parameters:
bReload- set to true to reload the texture data to the GPU
-
Reload
public void Reload(Renderer pkUser, boolean bReload)
-
SetShared
public void SetShared(boolean bShared)
-
OnRelease
protected void OnRelease(Renderer pkUser, ResourceIdentifier pkID)
Called when the resouce is released. Removes Info from array.- Parameters:
pkUser- Renderer the resources are bound to.pkID- the resource identifier ID.
-
writeObject
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException- Throws:
java.io.IOException
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
GetVisibleSet
protected void GetVisibleSet(Culler rkCuller, boolean bNoCull)
Description copied from class:SpatialGet visible set.- Specified by:
GetVisibleSetin classSpatial- Parameters:
rkCuller- CullerbNoCull- when true set to no-cull.
-
UpdateState
protected void UpdateState(java.util.Vector<java.util.Vector<GlobalState>> akGStack, java.util.Vector<Light> pkLStack)
Description copied from class:SpatialUpdate state.- Specified by:
UpdateStatein classSpatial- Parameters:
akGStack- global states.
-
UpdateWorldBound
protected void UpdateWorldBound()
Description copied from class:SpatialUpdate world bound.- Specified by:
UpdateWorldBoundin classSpatial
-
-