SurfaceRenderTexture
Create a SurfaceRenderTexture resource with the specified width, height, maxBufferCount, and usageFlag.
Note: The SurfaceRenderTexture can automatically adapt to the video resolution changes without requiring recreation. You only need to initialize it once with a specific resolution.
Important: To prevent the SurfaceRenderTexture from being garbage collected, highly recommend maintain a strong reference to the returned SurfaceRenderTexture instance until it is no longer needed. If the SurfaceRenderTexture is only stored in a local variable and no other references exist, it may be garbage collected prematurely, leading to unexpected behavior. If you want to reuse the SurfaceRenderTexture instance, please call 'toGlobal()' to make it a global resource when it is created.
Parameters
The width of the SurfaceRenderTexture to initialize.
The height of the SurfaceRenderTexture to initialize.
The max buffer count of the SurfaceRenderTexture to initialize.
The texture usage flag to use. Default is TextureUsageFlag.TEXTURE_USAGE_NONE. Note: TextureUsageFlag.TEXTURE_USAGE_PROTECTED_CONTENT is only supported on physical devices.