本文整理汇总了Java中android.opengl.GLES20.glDeleteTextures方法的典型用法代码示例。如果您正苦于以下问题:Java GLES20.glDeleteTextures方法的具体用法?Java GLES20.glDeleteTextures怎么用?Java GLES20.glDeleteTextures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES20
的用法示例。
在下文中一共展示了GLES20.glDeleteTextures方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: release
import android.opengl.GLES20; //导入方法依赖的package包/类
private void release() {
if (handler.getLooper().getThread() != Thread.currentThread()) {
throw new IllegalStateException("Wrong thread.");
}
if (isTextureInUse || !isQuitting) {
throw new IllegalStateException("Unexpected release.");
}
if (yuvConverter != null) {
yuvConverter.release();
}
GLES20.glDeleteTextures(1, new int[] {oesTextureId}, 0);
surfaceTexture.release();
eglBase.release();
handler.getLooper().quit();
}
示例2: destroy
import android.opengl.GLES20; //导入方法依赖的package包/类
@Override
public void destroy() {
super.destroy();
if (mSurfaceTexture != null) {
mSurfaceTexture.release();
mSurfaceTexture = null;
}
if (mTextureIn != 0) {
int[] tex = new int[1];
tex[0] = mTextureIn;
GLES20.glDeleteTextures(1, tex, 0);
mTextureIn = 0;
}
}
示例3: destroy
import android.opengl.GLES20; //导入方法依赖的package包/类
/**
* 销毁组件资源
* <p>
* 在GL线程调用
*/
public void destroy() {
if (mTexture != 0) {
int[] tex = new int[1];
tex[0] = mTexture;
GLES20.glDeleteTextures(1, tex, 0);
mTexture = 0;
}
}
示例4: testRgbRendering
import android.opengl.GLES20; //导入方法依赖的package包/类
@Test
@SmallTest
public void testRgbRendering() {
// Create EGL base with a pixel buffer as display output.
final EglBase eglBase = EglBase.create(null, EglBase.CONFIG_PIXEL_BUFFER);
eglBase.createPbufferSurface(WIDTH, HEIGHT);
eglBase.makeCurrent();
// Create RGB byte buffer plane with random content.
final ByteBuffer rgbPlane = ByteBuffer.allocateDirect(WIDTH * HEIGHT * 3);
final Random random = new Random(SEED);
random.nextBytes(rgbPlane.array());
// Upload the RGB byte buffer data as a texture.
final int rgbTexture = GlUtil.generateTexture(GLES20.GL_TEXTURE_2D);
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, rgbTexture);
GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGB, WIDTH, HEIGHT, 0, GLES20.GL_RGB,
GLES20.GL_UNSIGNED_BYTE, rgbPlane);
GlUtil.checkNoGLES2Error("glTexImage2D");
// Draw the RGB frame onto the pixel buffer.
final GlRectDrawer drawer = new GlRectDrawer();
drawer.drawRgb(rgbTexture, RendererCommon.identityMatrix(), WIDTH, HEIGHT, 0 /* viewportX */,
0 /* viewportY */, WIDTH, HEIGHT);
// Download the pixels in the pixel buffer as RGBA. Not all platforms support RGB, e.g. Nexus 9.
final ByteBuffer rgbaData = ByteBuffer.allocateDirect(WIDTH * HEIGHT * 4);
GLES20.glReadPixels(0, 0, WIDTH, HEIGHT, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, rgbaData);
GlUtil.checkNoGLES2Error("glReadPixels");
// Assert rendered image is pixel perfect to source RGB.
assertByteBufferEquals(WIDTH, HEIGHT, stripAlphaChannel(rgbaData), rgbPlane);
drawer.release();
GLES20.glDeleteTextures(1, new int[] {rgbTexture}, 0);
eglBase.release();
}
示例5: release
import android.opengl.GLES20; //导入方法依赖的package包/类
/**
* Releases cached resources. Uploader can still be used and the resources will be reallocated
* on first use.
*/
public void release() {
copyBuffer = null;
if (yuvTextures != null) {
GLES20.glDeleteTextures(3, yuvTextures, 0);
yuvTextures = null;
}
}
示例6: deleteTex
import android.opengl.GLES20; //导入方法依赖的package包/类
private static void deleteTex(int[] tex) {
if(tex.length == 1) {
GLES20.glDeleteTextures(1, tex, 0);
}
}
示例7: onDestroy
import android.opengl.GLES20; //导入方法依赖的package包/类
public void onDestroy() {
super.onDestroy();
GLES20.glDeleteTextures(inputTextureHandles.length, inputTextureHandles, 0);
for(int i = 0; i < inputTextureHandles.length; i++)
inputTextureHandles[i] = -1;
}
示例8: onDestroy
import android.opengl.GLES20; //导入方法依赖的package包/类
public void onDestroy(){
super.onDestroy();
GLES20.glDeleteTextures(1, mToneCurveTexture, 0);
mToneCurveTexture[0] = -1;
}
示例9: onDestroy
import android.opengl.GLES20; //导入方法依赖的package包/类
protected void onDestroy(){
super.onDestroy();
int[] texture = new int[]{mLookupSourceTexture};
GLES20.glDeleteTextures(1, texture, 0);
mLookupSourceTexture = -1;
}
示例10: onDestroy
import android.opengl.GLES20; //导入方法依赖的package包/类
protected void onDestroy() {
super.onDestroy();
GLES20.glDeleteTextures(1, inputTextureHandles, 0);
for(int i = 0; i < inputTextureHandles.length; i++)
inputTextureHandles[i] = -1;
}
示例11: onDestroy
import android.opengl.GLES20; //导入方法依赖的package包/类
public void onDestroy() {
super.onDestroy();
GLES20.glDeleteTextures(1, mToneCurveTexture, 0);
mToneCurveTexture[0] = -1;
}