glTexParameter — set texture parameters
C Specification
void glTexParameterf( | GLenum target, |
GLenum pname, | |
GLfloat param) ; |
void glTexParameteri( | GLenum target, |
GLenum pname, | |
GLint param) ; |
Parameters
-
Specifies the target texture of the active texture unit, which must be either
GL_TEXTURE_2D
orGL_TEXTURE_CUBE_MAP
. -
Specifies the symbolic name of a single-valued texture parameter.
pname
can be one of the following:GL_TEXTURE_MIN_FILTER
,GL_TEXTURE_MAG_FILTER
,GL_TEXTURE_WRAP_S
, orGL_TEXTURE_WRAP_T
. -
Specifies the value of
pname
. -
具体来说是设置纹理参数的
-
第一个参数是将纹理设置到哪里,第二个参数是纹理的类型,第三个参数是纹理的值
-
-
怎么操作这个纹理,也就是得到这个纹理的指针呢
-
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, texture[0]);如此位置就储存在texture[0]里了
比如 -
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];
当然,这只是一个配置,并没有传入真正的纹理进去
target
pname
param