Suggestion: Method for creating empty texture of specified size, with alpha

Started by paulscode, September 26, 2010, 05:20:02 AM

Previous topic - Next topic

paulscode

Currently, there is no method for creating an empty/black texture of a specified size with alpha, something like this:

myTexture = new Texture( width, height, true );

This would be useful for cases where a texture's contents are generated entirely through an ITextureEffect implementation where alpha is used (i.e. if there is no "initial" frame to use when instantiating the Texture).  This is not high-priority for me, though.  I came up with a workaround that seems to function the same way:

BufferedImage image = new BufferedImage( width, height, BufferedImage.TYPE_4BYTE_ABGR );
myTexture = new Texture( image, true );

EgonOlsen