public class

RenderTexture

extends Texture
java.lang.Object
   ↳ org.andengine.opengl.texture.Texture
     ↳ org.andengine.opengl.texture.render.RenderTexture

Class Overview

The general workflow with a RenderTexture is: init(GLState) -> begin(GLState) -> end(GLState) -> destroy(GLState). (c) Zynga 2011

Summary

[Expand]
Inherited Constants
From class org.andengine.opengl.texture.Texture
Fields
protected int mFramebufferObjectID
protected final int mHeight
protected final PixelFormat mPixelFormat
protected final int mWidth
[Expand]
Inherited Fields
From class org.andengine.opengl.texture.Texture
Public Constructors
RenderTexture(TextureManager pTextureManager, int pWidth, int pHeight)
RenderTexture(TextureManager pTextureManager, int pWidth, int pHeight, PixelFormat pPixelFormat)
RenderTexture(TextureManager pTextureManager, int pWidth, int pHeight, TextureOptions pTextureOptions)
RenderTexture(TextureManager pTextureManager, int pWidth, int pHeight, PixelFormat pPixelFormat, TextureOptions pTextureOptions)
RenderTexture(TextureManager pTextureManager, int pWidth, int pHeight, PixelFormat pPixelFormat, TextureOptions pTextureOptions, ITexture.ITextureStateListener pTextureStateListener)
Public Methods
void begin(GLState pGLState)
void begin(GLState pGLState, boolean pFlipX, boolean pFlipY)
void begin(GLState pGLState, float pRed, float pGreen, float pBlue, float pAlpha)
void begin(GLState pGLState, boolean pFlipX, boolean pFlipY, Color pColor)
void begin(GLState pGLState, Color pColor)
void begin(GLState pGLState, boolean pFlipX, boolean pFlipY, float pRed, float pGreen, float pBlue, float pAlpha)
void destroy(GLState pGLState)
void end(GLState pGLState)
void end(GLState pGLState, boolean pFlush, boolean pFinish)
void finish(GLState pGLState)
void flush(GLState pGLState)
Bitmap getBitmap(GLState pGLState)
Bitmap getBitmap(GLState pGLState, int pX, int pY, int pWidth, int pHeight)
int getHeight()
int[] getPixelsARGB_8888(GLState pGLState)
int[] getPixelsARGB_8888(GLState pGLState, int pX, int pY, int pWidth, int pHeight)
int getWidth()
void init(GLState pGLState)
boolean isInitialized()
Protected Methods
void resotorePreviousViewport()
void restorePreviousFramebufferObjectID(GLState pGLState)
void savePreviousFramebufferObjectID(GLState pGLState)
void savePreviousViewport()
void writeTextureToHardware(GLState pGLState)
[Expand]
Inherited Methods
From class org.andengine.opengl.texture.Texture
From class java.lang.Object
From interface org.andengine.opengl.texture.ITexture

Fields

protected int mFramebufferObjectID

protected final int mHeight

protected final PixelFormat mPixelFormat

protected final int mWidth

Public Constructors

public RenderTexture (TextureManager pTextureManager, int pWidth, int pHeight)

public RenderTexture (TextureManager pTextureManager, int pWidth, int pHeight, PixelFormat pPixelFormat)

public RenderTexture (TextureManager pTextureManager, int pWidth, int pHeight, TextureOptions pTextureOptions)

public RenderTexture (TextureManager pTextureManager, int pWidth, int pHeight, PixelFormat pPixelFormat, TextureOptions pTextureOptions)

public RenderTexture (TextureManager pTextureManager, int pWidth, int pHeight, PixelFormat pPixelFormat, TextureOptions pTextureOptions, ITexture.ITextureStateListener pTextureStateListener)

Public Methods

public void begin (GLState pGLState)

