org.andengine.opengl.texture.TextureManager Java Examples

The following examples show how to use org.andengine.opengl.texture.TextureManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BitmapTexture.java    From tilt-game-android with MIT License 6 votes vote down vote up
public BitmapTexture(final TextureManager pTextureManager, final IInputStreamOpener pInputStreamOpener, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener) throws IOException {
	super(pTextureManager, pBitmapTextureFormat.getPixelFormat(), pTextureOptions, pTextureStateListener);

	this.mInputStreamOpener = pInputStreamOpener;
	this.mBitmapTextureFormat = pBitmapTextureFormat;

	final BitmapFactory.Options decodeOptions = new BitmapFactory.Options();
	decodeOptions.inJustDecodeBounds = true;

	final InputStream in = null;
	try {
		BitmapFactory.decodeStream(pInputStreamOpener.open(), null, decodeOptions);
	} finally {
		StreamUtils.close(in);
	}

	this.mWidth = decodeOptions.outWidth;
	this.mHeight = decodeOptions.outHeight;
}
 
Example #2
Source File: PVRTexture.java    From tilt-game-android with MIT License 5 votes vote down vote up
public PVRTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final IPVRTexturePixelBufferStrategy pPVRTexturePixelBufferStrategy, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener) throws IllegalArgumentException, IOException {
	super(pTextureManager, pPVRTextureFormat.getPixelFormat(), pTextureOptions, pTextureStateListener);
	this.mPVRTexturePixelBufferStrategy = pPVRTexturePixelBufferStrategy;

	InputStream inputStream = null;
	try {
		inputStream = this.getInputStream();
		this.mPVRTextureHeader = new PVRTextureHeader(StreamUtils.streamToBytes(inputStream, PVRTextureHeader.SIZE));
	} finally {
		StreamUtils.close(inputStream);
	}

	if (this.mPVRTextureHeader.getPVRTextureFormat().getPixelFormat() != pPVRTextureFormat.getPixelFormat()) {
		throw new IllegalArgumentException("Other PVRTextureFormat: '" + this.mPVRTextureHeader.getPVRTextureFormat().getPixelFormat() + "' found than expected: '" + pPVRTextureFormat.getPixelFormat() + "'.");
	}

	if (this.mPVRTextureHeader.getPVRTextureFormat().isCompressed()) { // TODO && ! GLHELPER_EXTENSION_PVRTC] ) {
		throw new IllegalArgumentException("Invalid PVRTextureFormat: '" + this.mPVRTextureHeader.getPVRTextureFormat() + "'.");
	}

	if (this.hasMipMaps()) {
		switch (pTextureOptions.mMinFilter) {
			case GLES20.GL_NEAREST_MIPMAP_NEAREST:
			case GLES20.GL_NEAREST_MIPMAP_LINEAR:
			case GLES20.GL_LINEAR_MIPMAP_NEAREST:
			case GLES20.GL_LINEAR_MIPMAP_LINEAR:
				break;
			default:
				if (BuildConfig.DEBUG) {
					Debug.w("This '" + this.getClass().getSimpleName() + "' contains mipmaps, but the provided '" + pTextureOptions.getClass().getSimpleName() + "' don't have MipMaps enabled on the MinFilter!");
				}
		}
	}

	this.mUpdateOnHardwareNeeded = true;
}
 
Example #3
Source File: PVRTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public PVRTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final IPVRTexturePixelBufferStrategy pPVRTexturePixelBufferStrategy, final ITextureStateListener pTextureStateListener) throws IllegalArgumentException, IOException {
	this(pTextureManager, pPVRTextureFormat, pPVRTexturePixelBufferStrategy, TextureOptions.DEFAULT, pTextureStateListener);
}
 
Example #4
Source File: TextureMemoryLogger.java    From tilt-game-android with MIT License 4 votes vote down vote up
public TextureMemoryLogger(final TextureManager pTextureManager) {
	this(pTextureManager, DebugLevel.DEBUG);
}
 
Example #5
Source File: BuildableBitmapTextureAtlas.java    From tilt-game-android with MIT License 4 votes vote down vote up
/**
 * Uses {@link BitmapTextureFormat#RGBA_8888}.
 */
public BuildableBitmapTextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight) {
	this(pTextureManager, pWidth, pHeight, BitmapTextureFormat.RGBA_8888);
}
 
Example #6
Source File: PVRTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public PVRTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final IPVRTexturePixelBufferStrategy pPVRTexturePixelBufferStrategy, final TextureOptions pTextureOptions) throws IllegalArgumentException, IOException {
	this(pTextureManager, pPVRTextureFormat, pPVRTexturePixelBufferStrategy, pTextureOptions, null);
}
 
Example #7
Source File: ETC1Texture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public ETC1Texture(final TextureManager pTextureManager) throws IOException {
	this(pTextureManager, TextureOptions.DEFAULT, null);
}
 
Example #8
Source File: PVRTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public PVRTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final TextureOptions pTextureOptions) throws IllegalArgumentException, IOException {
	this(pTextureManager, pPVRTextureFormat, new GreedyPVRTexturePixelBufferStrategy(), pTextureOptions, null);
}
 
Example #9
Source File: PVRTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public PVRTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final IPVRTexturePixelBufferStrategy pPVRTexturePixelBufferStrategy) throws IllegalArgumentException, IOException {
	this(pTextureManager, pPVRTextureFormat, pPVRTexturePixelBufferStrategy, TextureOptions.DEFAULT, null);
}
 
Example #10
Source File: PVRTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public PVRTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat) throws IllegalArgumentException, IOException {
	this(pTextureManager, pPVRTextureFormat, new GreedyPVRTexturePixelBufferStrategy(), TextureOptions.DEFAULT, null);
}
 
Example #11
Source File: PVRGZTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public PVRGZTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final IPVRTexturePixelBufferStrategy pPVRTexturePixelBufferStrategy, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener) throws IllegalArgumentException, IOException {
	super(pTextureManager, pPVRTextureFormat, pPVRTexturePixelBufferStrategy, pTextureOptions, pTextureStateListener);
}
 
Example #12
Source File: PVRGZTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public PVRGZTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final IPVRTexturePixelBufferStrategy pPVRTexturePixelBufferStrategy, final TextureOptions pTextureOptions) throws IllegalArgumentException, IOException {
	super(pTextureManager, pPVRTextureFormat, pPVRTexturePixelBufferStrategy, pTextureOptions);
}
 
Example #13
Source File: PVRTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public PVRTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final ITextureStateListener pTextureStateListener) throws IllegalArgumentException, IOException {
	this(pTextureManager, pPVRTextureFormat, new GreedyPVRTexturePixelBufferStrategy(), TextureOptions.DEFAULT, pTextureStateListener);
}
 
Example #14
Source File: ResourceBitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public ResourceBitmapTexture(final TextureManager pTextureManager, final Resources pResources, final int pDrawableResourceID, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener) throws IOException {
	super(pTextureManager, new ResourceInputStreamOpener(pResources, pDrawableResourceID), pBitmapTextureFormat, pTextureOptions, pTextureStateListener);
}
 
Example #15
Source File: ResourceBitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public ResourceBitmapTexture(final TextureManager pTextureManager, final Resources pResources, final int pDrawableResourceID, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions) throws IOException {
	super(pTextureManager, new ResourceInputStreamOpener(pResources, pDrawableResourceID), pBitmapTextureFormat, pTextureOptions);
}
 
Example #16
Source File: ResourceBitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public ResourceBitmapTexture(final TextureManager pTextureManager, final Resources pResources, final int pDrawableResourceID, final TextureOptions pTextureOptions) throws IOException {
	super(pTextureManager, new ResourceInputStreamOpener(pResources, pDrawableResourceID), pTextureOptions);
}
 
Example #17
Source File: ResourceBitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public ResourceBitmapTexture(final TextureManager pTextureManager, final Resources pResources, final int pDrawableResourceID, final BitmapTextureFormat pBitmapTextureFormat) throws IOException {
	super(pTextureManager, new ResourceInputStreamOpener(pResources, pDrawableResourceID), pBitmapTextureFormat);
}
 
