Package com.ardor3d.renderer
Class AbstractRenderer
java.lang.Object
com.ardor3d.renderer.AbstractRenderer
- All Implemented Interfaces:
Renderer
- Direct Known Subclasses:
JoglRenderer
Provides some common base level method implementations for Renderers.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ColorRGBA
protected boolean
protected boolean
protected RenderQueue
protected int
protected final EnumMap
<RenderState.StateType, RenderState> List of default rendering states for this specific renderer typeprotected RenderLogic
Fields inherited from interface com.ardor3d.renderer.Renderer
BUFFER_ACCUMULATION, BUFFER_COLOR, BUFFER_COLOR_AND_DEPTH, BUFFER_DEPTH, BUFFER_NONE, BUFFER_STENCIL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
applyState
(RenderState.StateType type, RenderState state) Apply the given state to the current RenderContext using this Renderer.protected abstract void
doApplyState
(RenderState state) getBackgroundColor
retrieves the clear color of the current OpenGL context.int
getExpectedBufferSizeToGrabScreenContents
(ImageDataFormat format, PixelDataType type, int w, int h) Gets the expected size (in bytes) of the buffer used to callgrabScreenContents
getProperRenderState
(RenderState.StateType type, RenderState current) getQueue()
Get the render queue associated with this Renderer.int
void
grabScreenContents
(ByteBuffer store, ImageDataFormat format, int x, int y, int w, int h) grabScreenContents
reads a block of data as bytes from the current framebuffer.boolean
boolean
boolean
Return true if this renderer is in the middle of processing its RenderQueue.void
setRenderLogic
(RenderLogic renderLogic) Set rendering logic that will be called during drawing of renderablesvoid
setStencilClearValue
(int stencilClearValue) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.ardor3d.renderer.Renderer
applyDefaultColor, applyNormalsMode, checkAndAdd, checkCardError, clearBuffers, clearBuffers, clearClips, clearQueue, deleteDisplayLists, deleteTexture, deleteTextureIds, deleteVBOs, deleteVBOs, doTransforms, draw, draw, drawArrays, drawElements, drawElementsVBO, endDisplayList, finishGraphics, flushFrame, flushGraphics, getModelViewMatrix, getProjectionMatrix, grabScreenContents, loadTexture, popClip, pushClip, pushEmptyClip, renderBuckets, renderBuckets, renderDisplayList, setBackgroundColor, setClipTestEnabled, setDepthRange, setDrawBuffer, setModelViewMatrix, setOrtho, setProjectionMatrix, setupColorData, setupColorDataVBO, setupFogData, setupFogDataVBO, setupLineParameters, setupNormalData, setupNormalDataVBO, setupPointParameters, setupTextureData, setupTextureDataVBO, setupVertexData, setupVertexDataVBO, setViewport, startDisplayList, unbindVBO, undoTransforms, unsetOrtho, updateTexture1DSubImage, updateTexture2DSubImage, updateTexture3DSubImage, updateTextureCubeMapSubImage
-
Field Details
-
_backgroundColor
-
_processingQueue
protected boolean _processingQueue -
_queue
-
_inOrthoMode
protected boolean _inOrthoMode -
_stencilClearValue
protected int _stencilClearValue -
renderLogic
-
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 interfaceRenderer
- Returns:
- true if the renderer is currently in ortho mode.
-
getBackgroundColor
Description copied from interface:Renderer
getBackgroundColor
retrieves the clear color of the current OpenGL context.- Specified by:
getBackgroundColor
in interfaceRenderer
- Returns:
- the current clear color.
-
getQueue
Description copied from interface:Renderer
Get the render queue associated with this Renderer. -
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 interfaceRenderer
- Returns:
- boolean
-
applyState
Description copied from interface:Renderer
Apply the given state to the current RenderContext using this Renderer.- Specified by:
applyState
in interfaceRenderer
- Parameters:
type
- the state typestate
- the render state. If null, the renderer's default is applied instead.
-
doApplyState
-
addStats
-
getStencilClearValue
public int getStencilClearValue() -
setStencilClearValue
public void setStencilClearValue(int stencilClearValue) -
isClipTestEnabled
public boolean isClipTestEnabled()- Specified by:
isClipTestEnabled
in interfaceRenderer
- Returns:
- true if the renderer believes clipping is enabled
-
getProperRenderState
- Specified by:
getProperRenderState
in interfaceRenderer
- Parameters:
type
- the state type to grabcurrent
- 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
Description copied from interface:Renderer
Set rendering logic that will be called during drawing of renderables- Specified by:
setRenderLogic
in interfaceRenderer
- 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 interfaceRenderer
- Parameters:
store
- a buffer to store contents in.format
- the format to read in bytes for.x
- - x starting point of blocky
- - y starting point of blockw
- - width of blockh
- - 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 callgrabScreenContents
- Specified by:
getExpectedBufferSizeToGrabScreenContents
in interfaceRenderer
- Parameters:
format
- the format to read in data for.type
- the format to read in data for.w
- - width of blockh
- - height of block- Returns:
- the expected size (in bytes) of the buffer used to call
grabScreenContents
-