See Also
  • {@link RenderTexture#end(GLState)}, {@link RenderTexture#end(GLState, boolean, boolean}}.

public void begin (GLState pGLState, boolean pFlipX, boolean pFlipY)

See Also
  • {@link RenderTexture#end(GLState)}, {@link RenderTexture#end(GLState, boolean, boolean}}.

public void begin (GLState pGLState, float pRed, float pGreen, float pBlue, float pAlpha)

Parameters
pRed the red portion of the color to clear this RenderTexture.
pGreen the green portion of the color to clear this RenderTexture.
pBlue the blue portion of the color to clear this RenderTexture.
pAlpha the alpha portion of the color to clear this RenderTexture.
See Also
  • {@link RenderTexture#end(GLState)}, {@link RenderTexture#end(GLState, boolean, boolean}}.

public void begin (GLState pGLState, boolean pFlipX, boolean pFlipY, Color pColor)

Parameters
pColor the Color to clear this RenderTexture.
See Also
  • {@link RenderTexture#end(GLState)}, {@link RenderTexture#end(GLState, boolean, boolean}}.

public void begin (GLState pGLState, Color pColor)

Parameters
pColor the Color to clear this RenderTexture.
See Also
  • {@link RenderTexture#end(GLState)}, {@link RenderTexture#end(GLState, boolean, boolean}}.

public void begin (GLState pGLState, boolean pFlipX, boolean pFlipY, float pRed, float pGreen, float pBlue, float pAlpha)

Parameters
pRed the red portion of the color to clear this RenderTexture.
pGreen the green portion of the color to clear this RenderTexture.
pBlue the blue portion of the color to clear this RenderTexture.
pAlpha the alpha portion of the color to clear this RenderTexture.
See Also
  • {@link RenderTexture#end(GLState)}, {@link RenderTexture#end(GLState, boolean, boolean}}.

public void destroy (GLState pGLState)

public void end (GLState pGLState)

See Also
  • {@link RenderTexture#begin(GLState)}, {@link RenderTexture#begin(GLState, boolean, boolean)}, {@link RenderTexture#begin(GLState, Color)}, {@link RenderTexture#begin(GLState, float, float, float, float)}, {@link RenderTexture#begin(GLState, boolean, boolean, Color)}. {@link RenderTexture#begin(GLState, boolean, boolean, float, float, float, float)}.

public void end (GLState pGLState, boolean pFlush, boolean pFinish)

Parameters
pFlush flush() has lower preference than pFinish.
pFinish finish() had higher preference than pFlush.
See Also
  • {@link RenderTexture#begin(GLState)}, {@link RenderTexture#begin(GLState, boolean, boolean)}, {@link RenderTexture#begin(GLState, Color)}, {@link RenderTexture#begin(GLState, float, float, float, float)}, {@link RenderTexture#begin(GLState, boolean, boolean, Color)}. {@link RenderTexture#begin(GLState, boolean, boolean, float, float, float, float)}.

public void finish (GLState pGLState)

See Also
  • {@link GLState#finish()}.

public void flush (GLState pGLState)

See Also
  • {@link GLState#flush()}.

public Bitmap getBitmap (GLState pGLState)

public Bitmap getBitmap (GLState pGLState, int pX, int pY, int pWidth, int pHeight)

public int getHeight ()

public int[] getPixelsARGB_8888 (GLState pGLState)

public int[] getPixelsARGB_8888 (GLState pGLState, int pX, int pY, int pWidth, int pHeight)

public int getWidth ()

public void init (GLState pGLState)

Throws
RenderTextureInitializationException when this RenderTexture could not be initialized. The GLException contains the error code. When this exception is throw, all cleanup will be automatically performed through destroy(GLState).
GLException
GLFrameBufferException

public boolean isInitialized ()

Protected Methods

protected void resotorePreviousViewport ()

protected void restorePreviousFramebufferObjectID (GLState pGLState)

protected void savePreviousFramebufferObjectID (GLState pGLState)

protected void savePreviousViewport ()

protected void writeTextureToHardware (GLState pGLState)