com.annahid.libs.artenus.graphics.rendering
RenderTarget
Represents a graphics output object used for rendering. Artenus does not render frames directly
onto the screen. Instead, it first draws them into intermediate objects, which are then used for
post-processing. The final render target is always the screen, which is handled internally.
public class RenderTarget
Method Summary
Modifier and Type | Method and Description |
---|---|
public static RenderTarget | create(int width, int height) Creates a new render target with given width and height. |
public void | dispose() Frees all resources created with this render target. |
public int | getFrameBufferHandle() Gets the frame buffer handle. |
public int | getHeight() Gets the maximum height of the render target, which is the height it has been created with. |
public FloatBuffer | getTextureCoords() Gets texture coordinates which define the sub-image containing render results. |
public int | getTextureHandle() Gets the texture handle to the rendering result. |
public Viewport | getViewport() Gets the viewport associated with this render target. |
public int | getWidth() Gets the maximum width of the render target, which is the width it has been created with. |
public void | setViewport(Viewport viewport) Sets the viewport for this render target. |
Methods inherited from java.lang.Object
clone
, equals
, finalize
, getClass
, hashCode
, notify
, notifyAll
, toString
, wait
, wait
, wait
Method Detail
create | ||||
---|---|---|---|---|
public static RenderTarget create( int width, int height ) Creates a new render target with given width and height. Once created, these dimensions
cannot change. But the rendering and filtering procedures can use a portion of the image. Parameters:
Returns:
The rendering target, or null in case of an error |
dispose |
---|
public void dispose() Frees all resources created with this render target. This method must be called whenever the
rendering context is lost or reset. |
getFrameBufferHandle |
---|
public int getFrameBufferHandle() Gets the frame buffer handle. This handle is used internally to bind the target to the
rendering context. Returns:
Frame buffer handle |
getHeight |
---|
public int getHeight() Gets the maximum height of the render target, which is the height it has been created with. Returns:
Maximum height in pixels |
getTextureCoords |
---|
public FloatBuffer getTextureCoords() Gets texture coordinates which define the sub-image containing render results. This should be
fed to the shader program along with the texture handle. Returns:
Texture coordinates See Also:
|
getTextureHandle |
---|
public int getTextureHandle() Gets the texture handle to the rendering result. This handle can then be fed to a shader
program to draw the result on another render target. Returns:
Texture image handle |
getViewport |
---|
public Viewport getViewport() Gets the viewport associated with this render target. Returns:
The viewport |
getWidth |
---|
public int getWidth() Gets the maximum width of the render target, which is the width it has been created with. Returns:
Maximum width in pixels |
setViewport | ||
---|---|---|
public void setViewport( Viewport viewport ) Sets the viewport for this render target. Parameters:
|