當前位置: 首頁>>代碼示例>>Java>>正文


Java GLES20.glDeleteTextures方法代碼示例

本文整理匯總了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();
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:16,代碼來源:SurfaceTextureHelper.java

示例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;
    }
}
 
開發者ID:uestccokey,項目名稱:EZFilter,代碼行數:15,代碼來源:VideoFBORender.java

示例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;
    }
}
 
開發者ID:uestccokey,項目名稱:EZFilter,代碼行數:14,代碼來源:ComponentRender.java

示例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();
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:39,代碼來源:GlRectDrawerTest.java

示例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;
  }
}
 
開發者ID:Piasy,項目名稱:VideoCRE,代碼行數:12,代碼來源:RendererCommon.java

示例6: deleteTex

import android.opengl.GLES20; //導入方法依賴的package包/類
private static void deleteTex(int[] tex) {
    if(tex.length == 1) {
        GLES20.glDeleteTextures(1, tex, 0);
    }
}
 
開發者ID:vulovicv23,項目名稱:opencv-documentscanner-android,代碼行數:6,代碼來源:CameraGLRendererBase.java

示例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;
}
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:7,代碼來源:MagicXproIIFilter.java

示例8: onDestroy

import android.opengl.GLES20; //導入方法依賴的package包/類
public void onDestroy(){
	super.onDestroy();
    GLES20.glDeleteTextures(1, mToneCurveTexture, 0);
    mToneCurveTexture[0] = -1;
}
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:6,代碼來源:MagicWhiteCatFilter.java

示例9: onDestroy

import android.opengl.GLES20; //導入方法依賴的package包/類
protected void onDestroy(){
	super.onDestroy();
    int[] texture = new int[]{mLookupSourceTexture};
    GLES20.glDeleteTextures(1, texture, 0);
    mLookupSourceTexture = -1;
}
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:7,代碼來源:MagicLookupFilter.java

示例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;
}
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:7,代碼來源:MagicFreudFilter.java

示例11: onDestroy

import android.opengl.GLES20; //導入方法依賴的package包/類
public void onDestroy() {
    super.onDestroy();
    GLES20.glDeleteTextures(1, mToneCurveTexture, 0);
    mToneCurveTexture[0] = -1;
}
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:6,代碼來源:MagiSkinWhitenFilter.java


注:本文中的android.opengl.GLES20.glDeleteTextures方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。