GlesTextureComplication

public final class GlesTextureComplication


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

Summary

Public fields

final @NonNull ComplicationSlot

The ComplicationSlot to render to texture.

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 void
renderToTexture(
    @NonNull ZonedDateTime zonedDateTime,
    @NonNull RenderParameters renderParameters
)

Renders complicationSlot to an OpenGL texture.

Public fields

complicationSlot

@NonNull
public final @NonNull ComplicationSlot complicationSlot

The ComplicationSlot to render to texture.

Public constructors

GlesTextureComplication

public final 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

@NonNull
public final void bind()

Bind the texture to the active texture target.

renderToTexture

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

Renders complicationSlot to an OpenGL texture.