Skip to content

Example implementation

zxvnme edited this page Jul 12, 2019 · 1 revision

Example implementation

// Start input loop
zgui::poll_input("type_window_name_here"); // Improper calling will result in exception.
// Search in zgui.hh for [input handling] to get more details.

static bool example = false;
static int example_int = 10;
if (zgui::begin_window("zgui example window", { 500, 350 }, g::Tahoma, zgui::zgui_window_flags_none))
{
    zgui::checkbox("sample checkbox #example", example);
    // value before hash is visible ^
    zgui::slider_int("#sample_slider", 0, 40, example_int);
    //                ^ value after hash is hidden"
    //
    // Hashing is demystified in zgui.hh
    // Search for [hashing controls names] to get more details.
    zgui::end_window();
}
Clone this wiki locally