Class AbstractRenderer

java.lang.Object
com.ardor3d.renderer.AbstractRenderer
All Implemented Interfaces:
Renderer
Direct Known Subclasses:
JoglRenderer

public abstract class AbstractRenderer extends Object implements Renderer
Provides some common base level method implementations for Renderers.
  • Field Details

    • _backgroundColor

      protected final ColorRGBA _backgroundColor
    • _processingQueue

      protected boolean _processingQueue
    • _queue

      protected RenderQueue _queue
    • _inOrthoMode

      protected boolean _inOrthoMode
    • _stencilClearValue

      protected int _stencilClearValue
    • renderLogic

      protected RenderLogic renderLogic
    • defaultStateList

      protected final EnumMap<RenderState.StateType,RenderState> defaultStateList
      List of default rendering states for this specific renderer type
  • Constructor Details

    • AbstractRenderer

      public AbstractRenderer()
  • Method Details

    • isInOrthoMode

      public boolean isInOrthoMode()
      Specified by:
      isInOrthoMode in interface Renderer
      Returns:
      true if the renderer is currently in ortho mode.
    • getBackgroundColor

      public ReadOnlyColorRGBA getBackgroundColor()
      Description copied from interface: Renderer
      getBackgroundColor retrieves the clear color of the current OpenGL context.
      Specified by:
      getBackgroundColor in interface Renderer
      Returns:
      the current clear color.
    • getQueue

      public RenderQueue getQueue()
      Description copied from interface: Renderer
      Get the render queue associated with this Renderer.
      Specified by:
      getQueue in interface Renderer
      Returns:
      RenderQueue
    • isProcessingQueue

      public boolean isProcessingQueue()
      Description copied from interface: Renderer
      Return true if this renderer is in the middle of processing its RenderQueue.
      Specified by:
      isProcessingQueue in interface Renderer
      Returns:
      boolean
    • applyState

      public void applyState(RenderState.StateType type, RenderState state)
      Description copied from interface: Renderer
      Apply the given state to the current RenderContext using this Renderer.
      Specified by:
      applyState in interface Renderer
      Parameters:
      type - the state type
      state - the render state. If null, the renderer's default is applied instead.
    • doApplyState

      protected abstract void doApplyState(RenderState state)
    • addStats

      protected void addStats(IndexMode indexMode, int vertCount)
    • getStencilClearValue

      public int getStencilClearValue()
    • setStencilClearValue

      public void setStencilClearValue(int stencilClearValue)
    • isClipTestEnabled

      public boolean isClipTestEnabled()
      Specified by:
      isClipTestEnabled in interface Renderer
      Returns:
      true if the renderer believes clipping is enabled
    • getProperRenderState

      public RenderState getProperRenderState(RenderState.StateType type, RenderState current)
      Specified by:
      getProperRenderState in interface Renderer
      Parameters:
      type - the state type to grab
      current - the current render state
      Returns:
      the appropriate render state for the current context for the current type. This is the enforced state if one exists or the given current state if not null. Otherwise, the Renderer's default state is returned.
    • setRenderLogic

      public void setRenderLogic(RenderLogic renderLogic)
      Description copied from interface: Renderer
      Set rendering logic that will be called during drawing of renderables
      Specified by:
      setRenderLogic in interface Renderer
      Parameters:
      renderLogic - logic to use in rendering. call with null to reset rendering.
      See Also:
    • grabScreenContents

      public void grabScreenContents(ByteBuffer store, ImageDataFormat format, int x, int y, int w, int h)
      Description copied from interface: Renderer
      grabScreenContents reads a block of data as bytes from the current framebuffer. The format determines how many bytes per pixel are read and thus how big the buffer must be that you pass in.
      Specified by:
      grabScreenContents in interface Renderer
      Parameters:
      store - a buffer to store contents in.
      format - the format to read in bytes for.
      x - - x starting point of block
      y - - y starting point of block
      w - - width of block
      h - - height of block
    • getExpectedBufferSizeToGrabScreenContents

      public int getExpectedBufferSizeToGrabScreenContents(ImageDataFormat format, PixelDataType type, int w, int h)
      Description copied from interface: Renderer
      Gets the expected size (in bytes) of the buffer used to call grabScreenContents
      Specified by:
      getExpectedBufferSizeToGrabScreenContents in interface Renderer
      Parameters:
      format - the format to read in data for.
      type - the format to read in data for.
      w - - width of block
      h - - height of block
      Returns:
      the expected size (in bytes) of the buffer used to call grabScreenContents