Class RenderContext

java.lang.Object
com.ardor3d.renderer.RenderContext
Direct Known Subclasses:
JoglRenderContext

public class RenderContext extends Object
Represents the state of an individual context in OpenGL.
  • Field Details

  • Constructor Details

  • Method Details

    • createRendererRecord

      protected RendererRecord createRendererRecord()
    • setupRecords

      protected void setupRecords()
    • invalidateStates

      public void invalidateStates()
    • getCapabilities

      public ContextCapabilities getCapabilities()
    • getStateRecord

      public StateRecord getStateRecord(RenderState.StateType type)
    • getLineRecord

      public LineRecord getLineRecord()
    • getRendererRecord

      public RendererRecord 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
    • enforceStates

      public void enforceStates(EnumMap<RenderState.StateType,RenderState> states)
      Enforces the states referenced in the given EnumMap.
      Parameters:
      states - the render states
    • clearEnforcedState

      public void clearEnforcedState(RenderState.StateType type)
      Clears an enforced render state index 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.
    • clearCurrentStates

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

      public void clearCurrentState(RenderState.StateType type)
      Parameters:
      type - the state type to clear.
    • hasEnforcedStates

      public boolean hasEnforcedStates()
    • getEnforcedState

      public RenderState getEnforcedState(RenderState.StateType type)
    • getCurrentState

      public RenderState getCurrentState(RenderState.StateType type)
    • getContextKey

      public Object getContextKey()
    • setCurrentState

      public void setCurrentState(RenderState.StateType type, RenderState state)
    • getCurrentCamera

      public Camera getCurrentCamera()
    • setCurrentCamera

      public void setCurrentCamera(Camera cam)
    • getGlContextRep

      public Object getGlContextRep()
    • pushEnforcedStates

      public void pushEnforcedStates()
      Saves the currently set states to a stack. Does not changes the currently enforced states.
    • popEnforcedStates

      public void popEnforcedStates()
      Restores the enforced states from the stack. Any states enforced or cleared since the last push are reverted.
      Throws:
      EmptyStackException - if this method is called without first calling pushEnforcedStates()
    • pushFBOTextureRenderer

      public void pushFBOTextureRenderer(AbstractFBOTextureRenderer top)
    • popFBOTextureRenderer

      public void popFBOTextureRenderer()
    • contextLost

      public void contextLost()
      Should only be called on a thread with an active context.