|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.renderer.Renderer
com.jme.system.dummy.DummyRenderer
public final class DummyRenderer
This class makes up a shell renderer with no functionality. It is here to allow the easy creation of renderer-agnostic jME objects (like various RenderState and Spatial) so that they can be used by conversion utilities to read/write jME. It is NOT to be used for rendering as it won't do anything at all.
Nested Class Summary | |
---|---|
(package private) class |
DummyRenderer.TextureStateN
|
Field Summary |
---|
Fields inherited from class com.jme.renderer.Renderer |
---|
backgroundColor, camera, defaultStateList, height, processingQueue, queue, QUEUE_INHERIT, QUEUE_OPAQUE, QUEUE_ORTHO, QUEUE_SKIP, QUEUE_TRANSPARENT, width |
Constructor Summary | |
---|---|
DummyRenderer()
|
Method Summary | |
---|---|
boolean |
checkAndAdd(Spatial s)
Check a given Spatial to see if it should be queued. |
void |
checkCardError()
Check the underlying rendering system (opengl, etc.) for exceptions. |
void |
cleanup()
Perform any necessary cleanup operations such as deleting VBOs, etc. |
void |
clearBuffers()
clearBuffers clears both the depth buffer and the back
buffer. |
void |
clearColorBuffer()
clearBackBuffer clears the back buffer of the renderer. |
void |
clearPolygonOffset()
Removes any previously set offset from the renderer. |
void |
clearStencilBuffer()
clearStencilBuffer clears the stencil buffer of the renderer. |
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 |
clearVBOCache()
Clears all entries from the VBO cache. |
void |
clearZBuffer()
clearZBuffer clears the depth buffer of the renderer. |
BlendState |
createBlendState()
createBlendState retrieves the blend state object for the
proper renderer. |
Camera |
createCamera(int width,
int height)
createCamera retrieves a default camera for this renderer. |
ClipState |
createClipState()
Retrieves the clip state object for the proper renderer. |
ColorMaskState |
createColorMaskState()
Retrieves the color mask state object for the proper renderer. |
CullState |
createCullState()
createCullState retrieves the cull state object for the
proper renderer. |
int |
createDisplayList(Geometry g)
Generate a DisplayList for drawing the given Geometry. |
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. |
StateRecord |
createLineRecord()
|
MaterialState |
createMaterialState()
createMaterialState retrieves the material state object
for the proper renderer. |
StateRecord |
createRendererRecord()
|
ShadeState |
createShadeState()
createShadeState retrieves the shade state object for the
proper renderer. |
StencilState |
createStencilState()
Retrieves the stencil state object for the proper renderer. |
StippleState |
createStippleState()
Retrieves the stipple 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 |
deleteVBO(java.nio.Buffer buffer)
Checks the VBO cache to see if this Buffer is mapped to a VBO-id. |
void |
deleteVBO(int vboid)
Attempts to delete the VBO with this VBO id. |
void |
displayBackBuffer()
displayBackBuffer swaps the back buffer with the currently
displayed buffer. |
void |
draw(Curve c)
draw renders a curve to the back buffer. |
void |
draw(Line line)
draw renders a single Line collection to the back buffer. |
void |
draw(Point point)
draw renders a single Point collection to the back buffer. |
void |
draw(QuadMesh qMesh)
draw renders a single QuadMesh 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 tMesh)
draw renders a single TriMesh to the back buffer. |
void |
finish()
finish is similar to flush, however it blocks until all
waiting OpenGL commands have been finished. |
void |
flush()
flush tells opengl to send through all currently waiting
commands in the buffer. |
ColorRGBA |
getBackgroundColor()
getBackgroundColor retrieves the clear color of the
current OpenGL context. |
int |
getHeight()
Retrieve the height set on this renderer. |
RenderQueue |
getQueue()
Get the render queue associated with this Renderer. |
int |
getWidth()
Retrieve the width set on this renderer. |
void |
grabScreenContents(java.nio.ByteBuffer buff,
Image.Format format,
int x,
int y,
int w,
int h)
grabScreenContents reads a block of data as bytes from the
current framebuffer. |
boolean |
isHeadless()
See Renderer.isHeadless() |
boolean |
isInOrthoMode()
|
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 |
releaseDisplayList(int listId)
Releases a DisplayList from the card. |
java.lang.Integer |
removeFromVBOCache(java.nio.Buffer buffer)
Removes the mapping between this Buffer and it's VBO-id. |
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)
See Renderer.setHeadless() |
void |
setOrtho()
setOrtho sets the display system to be in orthographic
mode. |
void |
setOrthoCenter()
setOrthoCenter sets the display system to be in
orthographic mode. |
void |
setPolygonOffset(float factor,
float offset)
Sets an offset to the zbuffer to be used when comparing an incoming polygon for depth buffer pass/fail. |
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. |
void |
updateTextureSubImage(Texture dstTexture,
int dstX,
int dstY,
Image srcImage,
int srcX,
int srcY,
int width,
int height)
Updates a region of the content area of the provided texture using the specified region of the given data. |
Methods inherited from class com.jme.renderer.Renderer |
---|
clearQueue, createState, createState, getCamera, renderQueue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DummyRenderer()
Method Detail |
---|
public void setCamera(Camera camera)
Renderer
setCamera
sets the reference to the applications camera
object.
setCamera
in class Renderer
camera
- the camera object to use with this Renderer
.public Camera createCamera(int width, int height)
Renderer
createCamera
retrieves a default camera for this renderer.
createCamera
in class Renderer
width
- the width of the frame.height
- the height of the frame.
public BlendState createBlendState()
Renderer
createBlendState
retrieves the blend state object for the
proper renderer.
createBlendState
in class Renderer
BlendState
object that can make use of the
proper renderer.public void flush()
Renderer
flush
tells opengl to send through all currently waiting
commands in the buffer.
flush
in class Renderer
public void finish()
Renderer
finish
is similar to flush, however it blocks until all
waiting OpenGL commands have been finished.
finish
in class Renderer
public CullState createCullState()
Renderer
createCullState
retrieves the cull state object for the
proper renderer.
createCullState
in class Renderer
CullState
object that can make use of the
proper renderer.public FogState createFogState()
Renderer
createFogState
retrieves the fog state object for the
proper renderer.
createFogState
in class Renderer
FogState
object that can make use of the
proper renderer.public LightState createLightState()
Renderer
createLightState
retrieves the light state object for the
proper renderer.
createLightState
in class Renderer
LightState
object that can make use of the
proper renderer.public MaterialState createMaterialState()
Renderer
createMaterialState
retrieves the material state object
for the proper renderer.
createMaterialState
in class Renderer
MaterialState
object that can make use of the
proper renderer.public ShadeState createShadeState()
Renderer
createShadeState
retrieves the shade state object for the
proper renderer.
createShadeState
in class Renderer
ShadeState
object that can make use of the
proper renderer.public TextureState createTextureState()
Renderer
createTextureState
retrieves the texture state object for
the proper renderer.
createTextureState
in class Renderer
TextureState
object that can make use of the
proper renderer.public WireframeState createWireframeState()
Renderer
createWireframeState
retrieves the wireframe state object
for the proper renderer.
createWireframeState
in class Renderer
WireframeState
object that can make use of the
proper renderer.public ZBufferState createZBufferState()
Renderer
createZBufferState
in class Renderer
ZBufferState
object that can make use of the
proper renderer.public VertexProgramState createVertexProgramState()
Renderer
createVertexProgramState
in class Renderer
VertexProgramState
object that can make use of
the proper renderer.public FragmentProgramState createFragmentProgramState()
Renderer
createFragmentProgramState
in class Renderer
VertexProgramState
object that can make use of
the proper renderer.public GLSLShaderObjectsState createGLSLShaderObjectsState()
Renderer
createShaderObjectsState
retrieves the shader object state
object for the proper renderer.
createGLSLShaderObjectsState
in class Renderer
ShaderObjectsState
object that can make use of
the proper renderer.public StencilState createStencilState()
Renderer
createStencilState
in class Renderer
StencilState
object that can make use of the
proper renderer.public ClipState createClipState()
Renderer
createClipState
in class Renderer
ClipState
object that can make use of the
proper renderer.public ColorMaskState createColorMaskState()
Renderer
createColorMaskState
in class Renderer
ColorMaskState
object that can make use of the
proper renderer.public StippleState createStippleState()
Renderer
createStippleState
in class Renderer
StippleState
object that can make use of the
proper renderer.public void setBackgroundColor(ColorRGBA c)
Renderer
setBackgroundColor
sets the color of window. This color
will be shown for any pixel that is not set via typical rendering
operations.
setBackgroundColor
in class Renderer
c
- the color to set the background to.public ColorRGBA getBackgroundColor()
Renderer
getBackgroundColor
retrieves the clear color of the
current OpenGL context.
getBackgroundColor
in class Renderer
Renderer.getBackgroundColor()
public void clearZBuffer()
Renderer
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.
clearZBuffer
in class Renderer
public void clearColorBuffer()
Renderer
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.
clearColorBuffer
in class Renderer
public void clearStencilBuffer()
Renderer
clearStencilBuffer
clears the stencil buffer of the renderer.
clearStencilBuffer
in class Renderer
public void clearBuffers()
Renderer
clearBuffers
clears both the depth buffer and the back
buffer.
clearBuffers
in class Renderer
public void clearStrictBuffers()
Renderer
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.
clearStrictBuffers
in class Renderer
public void displayBackBuffer()
Renderer
displayBackBuffer
swaps the back buffer with the currently
displayed buffer. Swapping (page flipping) allows the renderer to display
a prerenderer display without any flickering.
displayBackBuffer
in class Renderer
public void setOrtho()
Renderer
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.
setOrtho
in class Renderer
public void setOrthoCenter()
Renderer
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.
setOrthoCenter
in class Renderer
public void unsetOrtho()
Renderer
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.
unsetOrtho
in class Renderer
public boolean takeScreenShot(java.lang.String filename)
Renderer
takeScreenShot
saves the current buffer to a png file. The
filename is provided, .png will be appended to the end of the name.
takeScreenShot
in class Renderer
filename
- the name of the screenshot file.
public void grabScreenContents(java.nio.ByteBuffer buff, Image.Format format, int x, int y, int w, int h)
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.
grabScreenContents
in class Renderer
buff
- 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 blockpublic void draw(Spatial s)
Renderer
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.
draw
in class Renderer
s
- the scene to render.public void draw(Point point)
Renderer
draw
renders a single Point collection to the back buffer.
draw
in class Renderer
point
- the points to be rendered.public void draw(Line line)
Renderer
draw
renders a single Line collection to the back buffer.
draw
in class Renderer
line
- the line to be rendered.public void draw(Curve c)
Renderer
draw
renders a curve to the back buffer.
draw
in class Renderer
c
- the curve to be rendered.public void draw(Text t)
Renderer
draw
renders text to the back buffer.
draw
in class Renderer
t
- the text object to be rendered.public RenderQueue getQueue()
Renderer
getQueue
in class Renderer
public boolean isProcessingQueue()
Renderer
isProcessingQueue
in class Renderer
public boolean checkAndAdd(Spatial s)
Renderer
checkAndAdd
in class Renderer
s
- Spatial to check
public boolean supportsVBO()
Renderer
supportsVBO
in class Renderer
public boolean isHeadless()
Renderer
isHeadless
in class Renderer
public void setHeadless(boolean headless)
Renderer
setHeadless
in class Renderer
public int getWidth()
Renderer
getWidth
in class Renderer
public int getHeight()
Renderer
getHeight
in class Renderer
public void reinit(int width, int height)
Renderer
reinit
in class Renderer
width
- intheight
- intpublic int createDisplayList(Geometry g)
Renderer
createDisplayList
in class Renderer
g
- the geometry to make a display list for
public void releaseDisplayList(int listId)
Renderer
releaseDisplayList
in class Renderer
listId
- the id of the display list to releasepublic void setPolygonOffset(float factor, float offset)
Renderer
setPolygonOffset
in class Renderer
factor
- Specifies a scale factor that is used to create a variable
depth offset for each polygon. The initial value is 0.offset
- Is multiplied by an implementation-specific value to create a
constant depth offset. The initial value is 0.public void clearPolygonOffset()
Renderer
clearPolygonOffset
in class Renderer
public void deleteVBO(java.nio.Buffer buffer)
Renderer
deleteVBO
in class Renderer
buffer
- The Buffer who's associated VBO should be deleted.public void deleteVBO(int vboid)
Renderer
deleteVBO
in class Renderer
public void clearVBOCache()
Renderer
clearVBOCache
in class Renderer
public java.lang.Integer removeFromVBOCache(java.nio.Buffer buffer)
Renderer
removeFromVBOCache
in class Renderer
buffer
- The nio Buffer whose associated VBO should be deleted.
public void draw(TriMesh tMesh)
Renderer
draw
renders a single TriMesh to the back buffer.
draw
in class Renderer
tMesh
- the mesh to be rendered.public void draw(QuadMesh qMesh)
Renderer
draw
renders a single QuadMesh to the back buffer.
draw
in class Renderer
qMesh
- the mesh to be rendered.public StateRecord createLineRecord()
createLineRecord
in class Renderer
public StateRecord createRendererRecord()
createRendererRecord
in class Renderer
public void checkCardError() throws JmeException
Renderer
checkCardError
in class Renderer
JmeException
- if an error is found.public void cleanup()
Renderer
cleanup
in class Renderer
public boolean isInOrthoMode()
isInOrthoMode
in class Renderer
public void updateTextureSubImage(Texture dstTexture, int dstX, int dstY, Image srcImage, int srcX, int srcY, int width, int height) throws JmeException, java.lang.UnsupportedOperationException
Renderer
updateTextureSubImage
in class Renderer
dstTexture
- the texture to be updateddstX
- the x offset relative to the lower-left corner of this texture
where the update will be applieddstY
- the y offset relative to the lower-left corner of this texture
where the update will be appliedsrcImage
- the image data to be uploaded to the texturesrcX
- the x offset relative to the lower-left corner of the supplied
buffer from which to fetch the update rectanglesrcY
- the y offset relative to the lower-left corner of the supplied
buffer from which to fetch the update rectanglewidth
- the width of the region to be updatedheight
- the height of the region to be updated
JmeException
- if unable to update the texture
java.lang.UnsupportedOperationException
- if updating for the provided texture type is unsupportedcom.sun.opengl.util.texture.Texture#updateSubImage(com.sun.opengl.util.texture.TextureData,
int, int, int, int, int, int, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |