com.jme.renderer.lwjgl
Class LWJGLTextureRenderer

java.lang.Object
  extended bycom.jme.renderer.lwjgl.LWJGLTextureRenderer
All Implemented Interfaces:
TextureRenderer

public class LWJGLTextureRenderer
extends java.lang.Object
implements TextureRenderer

This class is used by LWJGL to render textures. Users should not create this class directly. Instead, allow DisplaySystem to create it for you.

Version:
$Id: LWJGLTextureRenderer.java,v 1.14 2005/04/04 19:10:58 renanse Exp $
Author:
Joshua Slack
See Also:
DisplaySystem.createTextureRenderer(int, int, boolean, boolean, boolean, boolean, int, int)

Field Summary
 
Fields inherited from interface com.jme.renderer.TextureRenderer
RENDER_TEXTURE_1D, RENDER_TEXTURE_2D, RENDER_TEXTURE_CUBE_MAP, RENDER_TEXTURE_RECTANGLE
 
Constructor Summary
LWJGLTextureRenderer(int width, int height, LWJGLRenderer parentRenderer, org.lwjgl.opengl.RenderTexture texture)
           
 
Method Summary
 void activate()
           
 void cleanup()
          Any wrapping up and cleaning up of TextureRenderer information is performed here.
 void deactivate()
           
 ColorRGBA getBackgroundColor()
          getBackgroundColor retrieves the clear color of the current OpenGL context.
 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 OpenGL clear color to the color specified.
 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 generates a new Texture object for use with TextureRenderer.
 void updateCamera()
          updateCamera updates the camera in the pbuffer context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LWJGLTextureRenderer

public LWJGLTextureRenderer(int width,
                            int height,
                            LWJGLRenderer parentRenderer,
                            org.lwjgl.opengl.RenderTexture texture)
Method Detail

getCamera

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

Specified by:
getCamera in interface TextureRenderer
Returns:
the camera this renderer is using.

setCamera

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

Specified by:
setCamera in interface TextureRenderer
Parameters:
camera - the camera this renderer should use.

setBackgroundColor

public void setBackgroundColor(ColorRGBA c)
setBackgroundColor sets the OpenGL clear color to the color specified.

Specified by:
setBackgroundColor in interface TextureRenderer
Parameters:
c - the color to set the background color to.
See Also:
TextureRenderer.setBackgroundColor(com.jme.renderer.ColorRGBA)

getBackgroundColor

public ColorRGBA getBackgroundColor()
getBackgroundColor retrieves the clear color of the current OpenGL context.

Specified by:
getBackgroundColor in interface TextureRenderer
Returns:
the current clear color.
See Also:
Renderer.getBackgroundColor()

setupTexture

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

Specified by:
setupTexture in interface TextureRenderer
Returns:
the new Texture

setupTexture

public Texture setupTexture(int glTextureID)
setupTexture generates a new Texture object for use with TextureRenderer.

Specified by:
setupTexture in interface TextureRenderer
Parameters:
glTextureID - a valid gl texture id to use
Returns:
the new Texture

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.

Specified by:
render in interface TextureRenderer
Parameters:
spat - the scene to render.
tex - the Texture to render it to.

activate

public void activate()

deactivate

public void deactivate()

updateCamera

public void updateCamera()
Description copied from interface: TextureRenderer
updateCamera updates the camera in the pbuffer context.

Specified by:
updateCamera in interface TextureRenderer

cleanup

public void cleanup()
Description copied from interface: TextureRenderer
Any wrapping up and cleaning up of TextureRenderer information is performed here.

Specified by:
cleanup in interface TextureRenderer