Skip to content

gl::State#

Helper class for optimizing gl calls count

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

Examples#

examples/7guis/cells/src/main.cpp

7GUIs Cells — Spreadsheet processor (Excel).

using namespace declarative;
using namespace ass;

struct State {
    Spreadsheet spreadsheet{glm::uvec2 { 'Z' - 'A' + 1, 100 }};
    AProperty<AString> currentExpression;
};

static _<AView> labelTitle(AString s) {
examples/7guis/flight_booker/src/main.cpp

7GUIs Flight Booker — Flight Booker.

    };
}
/// [date_field]

struct State {
    DateTextFieldState departureDate { .parsed = system_clock::now() }, returnDate { .parsed = system_clock::now() };
    AProperty<bool> isReturnFlight = false;
    bool isValid() const {
        if (!departureDate.parsed->hasValue()) {
            return false;
examples/7guis/circle_drawer/src/main.cpp

7GUIs Circle Drawer — Undo, redo, dialog control.

    AProperty<Iterator> nextAction = mStack.end();
};

struct State {
    AProperty<std::list<Circle>> circles;
    UndoStack history;
};

static constexpr auto MAX_RADIUS = 128.f;
examples/ui/opengl_simple/src/main.cpp

OpenGL Example — Demonstrates how to integrate custom OpenGL rendering with AUI Framework.

using namespace declarative;

namespace {

struct State {
    AProperty<float> fps = 0;
};

class MyRenderer : public AView {
public:
examples/ui/views/src/ExampleWindow.cpp

Views Example — All-in-one views building example.

}
/// [label_coloring]

static _<AView> checkBoxesDemo() {
    struct State {
        AProperty<bool> checked1 = false, checked2 = true;
    };
    auto state = _new<State>();
    return Vertical {
        CheckBox {
examples/ui/infinite_lazy_list/src/main.cpp

Infinite Lazy List — Usage of AUI_DECLARATIVE_FOR to make an infinite lazy list.

struct Item {
    AProperty<AString> value;
};

struct State {
    AProperty<AVector<_<Item>>> items;
    AProperty<bool> needMore = false;
    AAsyncHolder asyncTasks;
};