Example #18
Source File: TexturePackLoader.java    From tilt-game-android with MIT License 4 votes vote down vote up
public TexturePackLoader(final AssetManager pAssetManager, final TextureManager pTextureManager) {
	this.mAssetManager = pAssetManager;
	this.mTextureManager = pTextureManager;
}
 
Example #19
Source File: AssetBitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public AssetBitmapTexture(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener) throws IOException {
	super(pTextureManager, new AssetInputStreamOpener(pAssetManager, pAssetPath), pBitmapTextureFormat, pTextureOptions, pTextureStateListener);
}
 
Example #20
Source File: AssetBitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public AssetBitmapTexture(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions) throws IOException {
	super(pTextureManager, new AssetInputStreamOpener(pAssetManager, pAssetPath), pBitmapTextureFormat, pTextureOptions);
}
 
Example #21
Source File: AssetBitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public AssetBitmapTexture(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath, final TextureOptions pTextureOptions) throws IOException {
	super(pTextureManager, new AssetInputStreamOpener(pAssetManager, pAssetPath), pTextureOptions);
}
 
Example #22
Source File: AssetBitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public AssetBitmapTexture(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath, final BitmapTextureFormat pBitmapTextureFormat) throws IOException {
	super(pTextureManager, new AssetInputStreamOpener(pAssetManager, pAssetPath), pBitmapTextureFormat);
}
 
Example #23
Source File: TextureAtlas.java    From tilt-game-android with MIT License 4 votes vote down vote up
public TextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight, final PixelFormat pPixelFormat, final TextureOptions pTextureOptions, final ITextureAtlasStateListener<T> pTextureAtlasStateListener) {
	super(pTextureManager, pPixelFormat, pTextureOptions, pTextureAtlasStateListener);

	this.mWidth = pWidth;
	this.mHeight = pHeight;
}
 
Example #24
Source File: BitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public BitmapTexture(final TextureManager pTextureManager, final IInputStreamOpener pInputStreamOpener, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions) throws IOException {
	this(pTextureManager, pInputStreamOpener, pBitmapTextureFormat, pTextureOptions, null);
}
 
Example #25
Source File: BitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public BitmapTexture(final TextureManager pTextureManager, final IInputStreamOpener pInputStreamOpener, final TextureOptions pTextureOptions) throws IOException {
	this(pTextureManager, pInputStreamOpener, BitmapTextureFormat.RGBA_8888, pTextureOptions, null);
}
 
Example #26
Source File: ETC1Texture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public ETC1Texture(final TextureManager pTextureManager, final TextureOptions pTextureOptions) throws IOException {
	this(pTextureManager, pTextureOptions, null);
}
 
Example #27
Source File: BitmapTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public BitmapTexture(final TextureManager pTextureManager, final IInputStreamOpener pInputStreamOpener) throws IOException {
	this(pTextureManager, pInputStreamOpener, BitmapTextureFormat.RGBA_8888, TextureOptions.DEFAULT, null);
}
 
Example #28
Source File: PVRCCZTexture.java    From tilt-game-android with MIT License 4 votes vote down vote up
public PVRCCZTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final IPVRTexturePixelBufferStrategy pPVRTexturePixelBufferStrategy, final TextureOptions pTextureOptions) throws IllegalArgumentException, IOException {
	super(pTextureManager, pPVRTextureFormat, pPVRTexturePixelBufferStrategy, pTextureOptions);
}
 
Example #29
Source File: BitmapFont.java    From tilt-game-android with MIT License 4 votes vote down vote up
public BitmapFont(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath, final TextureOptions pTextureOptions) {
	this(pTextureManager, pAssetManager, pAssetPath, BitmapTextureFormat.RGBA_8888, pTextureOptions, BitmapFontOptions.DEFAULT);
}
 
Example #30
Source File: BitmapFont.java    From tilt-game-android with MIT License 4 votes vote down vote up
public BitmapFont(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath) {
	this(pTextureManager, pAssetManager, pAssetPath, BitmapTextureFormat.RGBA_8888, TextureOptions.DEFAULT, BitmapFontOptions.DEFAULT);
}