com.threerings.opengl.renderer
Class TextureRenderer

java.lang.Object
  extended by com.threerings.opengl.renderer.TextureRenderer

public class TextureRenderer
extends Object

Provides render-to-texture functionality using various methods according to the abilities of the driver.


Constructor Summary
TextureRenderer(GlContext ctx, Texture color, Texture depth, int width, int height, org.lwjgl.opengl.PixelFormat pformat)
          Creates a new texture renderer to render into the specified texture(s).
 
Method Summary
 void commitRender()
          Stops rendering to the texture (and makes it available for use).
 void dispose()
          Disposes of this texture renderer, rendering it unusable.
 Texture getColor()
          Returns a reference to the color texture (if any).
 Texture getDepth()
          Returns a reference to the depth texture (if any).
 int getHeight()
          Returns the configured height of the renderer.
static TextureRenderer getInstance(GlContext ctx, Texture color, Texture depth, int width, int height, org.lwjgl.opengl.PixelFormat pformat)
          Retrieves the shared texture renderer instance for the supplied textures.
static TextureRenderer getInstance(GlContext ctx, Texture color, Texture depth, org.lwjgl.opengl.PixelFormat pformat)
          Retrieves the shared texture renderer instance for the supplied textures.
 int getWidth()
          Returns the configured width of the renderer.
 void startRender()
          Starts rendering to the texture.
 void startRender(int level, int param)
          Starts rendering to the texture.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextureRenderer

public TextureRenderer(GlContext ctx,
                       Texture color,
                       Texture depth,
                       int width,
                       int height,
                       org.lwjgl.opengl.PixelFormat pformat)
Creates a new texture renderer to render into the specified texture(s).

Parameters:
width - the width of the render surface, or -1 to match the texture dimensions.
height - the height of the render surface, or -1.
Method Detail

getInstance

public static TextureRenderer getInstance(GlContext ctx,
                                          Texture color,
                                          Texture depth,
                                          org.lwjgl.opengl.PixelFormat pformat)
Retrieves the shared texture renderer instance for the supplied textures.


getInstance

public static TextureRenderer getInstance(GlContext ctx,
                                          Texture color,
                                          Texture depth,
                                          int width,
                                          int height,
                                          org.lwjgl.opengl.PixelFormat pformat)
Retrieves the shared texture renderer instance for the supplied textures.

Parameters:
width - the width of the render surface, or -1 to match the texture dimensions.
height - the height of the render surface, or -1.

getWidth

public int getWidth()
Returns the configured width of the renderer.


getHeight

public int getHeight()
Returns the configured height of the renderer.


getColor

public Texture getColor()
Returns a reference to the color texture (if any).


getDepth

public Texture getDepth()
Returns a reference to the depth texture (if any).


startRender

public void startRender()
Starts rendering to the texture.


startRender

public void startRender(int level,
                        int param)
Starts rendering to the texture.

Parameters:
level - the mipmap level.
param - the cube map face index or z offset, as appropriate.

commitRender

public void commitRender()
Stops rendering to the texture (and makes it available for use).


dispose

public void dispose()
Disposes of this texture renderer, rendering it unusable.



Copyright © 2011. All Rights Reserved.