Share via


SurfaceTexture.AttachToGLContext(Int32) Method

Definition

Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread.

[Android.Runtime.Register("attachToGLContext", "(I)V", "GetAttachToGLContext_IHandler")]
public virtual void AttachToGLContext (int texName);
[<Android.Runtime.Register("attachToGLContext", "(I)V", "GetAttachToGLContext_IHandler")>]
abstract member AttachToGLContext : int -> unit
override this.AttachToGLContext : int -> unit

Parameters

texName
Int32

The name of the OpenGL ES texture that will be created. This texture name must be unused in the OpenGL ES context that is current on the calling thread.

Attributes

Remarks

Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread. A new OpenGL ES texture object is created and populated with the SurfaceTexture image frame that was current at the time of the last call to #detachFromGLContext. This new texture is bound to the GL_TEXTURE_EXTERNAL_OES texture target.

This can be used to access the SurfaceTexture image contents from multiple OpenGL ES contexts. Note, however, that the image contents are only accessible from one OpenGL ES context at a time.

Java documentation for android.graphics.SurfaceTexture.attachToGLContext(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to