Class Texture

Inheritance Relationships

Base Type

  • public tgui::BackendTexture

Class Documentation

class Texture : public tgui::BackendTexture

Declaration: final

UI-owned CPU texture bridge; loaded pixels are snapshotted and immutable for completed recordings.

Public Functions

explicit Texture(unsigned int maximum_size)

Require a positive maximum dimension representable by int; invalid bounds throw invalid_args.

bool loadTextureOnly(tgui::Vector2u size, const std::uint8_t *pixels, bool smooth) override

Copy transient top-to-bottom straight-alpha RGBA pixels before returning true.

Require nonnull pixels, positive dimensions within the configured bound and representable byte count; invalid input/allocation failures throw. Completed recordings retain earlier snapshots independently.

void setSmooth(bool smooth) override

Change the toolkit filtering preference without mutating the immutable pixel snapshot; later recordings copy the new value.

inline std::shared_ptr<const CE::Assets::Images::Decoded> snapshot() const

Declaration: [[nodiscard]]

Return a retained immutable CPU image, null before loading; survives this native Texture.