Package com.ardor3d.renderer.jogl
Class JoglTextureRenderer
java.lang.Object
com.ardor3d.renderer.AbstractFBOTextureRenderer
com.ardor3d.renderer.jogl.JoglTextureRenderer
- All Implemented Interfaces:
TextureRenderer
This class is used by Ardor3D's JOGL implementation to render textures. Users should not create this class directly.
- See Also:
-
Field Summary
Fields inherited from class com.ardor3d.renderer.AbstractFBOTextureRenderer
_active, _attachBuffer, _backgroundColor, _camera, _depthBits, _depthRBID, _enforcedStates, _fboID, _height, _mscolorRBID, _msdepthRBID, _msfboID, _neededClip, _parentRenderer, _samples, _supportsDepthTexture, _supportsMultisample, _usingDepthRB, _width
-
Constructor Summary
ConstructorDescriptionJoglTextureRenderer
(int width, int height, int depthBits, int samples, Renderer parentRenderer, ContextCapabilities caps) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate()
protected void
static void
checkFBOComplete
(int fboID) Check the currently bound FBO status for completeness.void
cleanup()
Any wrapping up and cleaning up of TextureRenderer information is performed here.protected void
clearBuffers
(int clear) void
copyToTexture
(Texture tex, int x, int y, int width, int height, int xoffset, int yoffset) copyToTexture
copies the current frame buffer contents to the given Texture.protected void
void
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.void
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.void
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.protected void
setMSFBO()
protected void
void
setupTexture
(Texture tex) setupTexture
initializes a new Texture object for use with TextureRenderer.protected void
Methods inherited from class com.ardor3d.renderer.AbstractFBOTextureRenderer
clearEnforcedState, clearEnforcedStates, doDraw, doDraw, doDraw, enforceState, enforceStates, getBackgroundColor, getCamera, getHeight, getParentRenderer, getWidth, render, render, render, setBackgroundColor, setMultipleTargets, switchCameraIn, switchCameraOut
-
Constructor Details
-
JoglTextureRenderer
public JoglTextureRenderer(int width, int height, int depthBits, int samples, Renderer parentRenderer, ContextCapabilities caps)
-
-
Method Details
-
setupTexture
setupTexture
initializes a new Texture object for use with TextureRenderer. Generates a valid OpenGL texture id for this texture and initializes the data type for the texture.- Parameters:
tex
- The texture to setup for use in Texture Rendering. This should be of type Texture2D or TextureCubeMap.
-
render
Description copied from interface:TextureRenderer
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.- Parameters:
spat
- the scene to render.texs
- a list of Textures to render to. These should be of type Texture2D or TextureCubeMap. If the latter, its currentRTTFace will determine which cube face is drawn to.clear
- which buffers to clear before rendering, if any.- See Also:
-
render
Description copied from interface:TextureRenderer
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.- Parameters:
spat
- an array of Spatials to render.texs
- a list of Textures to render to. These should be of type Texture2D or TextureCubeMap. If the latter, its currentRTTFace will determine which cube face is drawn to.clear
- which buffers to clear before rendering, if any.- See Also:
-
render
Description copied from interface:TextureRenderer
NOTE: If more than one texture is given, copy-texture is used regardless of card capabilities to decrease render time.- Parameters:
scene
- the scene to render.texs
- a list of Textures to render to. These should be of type Texture2D or TextureCubeMap. If the latter, its currentRTTFace will determine which cube face is drawn to.clear
- which buffers to clear before rendering, if any.- See Also:
-
setupForSingleTexDraw
- Specified by:
setupForSingleTexDraw
in classAbstractFBOTextureRenderer
-
takedownForSingleTexDraw
- Specified by:
takedownForSingleTexDraw
in classAbstractFBOTextureRenderer
-
setMSFBO
protected void setMSFBO()- Specified by:
setMSFBO
in classAbstractFBOTextureRenderer
-
blitMSFBO
protected void blitMSFBO()- Specified by:
blitMSFBO
in classAbstractFBOTextureRenderer
-
checkFBOComplete
public static void checkFBOComplete(int fboID) Check the currently bound FBO status for completeness. The passed in fboID is for informational purposes only.- Parameters:
fboID
- an id to use for log messages, particularly if there are any issues.
-
copyToTexture
public void copyToTexture(Texture tex, int x, int y, int width, int height, int xoffset, int yoffset) Description copied from interface:TextureRenderer
copyToTexture
copies the current frame buffer contents to the given Texture. What is copied is based on the rttFormat of the texture object when it was setup. Note that the contents are copied with no scaling applied, so the texture must be big enough such that xoffset + width <= texture's width and yoffset + height <= texture's height.- Parameters:
tex
- The Texture to copy into. This should be a Texture2D or TextureCubeMap. If the latter, its currentRTTFace will determine which cube face is drawn to.x
- the x offset into the framebuffery
- the y offset into the framebufferwidth
- the width of the rectangle to read from the framebuffer and copy 1:1 to the textureheight
- the width of the rectangle to read from the framebuffer and copy 1:1 to the texturexoffset
- the x offset into the texture to draw atyoffset
- the y offset into the texture to draw at
-
clearBuffers
protected void clearBuffers(int clear) - Specified by:
clearBuffers
in classAbstractFBOTextureRenderer
-
activate
protected void activate()- Specified by:
activate
in classAbstractFBOTextureRenderer
-
deactivate
protected void deactivate()- Specified by:
deactivate
in classAbstractFBOTextureRenderer
-
cleanup
public void cleanup()Description copied from interface:TextureRenderer
Any wrapping up and cleaning up of TextureRenderer information is performed here.
-