com.jme.renderer
Interface TextureRenderer

All Known Implementing Classes:
LWJGLTextureRenderer

public interface TextureRenderer

TextureRenderer defines an interface that handles rendering a scene to a buffer and copying it to a texture. Creation of this object is typically handled via a call to a DisplaySystem subclass. Example Usage:
NOTE: This example uses the DisplaySystem class to obtain the TextureRenderer. DisplaySystem.getDisplaySystem().createTextureRenderer(...)

Version:
$Id: TextureRenderer.java,v 1.8 2004/07/31 16:32:41 cep21 Exp $
Author:
Joshua Slack
See Also:
DisplaySystem

Field Summary
static int RENDER_TEXTURE_1D
          defines a constant for usage of a one dimensional texture.
static int RENDER_TEXTURE_2D
          defines a constant for usage of a two dimensional texture.
static int RENDER_TEXTURE_CUBE_MAP
          defines a constant for usage of a cubic texture.
static int RENDER_TEXTURE_RECTANGLE
          defines a constant for usage of a rectangular texture.
 
Method Summary
 void cleanup()
          Any wrapping up and cleaning up of TextureRenderer information is performed here.
 ColorRGBA getBackgroundColor()
          getBackgroundColor retrieves the color used for the window background.
 Camera getCamera()
          getCamera retrieves the camera this renderer is using.
 void render(Spatial spat, Texture tex)
          render renders a scene.
 void setBackgroundColor(ColorRGBA c)
          setBackgroundColor sets the color of window.
 void setCamera(Camera camera)
          setCamera sets the camera this renderer should use.
 Texture setupTexture()
          setupTexture generates a new Texture object for use with TextureRenderer.
 Texture setupTexture(int glTextureID)
          setupTexture retrieves the color used for the window background.
 void updateCamera()
          updateCamera updates the camera in the pbuffer context.
 

Field Detail

RENDER_TEXTURE_1D

public static final int RENDER_TEXTURE_1D
defines a constant for usage of a one dimensional texture.

See Also:
Constant Field Values

RENDER_TEXTURE_2D

public static final int RENDER_TEXTURE_2D
defines a constant for usage of a two dimensional texture.

See Also:
Constant Field Values

RENDER_TEXTURE_RECTANGLE

public static final int RENDER_TEXTURE_RECTANGLE
defines a constant for usage of a rectangular texture.

See Also:
Constant Field Values

RENDER_TEXTURE_CUBE_MAP

public static final int RENDER_TEXTURE_CUBE_MAP
defines a constant for usage of a cubic texture.

See Also:
Constant Field Values
Method Detail

getCamera

public Camera getCamera()
getCamera retrieves the camera this renderer is using.

Returns:
the camera this renderer is using.

setCamera

public void setCamera(Camera camera)
setCamera sets the camera this renderer should use.

Parameters:
camera - the camera this renderer should use.

updateCamera

public void updateCamera()
updateCamera updates the camera in the pbuffer context.


render

public void render(Spatial spat,
                   Texture tex)
render 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. All of this is done in the context of the underlying texture buffer.

Parameters:
spat - the scene to render.
tex - the Texture to render it to.

setBackgroundColor

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.

Parameters:
c - the color to set the background to.

getBackgroundColor

public ColorRGBA getBackgroundColor()
getBackgroundColor retrieves the color used for the window background.

Returns:
the background color that is currently set to the background.

setupTexture

public Texture setupTexture()
setupTexture generates a new Texture object for use with TextureRenderer. Generates a valid gl texture id for this texture.

Returns:
the new Texture

setupTexture

public Texture setupTexture(int glTextureID)
setupTexture retrieves the color used for the window background.

Parameters:
glTextureID - a valid gl texture id to use
Returns:
the new Texture

cleanup

public void cleanup()
Any wrapping up and cleaning up of TextureRenderer information is performed here.