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 class
Bindable.Info
Resource information class.-
Nested classes/interfaces inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
Spatial.CullingMode
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_bShared
protected java.util.Vector<Bindable.Info>
m_kInfoArray
Resource information.private static long
serialVersionUID
-
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 ResourceIdentifier
GetIdentifier(int i, Renderer pkUser)
Use these functions when the resource has multiple representations in VRAM (vertex buffers).ResourceIdentifier
GetIdentifier(Renderer pkUser)
Use this function when the resource has a unique representation in VRAM (all resources except for vertex buffers).int
GetInfoQuantity()
Get number of bound resources.boolean
GetShared()
protected void
GetVisibleSet(Culler rkCuller, boolean bNoCull)
Get visible set.boolean
IsReload()
Get reload flag.boolean
IsReload(Renderer pkUser)
Get reload flag.void
OnLoad(Renderer pkUser, ReleaseFunction oRelease, ResourceIdentifier pkID)
Called when the resource is loaded, creates the Info object to contain the resource.protected void
OnRelease(Renderer pkUser, ResourceIdentifier pkID)
Called when the resouce is released.private void
readObject(java.io.ObjectInputStream in)
void
Release(Renderer pkUser)
Release the resource from this renderer.void
Reload(boolean bReload)
Set to true to reload the texture data to the GPUvoid
Reload(Renderer pkUser, boolean bReload)
void
Remove()
Delete memoryvoid
SetShared(boolean bShared)
protected void
UpdateState(java.util.Vector<java.util.Vector<GlobalState>> akGStack, java.util.Vector<Light> pkLStack)
Update state.protected void
UpdateWorldBound()
Update world bound.private void
writeObject(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.IOException
java.lang.ClassNotFoundException
-
GetVisibleSet
protected void GetVisibleSet(Culler rkCuller, boolean bNoCull)
Description copied from class:Spatial
Get visible set.- Specified by:
GetVisibleSet
in 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:Spatial
Update state.- Specified by:
UpdateState
in classSpatial
- Parameters:
akGStack
- global states.
-
UpdateWorldBound
protected void UpdateWorldBound()
Description copied from class:Spatial
Update world bound.- Specified by:
UpdateWorldBound
in classSpatial
-
-