Note: As of July 10, 2024, watch faces must use the Watch Face Format in order to be installed on new watches that launch with Wear OS 5 pre-installed. Learn more about the user-facing changes in this Help Center article.

Additionally, starting in early 2025 (specific date to be announced during Q4 2024), all new watch faces published on Google Play must use the Watch Face Format.

public final class GlesTextureComplication


Helper for rendering a ComplicationSlot to a GLES20 texture. To use call renderToTexture and then bind before drawing.

Summary

Public constructors

GlesTextureComplication(
    @NonNull ComplicationSlot complicationSlot,
    @Px int textureWidth,
    @Px int textureHeight,
    int textureType
)

Public methods

final void

Bind the texture to the active texture target.

final @NonNull ComplicationSlot

The ComplicationSlot to render to texture.

final void
renderToTexture(
    @NonNull ZonedDateTime zonedDateTime,
    @NonNull RenderParameters renderParameters
)

Renders complicationSlot to an OpenGL texture.

Public constructors

GlesTextureComplication

Added in 1.0.0
public GlesTextureComplication(
    @NonNull ComplicationSlot complicationSlot,
    @Px int textureWidth,
    @Px int textureHeight,
    int textureType
)
Parameters
@NonNull ComplicationSlot complicationSlot

The ComplicationSlot to render to texture.

@Px int textureWidth

The width of the texture in pixels to create.

@Px int textureHeight

The height of the texture in pixels to create.

int textureType

The texture type, e.g. GLES20.GL_TEXTURE_2D.

Public methods

bind

Added in 1.0.0
public final void bind()

Bind the texture to the active texture target.

getComplicationSlot

Added in 1.0.0
public final @NonNull ComplicationSlot getComplicationSlot()

The ComplicationSlot to render to texture.

renderToTexture

Added in 1.0.0
public final void renderToTexture(
    @NonNull ZonedDateTime zonedDateTime,
    @NonNull RenderParameters renderParameters
)

Renders complicationSlot to an OpenGL texture.