Skip to content

Commit f403a1b

Browse files
committed
代码整理(code cleaning)
1 parent f7c4cce commit f403a1b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/src/main/java/com/kenneycode/samples/renderer/SampleShaderRenderer.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class SampleShaderRenderer : GLSurfaceView.Renderer {
6262

6363
// 要渲染的图片纹理
6464
// The texture of the image to be rendered
65-
private var imageTextue = 0
65+
private var imageTexture = 0
6666

6767
// a_position、a_textureCoordinate和s_texture的位置,与shader中写的对应
6868
// The location of a_position、a_textureCoordinate and s_texture, corresponding with which in shader
@@ -91,7 +91,7 @@ class SampleShaderRenderer : GLSurfaceView.Renderer {
9191
GLES30.glEnableVertexAttribArray(LOCATION_ATTRBUTE_TEXTURE_COORDINATE)
9292
GLES30.glVertexAttribPointer(LOCATION_ATTRBUTE_TEXTURE_COORDINATE, TEXTURE_COORDINATE_COMPONENT_COUNT, GLES30.GL_FLOAT, false,0, textureCoordinateDataBuffer)
9393
GLES30.glActiveTexture(GLES30.GL_TEXTURE0)
94-
GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, imageTextue)
94+
GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, imageTexture)
9595

9696
// 调用draw方法用TRIANGLES的方式执行渲染,顶点数量为3个
9797
// Call the draw method with GL_TRIANGLES to render 3 vertices
@@ -172,13 +172,13 @@ class SampleShaderRenderer : GLSurfaceView.Renderer {
172172
// Create texture for image
173173
val textures = IntArray(1)
174174
GLES30.glGenTextures(textures.size, textures, 0)
175-
imageTextue = textures[0]
175+
imageTexture = textures[0]
176176

177177
// 将图片解码并加载到纹理中
178178
// Decode image and load it into texture
179179
GLES30.glActiveTexture(GLES30.GL_TEXTURE0)
180180
val bitmap = Util.decodeBitmapFromAssets("image_0.jpg")
181-
GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, imageTextue)
181+
GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, imageTexture)
182182
val b = ByteBuffer.allocate(bitmap.width * bitmap.height * 4)
183183
bitmap.copyPixelsToBuffer(b)
184184
b.position(0)

0 commit comments

Comments
 (0)