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


Java GLES11Ext類代碼示例

本文整理匯總了Java中android.opengl.GLES11Ext的典型用法代碼示例。如果您正苦於以下問題:Java GLES11Ext類的具體用法?Java GLES11Ext怎麽用?Java GLES11Ext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GLES11Ext類屬於android.opengl包,在下文中一共展示了GLES11Ext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initSurfaceTexture

import android.opengl.GLES11Ext; //導入依賴的package包/類
private void initSurfaceTexture() {
    int[] textures = new int[1];
    GLES20.glGenTextures(1, textures, 0);
    mSurfaceTextureId = textures[0];
    mSurfaceTexture = new SurfaceTexture(mSurfaceTextureId);
    mSurfaceTexture.setOnFrameAvailableListener(this);
    GLES20.glDisable(GLES20.GL_DEPTH_TEST);
    GLES20.glDisable(GLES20.GL_CULL_FACE);
    GLES20.glDisable(GLES20.GL_BLEND);
    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mSurfaceTextureId);
    GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
            GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
            GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
            GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
            GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
}
 
開發者ID:wuyisheng,項目名稱:libRtmp,代碼行數:21,代碼來源:RendererImpl.java

示例2: getExternalOESTextureID

import android.opengl.GLES11Ext; //導入依賴的package包/類
public static int getExternalOESTextureID(){		
	int[] texture = new int[1];

	GLES20.glGenTextures(1, texture, 0);
	GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, texture[0]);
	GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GL10.GL_TEXTURE_MIN_FILTER,GL10.GL_LINEAR);        
	GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
	GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
	GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);

	return texture[0];
}
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:17,代碼來源:OpenGLUtils.java

示例3: onDrawFrame

import android.opengl.GLES11Ext; //導入依賴的package包/類
@Override
public int onDrawFrame(int textureId) {
       GLES20.glUseProgram(mGLProgId);
       if(!isInitialized()) {
           return OpenGLUtils.NOT_INIT;
       }
       mGLCubeBuffer.position(0);
       GLES20.glVertexAttribPointer(mGLAttribPosition, 2, GLES20.GL_FLOAT, false, 0, mGLCubeBuffer);
       GLES20.glEnableVertexAttribArray(mGLAttribPosition);
       mGLTextureBuffer.position(0);
       GLES20.glVertexAttribPointer(mGLAttribTextureCoordinate, 2, GLES20.GL_FLOAT, false, 0, mGLTextureBuffer);
       GLES20.glEnableVertexAttribArray(mGLAttribTextureCoordinate);
       GLES20.glUniformMatrix4fv(mTextureTransformMatrixLocation, 1, false, mTextureTransformMatrix, 0);
       
       if(textureId != OpenGLUtils.NO_TEXTURE){
        GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
        GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureId);
        GLES20.glUniform1i(mGLUniformTexture, 0);
       }
       
       GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
       GLES20.glDisableVertexAttribArray(mGLAttribPosition);
       GLES20.glDisableVertexAttribArray(mGLAttribTextureCoordinate);
       GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, 0);
       return OpenGLUtils.ON_DRAWN;
   }
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:27,代碼來源:MagicCameraInputFilter.java

示例4: createTexture

import android.opengl.GLES11Ext; //導入依賴的package包/類
/**
 * Creates a texture object suitable for use with this program.
 * <p>
 * On exit, the texture will be bound.
 */
public int createTexture() {
    int[] textures = new int[1];
    GLES20.glGenTextures(1, textures, 0);

    int texId = textures[0];
    GLES20.glBindTexture(mTextureTarget, texId);

    GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER,
            GLES20.GL_NEAREST);
    GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER,
            GLES20.GL_LINEAR);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S,
            GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T,
            GLES20.GL_CLAMP_TO_EDGE);

    return texId;
}
 
開發者ID:LeonHover,項目名稱:MediaCodecRecorder,代碼行數:24,代碼來源:GLSurfaceFilter.java

示例5: initTex

import android.opengl.GLES11Ext; //導入依賴的package包/類
public static int initTex() {
    //初始化texture
    final int[] texId = new int[1];
    //拿到第一個Texure 並且存在texId 的texId[0]
    GLES20.glGenTextures(1, texId, 0);
    GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, texId[0]);
    //設置一堆參數  不卵他
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
            GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
            GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
            GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
            GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);
    return texId[0];
}
 
開發者ID:SbName,項目名稱:SbCamera,代碼行數:18,代碼來源:SbDrawer.java

示例6: createOESTextureObject

import android.opengl.GLES11Ext; //導入依賴的package包/類
public static int createOESTextureObject() {
    int[] textures = new int[1];
    GLES20.glGenTextures(1, textures, 0);
    checkGlError("glGenTextures");

    int textureId = textures[0];
    GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureId);
    checkGlError("glBindTexture " + textureId);

    GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    checkGlError("glTexParameter");
    return textureId;
}
 
開發者ID:AgoraIO,項目名稱:Agora-Screen-Sharing-Android,代碼行數:17,代碼來源:GlUtil.java

示例7: SurfaceTextureHelper

import android.opengl.GLES11Ext; //導入依賴的package包/類
private SurfaceTextureHelper(EglBase.Context sharedContext, Handler handler) {
  if (handler.getLooper().getThread() != Thread.currentThread()) {
    throw new IllegalStateException("SurfaceTextureHelper must be created on the handler thread");
  }
  this.handler = handler;

  eglBase = EglBase.create(sharedContext, EglBase.CONFIG_PIXEL_BUFFER);
  try {
    // Both these statements have been observed to fail on rare occasions, see BUG=webrtc:5682.
    eglBase.createDummyPbufferSurface();
    eglBase.makeCurrent();
  } catch (RuntimeException e) {
    // Clean up before rethrowing the exception.
    eglBase.release();
    handler.getLooper().quit();
    throw e;
  }

  oesTextureId = GlUtil.generateTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES);
  surfaceTexture = new SurfaceTexture(oesTextureId);
  setOnFrameAvailableListener(surfaceTexture, (SurfaceTexture st) -> {
    hasPendingTexture = true;
    tryDeliverTextureFrame();
  }, handler);
}
 
開發者ID:Piasy,項目名稱:AppRTC-Android,代碼行數:26,代碼來源:SurfaceTextureHelper.java

示例8: bindShaderValues

import android.opengl.GLES11Ext; //導入依賴的package包/類
@Override
protected void bindShaderValues() {
    mRenderVertices.position(0);
    GLES20.glVertexAttribPointer(mPositionHandle, 2, GLES20.GL_FLOAT, false,
            8, mRenderVertices);
    GLES20.glEnableVertexAttribArray(mPositionHandle);
    mTextureVertices[mCurrentRotation].position(0);
    GLES20.glVertexAttribPointer(mTextureCoordHandle, 2, GLES20.GL_FLOAT, false,
            8, mTextureVertices[mCurrentRotation]);
    GLES20.glEnableVertexAttribArray(mTextureCoordHandle);

    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTextureIn);
    GLES20.glUniform1i(mTextureHandle, 0);

    mSurfaceTexture.getTransformMatrix(mMatrix);
    GLES20.glUniformMatrix4fv(mMatrixHandle, 1, false, mMatrix, 0);
}
 
開發者ID:uestccokey,項目名稱:EZFilter,代碼行數:19,代碼來源:ViewInput.java

示例9: draw

import android.opengl.GLES11Ext; //導入依賴的package包/類
@Override
public void draw(int textureId, FloatBuffer cubeBuffer, FloatBuffer textureBuffer) {
    GLES20.glUseProgram(mProgram);

    cubeBuffer.position(0);
    GLES20.glVertexAttribPointer(mAPositionHandle, 2, GLES20.GL_FLOAT, false, 0, cubeBuffer);
    GLES20.glEnableVertexAttribArray(mAPositionHandle);

    textureBuffer.position(0);
    GLES20.glVertexAttribPointer(mATextureCoordinateHandle, 2, GLES20.GL_FLOAT, false, 0, textureBuffer);
    GLES20.glEnableVertexAttribArray(mATextureCoordinateHandle);

    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureId);
    GLES20.glUniform1i(mUTextureHandle, 0);

    GLES20.glUniformMatrix4fv(mUMVPMatrixHandle, 1, false, mMVPMatrix, 0);

    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);

    GLES20.glDisableVertexAttribArray(mAPositionHandle);
    GLES20.glDisableVertexAttribArray(mATextureCoordinateHandle);
}
 
開發者ID:vipycm,項目名稱:mao-android,代碼行數:24,代碼來源:CameraInputFilter.java

示例10: onDraw

