```kotlin
private fun allocTex(): Int {
val surfaceTexture = flutterPluginBinding.textureRegistry.createSurfaceTexture()
val id = surfaceTexture.id().toInt()
textures.put(id, surfaceTexture)
return id
}
```
使用纹理的流程
```kotlin
private fun updateTex(args: HashMap<String, Any>): Int {
...
val tex = textures[texId] //allocTex创建的纹理
...