|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TextureRenderer
TextureRenderer
defines an abstract class 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(...)
DisplaySystem
Nested Class Summary | |
---|---|
static class |
TextureRenderer.Target
|
Method Summary | |
---|---|
void |
cleanup()
Any wrapping up and cleaning up of TextureRenderer information is performed here. |
void |
copyToTexture(Texture tex,
int width,
int height)
copyToTexture copies the current frame buffer contents to
the given Texture. |
ColorRGBA |
getBackgroundColor()
getBackgroundColor retrieves the color used for the window
background. |
Camera |
getCamera()
getCamera retrieves the camera this renderer is using. |
int |
getHeight()
|
int |
getWidth()
|
boolean |
isSupported()
isSupported obtains the capability of the graphics card. |
void |
render(java.util.ArrayList<? extends Spatial> spats,
java.util.ArrayList<Texture> tex)
render renders a scene. |
void |
render(java.util.ArrayList<? extends Spatial> spats,
java.util.ArrayList<Texture> tex,
boolean doClear)
render renders a scene. |
void |
render(Spatial spat,
Texture tex)
render renders a scene. |
void |
render(Spatial spat,
Texture tex,
boolean doClear)
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. |
void |
setMultipleTargets(boolean multi)
Set up this textureRenderer for use with multiple targets. |
void |
setupTexture(Texture2D tex)
setupTexture initializes a Texture object for use with
TextureRenderer. |
Method Detail |
---|
boolean isSupported()
isSupported
obtains the capability of the graphics card.
If the graphics card does not have pbuffer support, false is returned,
otherwise, true is returned. TextureRenderer will not process any
scene elements if pbuffer is not supported.
Camera getCamera()
getCamera
retrieves the camera this renderer is using.
void setCamera(Camera camera)
setCamera
sets the camera this renderer should use.
camera
- the camera this renderer should use.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. The result of the rendering is then copied into the given
texture(s). What is copied is based on the Texture object's rttSource field.
NOTE: If more than one texture is given, copy-texture is used
regardless of card capabilities to decrease render time.
spat
- the scene to render.tex
- the Texture to render it to.void render(Spatial spat, Texture tex, boolean doClear)
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. The result of the rendering is then copied into the given
texture(s). What is copied is based on the Texture object's rttSource field.
NOTE: If more than one texture is given, copy-texture is used
regardless of card capabilities to decrease render time.
spat
- the scene to render.tex
- the Texture to render it to.void render(java.util.ArrayList<? extends Spatial> spats, java.util.ArrayList<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. The result of the rendering is then copied into the given
textures. What is copied is based on the Texture object's rttSource field.
NOTE: If more than one texture is given, copy-texture is used
regardless of card capabilities to decrease render time.
spats
- an array of Spatials to render.tex
- the Texture to render it to.void render(java.util.ArrayList<? extends Spatial> spats, java.util.ArrayList<Texture> tex, boolean doClear)
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. The result of the rendering is then copied into the given
textures. What is copied is based on the Texture object's rttSource field.
NOTE: If more than one texture is given, copy-texture is used
regardless of card capabilities to decrease render time.
spats
- an array of Spatials to render.tex
- the Texture to render it to.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.ColorRGBA getBackgroundColor()
getBackgroundColor
retrieves the color used for the window
background.
void setupTexture(Texture2D tex)
setupTexture
initializes a Texture object for use with
TextureRenderer. Generates a valid gl texture id for this texture and
sets up data storage for it. The texture will be equal to the pbuffer size.
Note that the pbuffer size is not necessarily what is specified in the constructor.
tex
- The texture to setup for use in Texture Rendering.void copyToTexture(Texture tex, int width, int height)
copyToTexture
copies the current frame buffer contents to
the given Texture. What is copied is up to the Texture object's rttSource
field.
tex
- The Texture to copy into.width
- the width of the texture imageheight
- the height of the texture imagevoid cleanup()
void setMultipleTargets(boolean multi)
multi
- true if you plan to use this texture renderer to render
different content to more than one texture.int getWidth()
int getHeight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |