Skip to content

ATexturedBrush#

Header:#include <AUI/Render/ABrush.h>
CMake:aui_link(my_target PUBLIC aui::views)

Examples#

examples/app/game_of_life/src/main.cpp

Game of Life - Game of Life implementation that uses advanced large dynamic data rendering techniques such as ITexture, AImage to be GPU friendly. The computation is performed in AThreadPool.

    void render(ARenderContext ctx) override {
        AView::render(ctx);
        if (mTexture) {
            ctx.render.rectangle(ATexturedBrush { mTexture }, { 0, 0 }, float(SCALE) * glm::vec2(mCells->size()));
        }
        auto drawGrid = [&] {
            ASmallVector<std::pair<glm::vec2, glm::vec2>, 128 * 2> points;
            for (int i = 1; i < mCells->size().x; ++i) {
                points << std::make_pair(glm::vec2(i * SCALE, 0.f), glm::vec2(i * SCALE, getSize().y));

Public fields and Signals#


imageRendering#

ImageRendering imageRendering

Optional. Controls how does the image is scaled.

Warning!
When set to ImageRendering::SMOOTH, on software renderer it produces extra CPU costs.

repeat#

Repeat repeat

Optional. Controls how does the image behaves when it's size is not enough to cover the whole rect.


uv1#

AOptional<glm::vec2> uv1

Optional. Top left UV coords of the texture.

Warning!
When set, on software renderer it produces extra CPU costs.

uv2#

AOptional<glm::vec2> uv2

Optional. Bottom right UV coords of the texture.

Warning!
When set, on software renderer it produces extra CPU costs.