本文整理匯總了Java中android.opengl.GLES11Ext.GL_TEXTURE_EXTERNAL_OES屬性的典型用法代碼示例。如果您正苦於以下問題:Java GLES11Ext.GL_TEXTURE_EXTERNAL_OES屬性的具體用法?Java GLES11Ext.GL_TEXTURE_EXTERNAL_OES怎麽用?Java GLES11Ext.GL_TEXTURE_EXTERNAL_OES使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.opengl.GLES11Ext
的用法示例。
在下文中一共展示了GLES11Ext.GL_TEXTURE_EXTERNAL_OES屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: GLSurfaceFilter
/**
* Constructor
* this should be called in GL context
*/
public GLSurfaceFilter() {
mCoordsPerVertex = 2;
mVertexStride = mCoordsPerVertex * SIZEOF_FLOAT; // 8
mVertexCount = FULL_RECTANGLE_COORDS.length / mCoordsPerVertex; //4
mTexCoordStride = 2 * SIZEOF_FLOAT; //8
hProgram = GLUtil.loadProgram(VERTEX_SHADER, FRAGMENT_SHADER);
mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
// get locations of attributes and uniforms
maPositionLoc = GLES20.glGetAttribLocation(hProgram, "aPosition");
GLUtil.checkLocation(maPositionLoc, "aPosition");
maTextureCoordLoc = GLES20.glGetAttribLocation(hProgram, "aTextureCoord");
GLUtil.checkLocation(maTextureCoordLoc, "aTextureCoord");
muMVPMatrixLoc = GLES20.glGetUniformLocation(hProgram, "uMVPMatrix");
GLUtil.checkLocation(muMVPMatrixLoc, "uMVPMatrix");
muTexMatrixLoc = GLES20.glGetUniformLocation(hProgram, "uTexMatrix");
GLUtil.checkLocation(muTexMatrixLoc, "uTexMatrix");
}
示例2: genTexture
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];
}
示例3: onInitTextureExt
private void onInitTextureExt(boolean isForExternalTextureInput) {
mTextureTarget = GLES20.GL_TEXTURE_2D;
if (isForExternalTextureInput) {
mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
mFragmentShader = "#extension GL_OES_EGL_image_external : require\n" +
mFragmentShader.replace("uniform sampler2D inputImageTexture;",
"uniform samplerExternalOES inputImageTexture;");
int[] textures = new int[1];
GLES20.glGenTextures(1, textures, 0);
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textures[0]);
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);
mSysRenderTexture = textures[0];
}
}
示例4: GPUImageExtFilter
public GPUImageExtFilter(final String vertexShader, final String fragmentShader) {
mVertexShader = vertexShader;
mFragmentShader = fragmentShader;
mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
}
示例5: Texture2dProgram
/**
* Prepares the program in the current EGL context.
*/
public Texture2dProgram(ProgramType programType) {
mProgramType = programType;
switch (programType) {
case TEXTURE_2D:
mTextureTarget = GLES20.GL_TEXTURE_2D;
mProgramHandle = GlUtil.createProgram(VERTEX_SHADER, FRAGMENT_SHADER_2D);
break;
case TEXTURE_EXT:
mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
mProgramHandle = GlUtil.createProgram(VERTEX_SHADER, FRAGMENT_SHADER_EXT);
break;
case TEXTURE_EXT_BW:
mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
mProgramHandle = GlUtil.createProgram(VERTEX_SHADER, FRAGMENT_SHADER_EXT_BW);
break;
case TEXTURE_EXT_FILT:
mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
mProgramHandle = GlUtil.createProgram(VERTEX_SHADER, FRAGMENT_SHADER_EXT_FILT);
break;
default:
throw new RuntimeException("Unhandled type " + programType);
}
if (mProgramHandle == 0) {
throw new RuntimeException("Unable to create program");
}
Log.d(TAG, "Created program " + mProgramHandle + " (" + programType + ")");
// get locations of attributes and uniforms
maPositionLoc = GLES20.glGetAttribLocation(mProgramHandle, "aPosition");
GlUtil.checkLocation(maPositionLoc, "aPosition");
maTextureCoordLoc = GLES20.glGetAttribLocation(mProgramHandle, "aTextureCoord");
GlUtil.checkLocation(maTextureCoordLoc, "aTextureCoord");
muMVPMatrixLoc = GLES20.glGetUniformLocation(mProgramHandle, "uMVPMatrix");
GlUtil.checkLocation(muMVPMatrixLoc, "uMVPMatrix");
muTexMatrixLoc = GLES20.glGetUniformLocation(mProgramHandle, "uTexMatrix");
GlUtil.checkLocation(muTexMatrixLoc, "uTexMatrix");
muKernelLoc = GLES20.glGetUniformLocation(mProgramHandle, "uKernel");
if (muKernelLoc < 0) {
// no kernel in this one
muKernelLoc = -1;
muTexOffsetLoc = -1;
muColorAdjustLoc = -1;
} else {
// has kernel, must also have tex offset and color adj
muTexOffsetLoc = GLES20.glGetUniformLocation(mProgramHandle, "uTexOffset");
GlUtil.checkLocation(muTexOffsetLoc, "uTexOffset");
muColorAdjustLoc = GLES20.glGetUniformLocation(mProgramHandle, "uColorAdjust");
GlUtil.checkLocation(muColorAdjustLoc, "uColorAdjust");
// initialize default values
setKernel(new float[] {0f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 0f}, 0f);
setTexSize(256, 256);
}
}
示例6: getTextureTarget
@Override public int getTextureTarget() {
return GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
}