|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.renderer.lwjgl.LWJGLRenderer
LWJGLRenderer provides an implementation of the
Renderer interface using the LWJGL API.
Renderer| Field Summary |
| Fields inherited from interface com.jme.renderer.Renderer |
QUEUE_INHERIT, QUEUE_OPAQUE, QUEUE_ORTHO, QUEUE_SKIP, QUEUE_TRANSPARENT |
| Constructor Summary | |
LWJGLRenderer(int width,
int height)
Constructor instantiates a new LWJGLRenderer object. |
|
| Method Summary | |
boolean |
checkAndAdd(Spatial s)
Check a given Spatial to see if it should be queued. |
void |
clearBuffers()
clearBuffers clears both the color and the depth buffer. |
void |
clearColorBuffer()
clearBackBuffer clears the OpenGL color buffer. |
void |
clearStatistics()
clearStatistics resets the vertices and triangles counter
for the statistics information. |
void |
clearStrictBuffers()
clearBuffers clears both the color and the depth buffer
for only the part of the buffer defined by the renderer width/height. |
void |
clearZBuffer()
clearZBuffer clears the OpenGL depth buffer. |
AlphaState |
createAlphaState()
createAlphaState returns a new LWJGLAlphaState object as a
regular AlphaState. |
AttributeState |
createAttributeState()
createAttributeState returns a new LWJGLAttributeState
object as a regular AttributeState. |
Camera |
createCamera(int width,
int height)
createCamera returns a default camera for use with the
LWJGL renderer. |
CullState |
createCullState()
createCullState returns a new LWJGLCullState object as a
regular CullState. |
DitherState |
createDitherState()
createDitherState returns a new LWJGLDitherState object as
a regular DitherState. |
FogState |
createFogState()
createFogState returns a new LWJGLFogState object as a
regular FogState. |
FragmentProgramState |
createFragmentProgramState()
createFragmentProgramState returns a new
LWJGLFragmentProgramState object as a regular FragmentProgramState. |
GLSLShaderObjectsState |
createGLSLShaderObjectsState()
createShaderObjectsState returns a new
LWJGLShaderObjectsState object as a regular ShaderObjectsState. |
LightState |
createLightState()
createLightState returns a new LWJGLLightState object as a
regular LightState. |
MaterialState |
createMaterialState()
createMaterialState returns a new LWJGLMaterialState
object as a regular MaterialState. |
ShadeState |
createShadeState()
createShadeState returns a new LWJGLShadeState object as a
regular ShadeState. |
StencilState |
createStencilState()
createStencilState returns a new LWJGLStencilState object
as a regular StencilState. |
TextureState |
createTextureState()
createTextureState returns a new LWJGLTextureState object
as a regular TextureState. |
VertexProgramState |
createVertexProgramState()
createVertexProgramState returns a new
LWJGLVertexProgramState object as a regular VertexProgramState. |
WireframeState |
createWireframeState()
createWireframeState returns a new LWJGLWireframeState
object as a regular WireframeState. |
ZBufferState |
createZBufferState()
createZBufferState returns a new LWJGLZBufferState object
as a regular ZBufferState. |
void |
displayBackBuffer()
displayBackBuffer renders any queued items then flips the
rendered buffer (back) with the currently displayed buffer. |
void |
draw(CompositeMesh t)
draw renders a CompositeMesh object
including it's normals, colors, textures and vertices. |
void |
draw(Curve c)
draw renders a curve object. |
void |
draw(Line l)
draw draws a line object where a line contains a
collection of vertices, normals, colors and texture coordinates. |
void |
draw(Point p)
draw draws a point object where a point contains a
collection of vertices, normals, colors and texture coordinates. |
void |
draw(Spatial s)
draw renders a scene by calling the nodes
onDraw method. |
void |
draw(Text t)
draw renders a text object using a predefined font. |
void |
draw(TriMesh t)
draw renders a TriMesh object including
it's normals, colors, textures and vertices. |
void |
draw(WidgetRenderer wr)
draw renders a WidgetRenderer object to the back buffer. |
void |
drawBounds(BoundingVolume bv)
draw renders a TriMesh object including
it's normals, colors, textures and vertices. |
void |
drawBounds(Geometry g)
draw renders a TriMesh object including
it's normals, colors, textures and vertices. |
void |
drawBounds(Spatial s)
drawBounds renders a scene by calling the nodes
onDraw method. |
void |
enableStatistics(boolean value)
enableStatistics will turn on statistics gathering. |
ColorRGBA |
getBackgroundColor()
getBackgroundColor retrieves the clear color of the
current OpenGL context. |
Camera |
getCamera()
getCamera returns the camera used by this renderer. |
int |
getHeight()
Retrieve the height set on this renderer. |
RenderQueue |
getQueue()
Get the render queue associated with this Renderer. |
java.lang.String |
getStatistics()
getStatistics returns a string value of the rendering
statistics information (number of triangles and number of vertices). |
java.lang.StringBuffer |
getStatistics(java.lang.StringBuffer a)
getStatistics returns a string value of the rendering
statistics information (number of triangles and number of vertices). |
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()
See Renderer.isHeadless() |
boolean |
isProcessingQueue()
Return true if this renderer is in the middle of processing its RenderQueue. |
void |
prepVBO(Geometry g)
|
void |
reinit(int width,
int height)
Reinitialize the renderer with the given width/height. |
void |
setBackgroundColor(ColorRGBA c)
setBackgroundColor sets the OpenGL clear color to the
color specified. |
void |
setCamera(Camera camera)
setCamera sets the camera this renderer is using. |
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. |
boolean |
supportsVBO()
Return true if the system running this supports VBO |
boolean |
takeScreenShot(java.lang.String filename)
takeScreenShot saves the current buffer to a file. |
void |
unsetOrtho()
unsetOrhto unsets the display system from orthographic
mode back into regular projection mode. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LWJGLRenderer(int width,
int height)
LWJGLRenderer object. The
size of the rendering window is passed during construction.
width - the width of the rendering context.height - the height of the rendering context.| Method Detail |
public void reinit(int width,
int height)
reinit in interface Rendererwidth - intheight - intpublic void setCamera(Camera camera)
setCamera sets the camera this renderer is using. It
asserts that the camera is of type LWJGLCamera.
setCamera in interface Renderercamera - the camera object to use with this Renderer.Renderer.setCamera(com.jme.renderer.Camera)public Camera getCamera()
getCamera returns the camera used by this renderer.
getCamera in interface RendererRenderer.getCamera()
public Camera createCamera(int width,
int height)
createCamera returns a default camera for use with the
LWJGL renderer.
createCamera in interface Rendererwidth - the width of the frame.height - the height of the frame.
public AlphaState createAlphaState()
createAlphaState returns a new LWJGLAlphaState object as a
regular AlphaState.
createAlphaState in interface Rendererpublic AttributeState createAttributeState()
createAttributeState returns a new LWJGLAttributeState
object as a regular AttributeState.
createAttributeState in interface Rendererpublic CullState createCullState()
createCullState returns a new LWJGLCullState object as a
regular CullState.
createCullState in interface RendererRenderer.createCullState()public DitherState createDitherState()
createDitherState returns a new LWJGLDitherState object as
a regular DitherState.
createDitherState in interface Rendererpublic FogState createFogState()
createFogState returns a new LWJGLFogState object as a
regular FogState.
createFogState in interface Rendererpublic LightState createLightState()
createLightState returns a new LWJGLLightState object as a
regular LightState.
createLightState in interface Rendererpublic MaterialState createMaterialState()
createMaterialState returns a new LWJGLMaterialState
object as a regular MaterialState.
createMaterialState in interface Rendererpublic ShadeState createShadeState()
createShadeState returns a new LWJGLShadeState object as a
regular ShadeState.
createShadeState in interface Rendererpublic TextureState createTextureState()
createTextureState returns a new LWJGLTextureState object
as a regular TextureState.
createTextureState in interface Rendererpublic WireframeState createWireframeState()
createWireframeState returns a new LWJGLWireframeState
object as a regular WireframeState.
createWireframeState in interface Rendererpublic ZBufferState createZBufferState()
createZBufferState returns a new LWJGLZBufferState object
as a regular ZBufferState.
createZBufferState in interface Rendererpublic VertexProgramState createVertexProgramState()
createVertexProgramState returns a new
LWJGLVertexProgramState object as a regular VertexProgramState.
createVertexProgramState in interface Rendererpublic FragmentProgramState createFragmentProgramState()
createFragmentProgramState returns a new
LWJGLFragmentProgramState object as a regular FragmentProgramState.
createFragmentProgramState in interface Rendererpublic GLSLShaderObjectsState createGLSLShaderObjectsState()
createShaderObjectsState returns a new
LWJGLShaderObjectsState object as a regular ShaderObjectsState.
createGLSLShaderObjectsState in interface Rendererpublic StencilState createStencilState()
createStencilState returns a new LWJGLStencilState object
as a regular StencilState.
createStencilState in interface Rendererpublic void setBackgroundColor(ColorRGBA c)
setBackgroundColor sets the OpenGL clear color to the
color specified.
setBackgroundColor in interface Rendererc - the color to set the background color to.Renderer.setBackgroundColor(com.jme.renderer.ColorRGBA)public ColorRGBA getBackgroundColor()
getBackgroundColor retrieves the clear color of the
current OpenGL context.
getBackgroundColor in interface RendererRenderer.getBackgroundColor()public void clearZBuffer()
clearZBuffer clears the OpenGL depth buffer.
clearZBuffer in interface RendererRenderer.clearZBuffer()public void clearColorBuffer()
clearBackBuffer clears the OpenGL color buffer.
clearColorBuffer in interface Renderercom.jme.renderer.Renderer#clearBackBuffer()public void clearBuffers()
clearBuffers clears both the color and the depth buffer.
clearBuffers in interface RendererRenderer.clearBuffers()public void clearStrictBuffers()
clearBuffers clears both the color and the depth buffer
for only the part of the buffer defined by the renderer width/height.
clearStrictBuffers in interface RendererRenderer.clearBuffers()public void displayBackBuffer()
displayBackBuffer renders any queued items then flips the
rendered buffer (back) with the currently displayed buffer.
displayBackBuffer in interface RendererRenderer.displayBackBuffer()public void setOrtho()
RenderersetOrtho 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 interface Rendererpublic void setOrthoCenter()
RenderersetOrthoCenter 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 interface Rendererpublic void unsetOrtho()
RendererunsetOrhto 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 interface Rendererpublic boolean takeScreenShot(java.lang.String filename)
takeScreenShot saves the current buffer to a file. The
file name is provided, and .png will be appended. True is returned if the
capture was successful, false otherwise.
takeScreenShot in interface Rendererfilename - the name of the file to save.
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.
grabScreenContents in interface Rendererbuff - 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(Point p)
draw draws a point object where a point contains a
collection of vertices, normals, colors and texture coordinates.
draw in interface Rendererp - the point object to render.Renderer.draw(com.jme.scene.Point)public void draw(Line l)
draw draws a line object where a line contains a
collection of vertices, normals, colors and texture coordinates.
draw in interface Rendererl - the line object to render.Renderer.draw(com.jme.scene.Line)public void draw(Curve c)
draw renders a curve object.
draw in interface Rendererc - the curve object to render.public void draw(TriMesh t)
draw renders a TriMesh object including
it's normals, colors, textures and vertices.
draw in interface Renderert - the mesh to render.Renderer.draw(com.jme.scene.TriMesh)public void draw(CompositeMesh t)
draw renders a CompositeMesh object
including it's normals, colors, textures and vertices.
draw in interface Renderert - the mesh to render.Renderer.draw(com.jme.scene.CompositeMesh)public void prepVBO(Geometry g)
public void drawBounds(Geometry g)
draw renders a TriMesh object including
it's normals, colors, textures and vertices.
drawBounds in interface Rendererg - the mesh to render.Renderer.draw(com.jme.scene.TriMesh)public void drawBounds(BoundingVolume bv)
draw renders a TriMesh object including
it's normals, colors, textures and vertices.
drawBounds in interface Rendererbv - the mesh to render.Renderer.draw(com.jme.scene.TriMesh)public void draw(Spatial s)
draw renders a scene by calling the nodes
onDraw method.
draw in interface Renderers - the scene to render.Renderer.draw(com.jme.scene.Spatial)public void drawBounds(Spatial s)
drawBounds renders a scene by calling the nodes
onDraw method.
drawBounds in interface Renderers - the Spatial to render bounds for.Renderer.draw(com.jme.scene.Spatial)public void draw(Text t)
draw renders a text object using a predefined font.
draw in interface Renderert - the text object to be rendered.Renderer.draw(com.jme.scene.Text)public void draw(WidgetRenderer wr)
draw renders a WidgetRenderer object to the back buffer.
draw in interface Rendererwr - the WidgetPanel to be rendered.Renderer.draw(WidgetRenderer)public void enableStatistics(boolean value)
enableStatistics will turn on statistics gathering.
enableStatistics in interface Renderervalue - true to use statistics, false otherwise.public void clearStatistics()
clearStatistics resets the vertices and triangles counter
for the statistics information.
clearStatistics in interface Rendererpublic java.lang.String getStatistics()
getStatistics returns a string value of the rendering
statistics information (number of triangles and number of vertices).
getStatistics in interface Rendererpublic java.lang.StringBuffer getStatistics(java.lang.StringBuffer a)
getStatistics returns a string value of the rendering
statistics information (number of triangles and number of vertices).
getStatistics in interface Renderera - The string buffer to store the result in.
public boolean isHeadless()
isHeadless in interface Rendererpublic void setHeadless(boolean headless)
setHeadless in interface Rendererheadless - boolean
public boolean checkAndAdd(Spatial s)
Renderer
checkAndAdd in interface Renderers - Spatial to check
public RenderQueue getQueue()
Renderer
getQueue in interface Rendererpublic boolean isProcessingQueue()
Renderer
isProcessingQueue in interface Rendererpublic boolean supportsVBO()
supportsVBO in interface Rendererpublic int getWidth()
Renderer
getWidth in interface Rendererpublic int getHeight()
Renderer
getHeight in interface Renderer
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||