com.jme.renderer
Class RenderContext<ContextHolder>

java.lang.Object
  extended by com.jme.renderer.RenderContext<ContextHolder>

public class RenderContext<ContextHolder>
extends java.lang.Object

Represents the state of an individual context in OpenGL.

Version:
$Id: RenderContext.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Joshua Slack

Field Summary
 RenderState[] currentStates
          RenderStates a Spatial contains during rendering.
 RenderState[] enforcedStateList
          List of states that override any set states on a spatial if not null.
 
Constructor Summary
RenderContext(ContextHolder key)
           
 
Method Summary
 void clearCurrentState(int state)
          Deprecated. As of 2.0, use clearCurrentState(com.jme.scene.state.RenderState.StateType) instead.
 void clearCurrentState(RenderState.StateType type)
          Clears the specified state.
 void clearCurrentStates()
          sets all current states to null, and therefore forces the use of the default states.
 void clearEnforcedState(int renderStateType)
          Deprecated. As of 2.0, use clearEnforcedState(com.jme.scene.state.RenderState.StateType) instead.
 void clearEnforcedState(RenderState.StateType type)
          Clears an enforced render state by setting it to null.
 void clearEnforcedStates()
          sets all enforced states to null.
 void enforceState(RenderState state)
          Enforce a particular state.
 ContextHolder getContextHolder()
           
 RenderState getCurrentState(int state)
          Deprecated. As of 2.0, use getCurrentState(com.jme.scene.state.RenderState.StateType) instead.
 RenderState getCurrentState(RenderState.StateType type)
          Returns the specified RenderState.
 StateRecord getLineRecord()
           
 StateRecord getRendererRecord()
           
 StateRecord getStateRecord(int state)
          Deprecated. As of 2.0, use getStateRecord(com.jme.scene.state.RenderState.StateType) instead.
 StateRecord getStateRecord(RenderState.StateType type)
          Returns the StateRecord of the given RenderState.StateType.
 void invalidateStates()
           
 void setContextHolder(ContextHolder contextHolder)
           
 void setupRecords(Renderer r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enforcedStateList

public RenderState[] enforcedStateList
List of states that override any set states on a spatial if not null.


currentStates

public RenderState[] currentStates
RenderStates a Spatial contains during rendering.

Constructor Detail

RenderContext

public RenderContext(ContextHolder key)
Method Detail

setupRecords

public void setupRecords(Renderer r)

invalidateStates

public void invalidateStates()

getStateRecord

public StateRecord getStateRecord(int state)
Deprecated. As of 2.0, use getStateRecord(com.jme.scene.state.RenderState.StateType) instead.


getStateRecord

public StateRecord getStateRecord(RenderState.StateType type)
Returns the StateRecord of the given RenderState.StateType.

Parameters:
type - RenderState.StateType
Returns:
StateRecord

getLineRecord

public StateRecord getLineRecord()

getRendererRecord

public StateRecord getRendererRecord()

enforceState

public void enforceState(RenderState state)
Enforce a particular state. In other words, the given state will override any state of the same type set on a scene object. Remember to clear the state when done enforcing. Very useful for multipass techniques where multiple sets of states need to be applied to a scenegraph drawn multiple times.

Parameters:
state - state to enforce

clearEnforcedState

public void clearEnforcedState(int renderStateType)
Deprecated. As of 2.0, use clearEnforcedState(com.jme.scene.state.RenderState.StateType) instead.

Clears an enforced render state index by setting it to null. This allows object specific states to be used.

Parameters:
renderStateType - The type of RenderState to clear enforcement on.

clearEnforcedState

public void clearEnforcedState(RenderState.StateType type)
Clears an enforced render state by setting it to null. This allows object specific states to be used.

Parameters:
type - The type of RenderState to clear enforcement on.

clearEnforcedStates

public void clearEnforcedStates()
sets all enforced states to null.

See Also:
com.jme.scene.Spatial#clearEnforcedState(int)

clearCurrentStates

public void clearCurrentStates()
sets all current states to null, and therefore forces the use of the default states.


clearCurrentState

public void clearCurrentState(int state)
Deprecated. As of 2.0, use clearCurrentState(com.jme.scene.state.RenderState.StateType) instead.

clears the specified state. The state is referenced by it's int value, and therefore should be called via RenderState's constant list. For example, RenderState.RS_ALPHA.

Parameters:
state - the state to clear.

clearCurrentState

public void clearCurrentState(RenderState.StateType type)
Clears the specified state. The state is referenced by it's RenderState.StateType value.

Parameters:
state - the state to clear.

getCurrentState

public RenderState getCurrentState(int state)
Deprecated. As of 2.0, use getCurrentState(com.jme.scene.state.RenderState.StateType) instead.


getCurrentState

public RenderState getCurrentState(RenderState.StateType type)
Returns the specified RenderState.

Parameters:
type - RenderState.StateType
Returns:
RenderState

getContextHolder

public ContextHolder getContextHolder()

setContextHolder

public void setContextHolder(ContextHolder contextHolder)