import android.opengl.GLES11Ext; //導入依賴的package包/類
public void onDraw(final int textureId, final FloatBuffer cubeBuffer, final FloatBuffer textureBuffer) {
    if (!mIsInitialized) {
        return;
    }

    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
    GLES20.glUseProgram(mGLProgId);

    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureId);
    GLES20.glUniform1i(mGLUniformTexture, 0);

    GLES20.glVertexAttribPointer(mGLAttribPosition, 2, GLES20.GL_FLOAT, false, 0, cubeBuffer);
    GLES20.glVertexAttribPointer(mGLAttribTextureCoordinate, 2, GLES20.GL_FLOAT, false, 0, textureBuffer);
    GLES20.glEnableVertexAttribArray(mGLAttribPosition);
    GLES20.glEnableVertexAttribArray(mGLAttribTextureCoordinate);

    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
    GLES20.glFlush();
}
 
開發者ID:vipycm,項目名稱:mao-android,代碼行數:21,代碼來源:CameraFilter.java

示例11: createTextureID

import android.opengl.GLES11Ext; //導入依賴的package包/類
public static int createTextureID() {
	int[] texture = new int[1];

	GLES20.glGenTextures(1, texture, 0);
	GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, texture[0]);
	GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
	GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
	GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
	GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);

	return texture[0];
}
 
開發者ID:FacePlusPlus,項目名稱:MegviiFacepp-Android-SDK,代碼行數:17,代碼來源:OpenGLUtil.java

示例12: initTex

import android.opengl.GLES11Ext; //導入依賴的package包/類
/**
 * create external texture
 * @return texture ID
 */
public static int initTex() {
	if (DEBUG) Log.v(TAG, "initTex:");
	final int[] tex = new int[1];
	GLES20.glGenTextures(1, tex, 0);
	GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, tex[0]);
	GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
	GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
	GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
	GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
			GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);
	return tex[0];
}
 
開發者ID:FacePlusPlus,項目名稱:MegviiFacepp-Android-SDK,代碼行數:20,代碼來源:GLDrawer2D.java

示例13: createTextureObject

import android.opengl.GLES11Ext; //導入依賴的package包/類
/**
 * Creates a texture object suitable for use with this program.
 * <p>
 * On exit, the texture will be bound.
 */
public int createTextureObject() {
    int[] textures = new int[1];
    GLES20.glGenTextures(1, textures, 0);
    GlUtil.checkGlError("glGenTextures");

    int texId = textures[0];
    GLES20.glBindTexture(mTextureTarget, texId);
    GlUtil.checkGlError("glBindTexture " + texId);

    GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER,
            GLES20.GL_NEAREST);
    GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER,
            GLES20.GL_LINEAR);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S,
            GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T,
            GLES20.GL_CLAMP_TO_EDGE);
    GlUtil.checkGlError("glTexParameter");

    return texId;
}
 
開發者ID:TobiasLee,項目名稱:FilterPlayer,代碼行數:27,代碼來源:Texture2dProgram.java

示例14: onSurfaceTextureAvailable

import android.opengl.GLES11Ext; //導入依賴的package包/類
@Override
    public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
        if (renderThread != null && renderThread.isAlive()) {
            renderThread.interrupt();
        }
        renderThread = new Thread(this);

        surfaceTexture = surface;
        gwidth = -width;
        gheight = -height;

        // Open camera
//        Pair<Camera.CameraInfo, Integer> backCamera = getBackCamera();
//        final int backCameraId = backCamera.second;
//        camera = Camera.open(backCameraId);
        CameraUtils.openCamera(width, height);

        cameraTextureId = MyGLUtils.genTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES);
        cameraSurfaceTexture = new SurfaceTexture(cameraTextureId);
        CameraUtils.createCameraPreviewSession(cameraSurfaceTexture);

        // Start rendering
        renderThread.start();
    }
 
開發者ID:SimonCherryGZ,項目名稱:face-landmark-android,代碼行數:25,代碼來源:MyCameraRenderer.java

示例15: genTexture

import android.opengl.GLES11Ext; //導入依賴的package包/類
public static int genTexture(int textureType) {
    int[] genBuf = new int[1];
    GLES20.glGenTextures(1, genBuf, 0);
    GLES20.glBindTexture(textureType, genBuf[0]);

    // Set texture default draw parameters
    if (textureType == GLES11Ext.GL_TEXTURE_EXTERNAL_OES) {
        GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
        GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);

    } else {
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
        GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
    }

    return genBuf[0];
}
 
開發者ID:SimonCherryGZ,項目名稱:face-landmark-android,代碼行數:22,代碼來源:MyGLUtils.java


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