本文整理汇总了Java中org.andengine.opengl.texture.ITextureStateListener类的典型用法代码示例。如果您正苦于以下问题:Java ITextureStateListener类的具体用法?Java ITextureStateListener怎么用?Java ITextureStateListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITextureStateListener类属于org.andengine.opengl.texture包,在下文中一共展示了ITextureStateListener类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BitmapTexture
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
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;
}
示例2: ETC1Texture
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
public ETC1Texture(final TextureManager pTextureManager, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener) throws IOException {
super(pTextureManager, PixelFormat.RGB_565, pTextureOptions, pTextureStateListener);
InputStream inputStream = null;
try {
inputStream = this.getInputStream();
this.mETC1TextureHeader = new ETC1TextureHeader(StreamUtils.streamToBytes(inputStream, ETC1.ETC_PKM_HEADER_SIZE));
if (BuildConfig.DEBUG) {
if (!(MathUtils.isPowerOfTwo(this.mETC1TextureHeader.mWidth) && MathUtils.isPowerOfTwo(this.mETC1TextureHeader.mHeight))) {
Debug.w("ETC1 textures with NPOT sizes can cause a crash on PowerVR GPUs!");
}
}
} finally {
StreamUtils.close(inputStream);
}
}
示例3: RenderTexture
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
public RenderTexture(final TextureManager pTextureManager, final int pWidth, final int pHeight, final PixelFormat pPixelFormat, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener) {
super(pTextureManager, pPixelFormat, pTextureOptions, pTextureStateListener);
this.mWidth = pWidth;
this.mHeight = pHeight;
this.mPixelFormat = pPixelFormat;
}
示例4: PVRTexture
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
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;
}
示例5: setTextureStateListener
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
/**
* @see {@link ITextureAtlas#setTextureStateListener(ITextureAtlasStateListener)}
*/
@SuppressWarnings("unchecked")
@Deprecated
@Override
public void setTextureStateListener(final ITextureStateListener pTextureStateListener) {
super.setTextureStateListener((ITextureAtlasStateListener<T>)pTextureStateListener);
}
示例6: PVRTexture
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
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;
}
示例7: ETC1Texture
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
public ETC1Texture(final TextureManager pTextureManager, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener) throws IOException {
super(pTextureManager, PixelFormat.RGB_565, pTextureOptions, pTextureStateListener);
InputStream inputStream = null;
try {
inputStream = this.getInputStream();
this.mETC1TextureHeader = new ETC1TextureHeader(StreamUtils.streamToBytes(inputStream, ETC1.ETC_PKM_HEADER_SIZE));
} finally {
StreamUtils.close(inputStream);
}
}
示例8: AssetBitmapTexture
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
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);
}
示例9: ResourceBitmapTexture
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
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);
}
示例10: PVRGZTexture
import org.andengine.opengl.texture.ITextureStateListener; //导入依赖的package包/类
public PVRGZTexture(final TextureManager pTextureManager, final PVRTextureFormat pPVRTextureFormat, final ITextureStateListener pTextureStateListener) throws IllegalArgumentException, IOException {
super(pTextureManager, pPVRTextureFormat, pTextureStateListener);
}