Cogl.gles2_texture_get_handle

function gles2_texture_get_handle(texture: Cogl.Texture, handle: Number(guint), target: Number(guint)): Cogl.Bool {
    // Gjs wrapper for cogl_gles2_texture_get_handle()
}
  

Gets an OpenGL ES 2.0 texture handle for a Cogl.Texture that can then be referenced by a Cogl.GLES2Context. As well as returning a texture handle the texture's target (such as GL_TEXTURE_2D) is also returned.

If the Cogl.Texture can not be shared with a Cogl.GLES2Context then this function will return false.

This api does not affect the lifetime of the CoglTexture and you must take care not to reference the returned handle after the original texture has been freed.

<note>This interface is only intended for sharing textures to read from. The behaviour is undefined if the texture is modified by a GLES2 context.</note>

<note>This function will only return true for low-level Cogl.Texture<!-- -->s such as Cogl.Texture2D or Cogl.Texture3D but not for high level meta textures such as Cogl.Texture2DSliced</note>

<note>The handle returned should not be passed directly to a system OpenGL ES 2.0 library, the handle is only intended to be used via a Cogl.GLES2Vtable or via libcogl-gles2.</note>

Since 2.0

texture

A Cogl.Texture

handle

A return location for an OpenGL ES 2.0 texture handle

target

A return location for an OpenGL ES 2.0 texture target

Returns

true if a handle and target could be returned otherwise false is returned.