@@ -62,7 +62,7 @@ class SampleShaderRenderer : GLSurfaceView.Renderer {
62
62
63
63
// 要渲染的图片纹理
64
64
// The texture of the image to be rendered
65
- private var imageTextue = 0
65
+ private var imageTexture = 0
66
66
67
67
// a_position、a_textureCoordinate和s_texture的位置,与shader中写的对应
68
68
// The location of a_position、a_textureCoordinate and s_texture, corresponding with which in shader
@@ -91,7 +91,7 @@ class SampleShaderRenderer : GLSurfaceView.Renderer {
91
91
GLES30 .glEnableVertexAttribArray(LOCATION_ATTRBUTE_TEXTURE_COORDINATE )
92
92
GLES30 .glVertexAttribPointer(LOCATION_ATTRBUTE_TEXTURE_COORDINATE , TEXTURE_COORDINATE_COMPONENT_COUNT , GLES30 .GL_FLOAT , false ,0 , textureCoordinateDataBuffer)
93
93
GLES30 .glActiveTexture(GLES30 .GL_TEXTURE0 )
94
- GLES30 .glBindTexture(GLES30 .GL_TEXTURE_2D , imageTextue )
94
+ GLES30 .glBindTexture(GLES30 .GL_TEXTURE_2D , imageTexture )
95
95
96
96
// 调用draw方法用TRIANGLES的方式执行渲染,顶点数量为3个
97
97
// Call the draw method with GL_TRIANGLES to render 3 vertices
@@ -172,13 +172,13 @@ class SampleShaderRenderer : GLSurfaceView.Renderer {
172
172
// Create texture for image
173
173
val textures = IntArray (1 )
174
174
GLES30 .glGenTextures(textures.size, textures, 0 )
175
- imageTextue = textures[0 ]
175
+ imageTexture = textures[0 ]
176
176
177
177
// 将图片解码并加载到纹理中
178
178
// Decode image and load it into texture
179
179
GLES30 .glActiveTexture(GLES30 .GL_TEXTURE0 )
180
180
val bitmap = Util .decodeBitmapFromAssets(" image_0.jpg" )
181
- GLES30 .glBindTexture(GLES30 .GL_TEXTURE_2D , imageTextue )
181
+ GLES30 .glBindTexture(GLES30 .GL_TEXTURE_2D , imageTexture )
182
182
val b = ByteBuffer .allocate(bitmap.width * bitmap.height * 4 )
183
183
bitmap.copyPixelsToBuffer(b)
184
184
b.position(0 )
0 commit comments