GitHub - brisklib/brisk: Cross-platform C++20 GUI framework featuring MVVM architecture, reactive capabilities, and scalable, accelerated GPU rendering. (original) (raw)

Brisk

Brisk is a modern, cross-platform C++ GUI framework designed to build responsive, high-performance applications with flexibility and ease.

Initially developed for a graphics-intensive proprietary project with a complex and dynamic GUI.

Note

The Brisk library is currently under active development. Breaking changes may occur, and the documentation might not always be up to date. Contributions are always welcome!

Recommended reading:

➑️ Brisk Design and Feature Overview ⬅️

Documentation on docs.brisklib.com

Build License

C++ Clang 16+ GCC 12+ MSVC 2022 Xcode 14.3+

Our other projects

πŸ”΄ KFR is a modern C++ DSP library. Includes IIR/FIR filters + filter design, FFT/DFT, Convolution, Resampling. Optimized for all kinds of x86 and ARM architectures. (GPL/Commercial)

🟒 CxxDox β€” C++ documentation generator. (MIT)

Key Features 🌟

Code Example

Component example

const NameValueOrderedList textAlignList{ { "Start", TextAlign::Start }, { "Center", TextAlign::Center }, { "End", TextAlign::End } };

class Example : public Component { public: Rc build() final { // rcnew Widget{...} is equivalent to std::shared_ptr(new Widget{...}) return rcnew Widget{ layout = Layout::Vertical, rcnew Text{ "Switch (widgets/Switch.hpp)", classes = { "section-header" }, // Widgets can be styled using stylesheets },

        rcnew HLayout{
            rcnew Widget{
                rcnew Switch{
                    // Bind the switch value to the m_toggled variable (bidirectional)
                    value = Value{ &m_toggled },
                    rcnew Text{ "Switch" },
                },
            },
            gapColumn = 10_apx, // CSS Flex-like properties
            rcnew Text{
                text = Value{ &m_label }, // Text may be dynamic
                visible =
                    Value{ &m_toggled }, // The Switch widget controls the visibility of this text widget
            },
        },

        // Button widget
        rcnew Button{
            rcnew Text{ "Click" },
            // Using lifetime() ensures that callbacks will be detached once the Component is deleted
            onClick = lifetime() |
                      [this]() {
                          // Notify bindings about the change
                          *bindings->modify(m_label) = "Updated text";
                      },
        },

        // ComboBox widget
        rcnew ComboBox{
            Value{ &m_textAlignment },  // Bind ComboBox value to an enumeration
            notManaged(&textAlignList), // Pass the list of name-value pairs to populate the ComboBox
        },

        // The Builder creates widgets dynamically whenever needed
        Builder([this](Widget* target) {
            for (int i = 0; i < m_number; ++i) {
                target->apply(rcnew Widget{
                    dimensions = { 40_apx, 40_apx },
                });
            }
        }),
        depends = Value{ &m_number }, // Instructs to rebuild this if m_number changes
    };
}

private: bool m_toggled = false; TextAlign m_textAlignment = TextAlign::Start; std::string m_label = "OK"; float m_progress = 0; int m_number = 0; };

Screenshots

Brisk screenshot Brisk screenshot Brisk screenshot Brisk screenshot Brisk screenshot Brisk screenshot Brisk screenshot

Modules

Core

Graphics

Window

GUI

Widgets

Requirements βš™οΈ

Platform Support

Windows macOS Linux
Core Functionality Beta Beta Beta
Graphics Beta Beta Beta
Window System Beta Beta Beta
Widgets Beta Beta Beta
Application Support Alpha Alpha N/A

OS Support

Minimum version
Windows Windows 10, Windows Server 2016
macOS macOS 11 Big Sur
Linux n/a

Graphics Backend Support

Backends
Windows D3D11 and WebGPU (D3D12/Vulkan)
macOS WebGPU (Metal)
Linux WebGPU (OpenGL/Vulkan)

Example Projects

The examples directory contains projects that showcase how to use the Brisk library.

For a minimal example, check out the brisk-helloworld repository.

Example Project Binary Size:

OS Static Build, Release (Full Unicode Support)
Windows x64 10.1 MB (D3D11)
Linux x64 18.2 MB (WebGPU: Vulkan/OpenGL), stripped
macOS x64 16.5 MB (WebGPU: Metal), stripped

These sizes do not include embedded resources (such as fonts).

Development πŸ’»

Brisk is in active development, and we welcome contributions and feedback from the community to improve and expand the toolkit.

The main branch contains the latest features and generally passes all built-in tests βœ…. Other branches are reserved for feature development and may be force-pushed.

License πŸ“œ

Brisk is licensed under the GPL v2.0 or later. However, for those who wish to use Brisk in proprietary or closed-source applications, a commercial license is also available. For more details on commercial licensing, please contact us at brisk@brisklib.com.