7thFACTOR / horus_ui

HorusUI Immediate Mode Graphical User Interface
MIT License
143 stars 13 forks source link
docking-framework gui imgui ui user-interface widget-toolkit widgets

HUI Logo

Immediate Mode Graphical User Interface for Tools

HUI

OVERVIEW

The HorusUI library allows you to quickly develop GUIs for your applications by leveraging the ease of use provided by immediate mode GUI concepts. No need to design your GUI layout and writing many lines of boilerplate GUI preparation, imgui takes care of layouting and making sure every widget you add to the system has an unique ID, gets drawn and responds to events. Ideally you should be familiar with https://en.wikipedia.org/wiki/Immediate_Mode_GUI. There are other imgui libs out there, dear-imgui which is more like a debug GUI and Nuklear which resembles HorusUI. HorusUI was specifically designed to create game editor tools or similar types of applications.

NOTE: The library is still work in progress, changes will occur until stabilization

For direct support: nekitu@gmail.com

If you want to help with the development, donations are welcomed:

Donations on Patreon:
Patreon

Donations on PayPal:
PayPal

QUICK SAMPLE (C++)

HUI

    auto huiCtx = hui::createContext(hui::GraphicsApi::OpenGL);
    auto wnd = hui::createWindow("Sample", 1000, 800);
    hui::setWindow(wnd);
    auto theme = hui::loadTheme("../themes/default.theme");
    hui::setTheme(theme);

    auto largeFnt = hui::getFont(theme, "title");

    while (true)
    {
        hui::processEvents();
        hui::setWindow(hui::getMainWindow());
        hui::beginWindow(hui::getMainWindow());

        // user drawing code
        glClearColor(0, .3, .2, 1);
        glClear(GL_COLOR_BUFFER_BIT);

    // horus ui
        hui::beginFrame();
        hui::Rect panelRect = { 50, 50, 350, 500 };
        hui::beginContainer(panelRect);
        hui::WidgetElementInfo elemInfo;
        hui::getThemeWidgetElementInfo(hui::WidgetElementId::PopupBody, hui::WidgetStateType::Normal, elemInfo);
        hui::setBackColor(hui::Color::white);
        hui::drawBorderedImage(elemInfo.image, elemInfo.border, panelRect);
        hui::pushPadding(15);
        hui::gap(15);
        hui::labelCustomFont("Information", largeFnt);
        hui::button("Activate shields");
        static bool chk1, chk2, chk3;
        hui::beginTwoColumns();
        chk1 = hui::check("Option 1", chk1);
        chk2 = hui::check("Option 2", chk2);
        hui::nextColumn();
        chk3 = hui::check("Option 3", chk3);
        hui::pushTint(hui::Color::cyan);
        hui::button("Browse...");
        hui::popTint();
        hui::endColumns();
        static float val;
        hui::sliderFloat(0, 100, val);
        static char txt[2000];
        hui::textInput(txt, 2000, hui::TextInputValueMode::Any, "Write something here");
        hui::space();

        static f32 scrollPos = 0;
        hui::beginScrollView(200, scrollPos);
        hui::multilineLabel("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur?", hui::HAlignType::Left);
        hui::line();
        hui::button("I AGREE");
        scrollPos = hui::endScrollView();

        if (hui::button("Exit"))
            hui::quitApplication();

        hui::popPadding();
        hui::endContainer();
        hui::endFrame();
        hui::endWindow();
        hui::presentWindow(hui::getMainWindow());

        if (hui::wantsToQuit() || hui::mustQuit())
            break;
    }

    hui::shutdown();

PREREQUISITES

Windows: Microsoft Visual Studio 2017

Linux: g++

GTK3 dev, needed for the nativefiledialog lib, use: sudo apt-get install libgtk-3-dev

GLU/GLUT dev, needed by GLEW, use: sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev

BUILDING

Windows:

Linux:

FEATURES

ROADMAP