com.threed.jpct
Interface ITextureEffect

All Known Implementing Classes:
WaterTextureEffect

public interface ITextureEffect

An interface for texture effects. Texture effects are two-dimensional effects applied to a texture. These effects are supported by the OpenGL renderer and the software renderer, but be careful when using them together with the OpenGL renderer. The affected texture has to be converted and uploaded to the graphics card every time the effect will be applied. This will most likely ruin performance and lets the VM eat a lot of memory too.


Method Summary
 void apply(int[] dest, int[] source)
          Applies the effect.
 boolean containsAlpha()
          If this returns true, jPCT assumes that the alpha channel in the returned pixels is populated and treats it accordingly.
 void init(Texture tex)
          Initializes the effect.
 

Method Detail

init

public void init(Texture tex)
Initializes the effect. This will be called by setEffect(), so there should be no need to call this method directly.

Parameters:
tex - the Texture to which the effect should be applied
See Also:
Texture.setEffect(com.threed.jpct.ITextureEffect)

apply

public void apply(int[] dest,
                  int[] source)
Applies the effect. Like init(), this will be called from within the Texture class. To avoid the construction of a new int[] for every call, the resulting image is rendered directly into dest. So if one wants to implements an effect, take the source bitmap (it's an int[] containing the texture in ARGB (0xaarrggbb)-format) and write the modified source bitmap into the dest bitmap.

Parameters:
dest - the destination bitmap
source - the source bitmap (the unmodified texture)

containsAlpha

public boolean containsAlpha()
If this returns true, jPCT assumes that the alpha channel in the returned pixels is populated and treats it accordingly.

Returns:
does it?