|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Renderer defines an interface that handles displaying of
graphics data to the context. Creation of this object is typically handled
via a call to a DisplaySystem subclass.
All rendering state and tasks can be handled through this interface.
Example Usage:
NOTE: This example uses the DisplaySystem class to obtain the
Renderer.
DisplaySystem ds = new LWJGLDisplaySystem();
ds.createWindow(640,480,16,60,false);
Renderer r = ds.getRenderer();
r.draw(point);
DisplaySystem| Field Summary | |
static int |
QUEUE_INHERIT
The Spatial will inherit its render queue state from its parent. |
static int |
QUEUE_OPAQUE
The Spatial will render in the opaque bucket. |
static int |
QUEUE_ORTHO
The Spatial will render in the ortho bucket. |
static int |
QUEUE_SKIP
The Spatial will skip render queueing. |
static int |
QUEUE_TRANSPARENT
The Spatial will render in the transparent bucket. |
| Method Summary | |
boolean |
checkAndAdd(Spatial s)
Check a given Spatial to see if it should be queued. |
void |
clearBuffers()
clearBuffers clears both the depth buffer and the back
buffer. |
void |
clearColorBuffer()
clearBackBuffer clears the back buffer of the renderer. |
void |
clearStatistics()
Reset rendering tracking statistical information. |
void |
clearStrictBuffers()
clearBuffers clears both the depth buffer and the back
buffer restricting the clear to the rectangle defined by the width and
height of the renderer. |
void |
clearZBuffer()
clearZBuffer clears the depth buffer of the renderer. |
AlphaState |
createAlphaState()
createAlphaState retrieves the alpha state object for the
proper renderer. |
AttributeState |
createAttributeState()
createAttributeState retrieves the attribute saving state
object for the proper renderer. |
Camera |
createCamera(int width,
int height)
createCamera retrieves a default camera for this renderer. |
CullState |
createCullState()
createCullState retrieves the cull state object for the
proper renderer. |
DitherState |
createDitherState()
createDitherState retrieves the dither state object for
the proper renderer. |
FogState |
createFogState()
createFogState retrieves the fog state object for the
proper renderer. |
FragmentProgramState |
createFragmentProgramState()
Retrieves the fragment program state object for the proper renderer. |
GLSLShaderObjectsState |
createGLSLShaderObjectsState()
createShaderObjectsState retrieves the shader object state
object for the proper renderer. |
LightState |
createLightState()
createLightState retrieves the light state object for the
proper renderer. |
MaterialState |
createMaterialState()
createMaterialState retrieves the material state object
for the proper renderer. |
ShadeState |
createShadeState()
createShadeState retrieves the shade state object for the
proper renderer. |
StencilState |
createStencilState()
Retrieves the stencil state object for the proper renderer. |
TextureState |
createTextureState()
createTextureState retrieves the texture state object for
the proper renderer. |
VertexProgramState |
createVertexProgramState()
Retrieves the vertex program state object for the proper renderer. |
WireframeState |
createWireframeState()
createWireframeState retrieves the wireframe state object
for the proper renderer. |
ZBufferState |
createZBufferState()
Retrieves the Z buffer state object for the proper renderer. |
void |
displayBackBuffer()
displayBackBuffer swaps the back buffer with the currently
displayed buffer. |
void |
draw(CompositeMesh c)
draw renders a composite mesh to the back buffer. |
void |
draw(Curve c)
draw renders a curve to the back buffer. |
void |
draw(Line l)
draw renders a line to the back buffer. |
void |
draw(Point p)
draw renders a single point to the back buffer. |
void |
draw(Spatial s)
draw renders a scene. |
void |
draw(Text t)
draw renders text to the back buffer. |
void |
draw(TriMesh t)
draw renders a triangle mesh to the back buffer. |
void |
draw(WidgetRenderer wr)
draw renders a Widget that is associated with the
WidgetRenderer object to the back buffer. |
void |
drawBounds(BoundingVolume bv)
drawBounds renders the bounds of a Geometry. |
void |
drawBounds(Geometry g)
drawBounds renders the bounds of a Geometry. |
void |
drawBounds(Spatial s)
drawBounds renders the bounds of a Geometry. |
void |
enableStatistics(boolean value)
If true, statistical upkeep of information is done during rendering. |
ColorRGBA |
getBackgroundColor()
getBackgroundColor retrieves the color used for the window
background. |
Camera |
getCamera()
createCamera retrieves the camera this renderer is using. |
int |
getHeight()
Retrieve the height set on this renderer. |
RenderQueue |
getQueue()
Get the render queue associated with this Renderer. |
java.lang.String |
getStatistics()
Returns statistical data as a String. |
java.lang.StringBuffer |
getStatistics(java.lang.StringBuffer a)
Stores the statistical data into the passed string buffer and returns a when finished. |
int |
getWidth()
Retrieve the width set on this renderer. |
void |
grabScreenContents(java.nio.IntBuffer buff,
int x,
int y,
int w,
int h)
grabScreenContents reads a block of pixels from the
current framebuffer. |
boolean |
isHeadless()
Returns true if the renderer is running in Headless mode (ie. |
boolean |
isProcessingQueue()
Return true if this renderer is in the middle of processing its RenderQueue. |
void |
reinit(int width,
int height)
Reinitialize the renderer with the given width/height. |
void |
setBackgroundColor(ColorRGBA c)
setBackgroundColor sets the color of window. |
void |
setCamera(Camera camera)
setCamera sets the reference to the applications camera
object. |
void |
setHeadless(boolean headless)
Set if the renderer is running in Headless mode. |
void |
setOrtho()
setOrtho sets the display system to be in orthographic
mode. |
void |
setOrthoCenter()
setOrthoCenter sets the display system to be in
orthographic mode. |
boolean |
supportsVBO()
Return true if the system running this supports VBO |
boolean |
takeScreenShot(java.lang.String filename)
takeScreenShot saves the current buffer to a png file. |
void |
unsetOrtho()
unsetOrhto unsets the display system from orthographic
mode back into regular projection mode. |
| Field Detail |
public static final int QUEUE_INHERIT
public static final int QUEUE_SKIP
public static final int QUEUE_OPAQUE
public static final int QUEUE_TRANSPARENT
public static final int QUEUE_ORTHO
| Method Detail |
public void setCamera(Camera camera)
setCamera sets the reference to the applications camera
object.
camera - the camera object to use with this Renderer.public Camera getCamera()
createCamera retrieves the camera this renderer is using.
public Camera createCamera(int width,
int height)
createCamera retrieves a default camera for this renderer.
width - the width of the frame.height - the height of the frame.
public AlphaState createAlphaState()
createAlphaState retrieves the alpha state object for the
proper renderer.
AlphaState object that can make use of the
proper renderer.public AttributeState createAttributeState()
createAttributeState retrieves the attribute saving state
object for the proper renderer.
AttributeState object that can make use of the
proper renderer.public CullState createCullState()
createCullState retrieves the cull state object for the
proper renderer.
CullState object that can make use of the
proper renderer.public DitherState createDitherState()
createDitherState retrieves the dither state object for
the proper renderer.
DitherState object that can make use of the
proper renderer.public FogState createFogState()
createFogState retrieves the fog state object for the
proper renderer.
FogState object that can make use of the
proper renderer.public LightState createLightState()
createLightState retrieves the light state object for the
proper renderer.
LightState object that can make use of the
proper renderer.public MaterialState createMaterialState()
createMaterialState retrieves the material state object
for the proper renderer.
MaterialState object that can make use of the
proper renderer.public ShadeState createShadeState()
createShadeState retrieves the shade state object for the
proper renderer.
ShadeState object that can make use of the
proper renderer.public TextureState createTextureState()
createTextureState retrieves the texture state object for
the proper renderer.
TextureState object that can make use of the
proper renderer.public WireframeState createWireframeState()
createWireframeState retrieves the wireframe state object
for the proper renderer.
WireframeState object that can make use of the
proper renderer.public ZBufferState createZBufferState()
ZBufferState object that can make use of the
proper renderer.public VertexProgramState createVertexProgramState()
VertexProgramState object that can make use of
the proper renderer.public FragmentProgramState createFragmentProgramState()
VertexProgramState object that can make use of
the proper renderer.public GLSLShaderObjectsState createGLSLShaderObjectsState()
createShaderObjectsState retrieves the shader object state
object for the proper renderer.
ShaderObjectsState object that can make use of
the proper renderer.public StencilState createStencilState()
StencilState object that can make use of the
proper renderer.public void enableStatistics(boolean value)
value - Should the renderer keep track of statistical information?public void clearStatistics()
public java.lang.String getStatistics()
public java.lang.StringBuffer getStatistics(java.lang.StringBuffer a)
a - The string buffer to store the result in.
public void setBackgroundColor(ColorRGBA c)
setBackgroundColor sets the color of window. This color
will be shown for any pixel that is not set via typical rendering
operations.
c - the color to set the background to.public ColorRGBA getBackgroundColor()
getBackgroundColor retrieves the color used for the window
background.
public void clearZBuffer()
clearZBuffer clears the depth buffer of the renderer. The
Z buffer allows sorting of pixels by depth or distance from the view
port. Clearing this buffer prepares it for the next frame.
public void clearColorBuffer()
clearBackBuffer clears the back buffer of the renderer.
The backbuffer is the buffer being rendered to before it is displayed to
the screen. Clearing this buffer frees it for rendering the next frame.
public void clearBuffers()
clearBuffers clears both the depth buffer and the back
buffer.
public void clearStrictBuffers()
clearBuffers clears both the depth buffer and the back
buffer restricting the clear to the rectangle defined by the width and
height of the renderer.
public void displayBackBuffer()
displayBackBuffer swaps the back buffer with the currently
displayed buffer. Swapping (page flipping) allows the renderer to display
a prerenderer display without any flickering.
public void setOrtho()
setOrtho sets the display system to be in orthographic
mode. If the system has already been set to orthographic mode a
JmeException is thrown. The origin (0,0) is the bottom
left of the screen.
public void setOrthoCenter()
setOrthoCenter sets the display system to be in
orthographic mode. If the system has already been set to orthographic
mode a JmeException is thrown. The origin (0,0) is the
center of the screen.
public void unsetOrtho()
unsetOrhto unsets the display system from orthographic
mode back into regular projection mode. If the system is not in
orthographic mode a JmeException is thrown.
public boolean takeScreenShot(java.lang.String filename)
takeScreenShot saves the current buffer to a png file. The
filename is provided, .png will be appended to the end of the name.
filename - the name of the screenshot file.
public void grabScreenContents(java.nio.IntBuffer buff,
int x,
int y,
int w,
int h)
grabScreenContents reads a block of pixels from the
current framebuffer.
buff - a buffer to store contents in.x - -
x starting point of blocky - -
y starting point of blockw - -
width of blockh - -
height of blockpublic void draw(Spatial s)
draw renders a scene. As it recieves a base class of
Spatial the renderer hands off management of the scene to
spatial for it to determine when a Geometry leaf is
reached.
s - the scene to render.public void drawBounds(Spatial s)
drawBounds renders the bounds of a Geometry. As it
recieves a base class of Geometry the renderer hands off
management of the scene to spatial for it to determine when a
Geometry leaf is reached.
s - the Spatial to render bounds for.public void drawBounds(BoundingVolume bv)
drawBounds renders the bounds of a Geometry. As it
recieves a base class of BoundingVolume the renderer hands
off management of the scene to spatial for it to determine when a
Geometry leaf is reached.
bv - the BoundingVolume to render.public void drawBounds(Geometry g)
drawBounds renders the bounds of a Geometry. As it
recieves a base class of Geometry the renderer hands off
management of the scene to spatial for it to determine when a
Geometry leaf is reached.
g - the Geometry to render.public void draw(Point p)
draw renders a single point to the back buffer.
p - the point to be rendered.public void draw(Line l)
draw renders a line to the back buffer.
l - the line to be rendered.public void draw(Curve c)
draw renders a curve to the back buffer.
c - the curve to be rendered.public void draw(Text t)
draw renders text to the back buffer.
t - the text object to be rendered.public void draw(TriMesh t)
draw renders a triangle mesh to the back buffer.
t - the mesh to be rendered.public void draw(CompositeMesh c)
draw renders a composite mesh to the back buffer.
public void draw(WidgetRenderer wr)
draw renders a Widget that is associated with the
WidgetRenderer object to the back buffer.
wr - the WidgetPanel to be rendered.public RenderQueue getQueue()
public boolean isProcessingQueue()
public boolean checkAndAdd(Spatial s)
s - Spatial to check
public boolean supportsVBO()
public boolean isHeadless()
public void setHeadless(boolean headless)
headless - booleanpublic int getWidth()
public int getHeight()
public void reinit(int width,
int height)
width - intheight - int
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||