Skip to content

sudoevolve/EUI-NEO

Repository files navigation

EUI-NEO

EUI icon

Release Build Release License C++17 CMake 3.14+ OpenGL / Vulkan GLFW / SDL2 GitHub stars

简体中文 · Website

EUI-NEO is a cross-platform, high-performance, low-overhead C++17 UI framework with GLFW/SDL2 window backends and OpenGL/Vulkan render backends.

Preview

preview 1 preview 2
preview 3 preview 4
example 1 example 2

Quick Start

Requirements:

  • CMake 3.14+
  • A C++17 compiler
  • OpenGL development files for the default renderer.
  • Vulkan SDK is optional. Use a build-vk directory only when you want the Vulkan renderer.
  • Platform OpenGL/windowing development files. Linux builds also need X11 and libcurl development packages.

Build-time sources for GLFW, glad, tray, FreeType, HarfBuzz, libpng, and zlib are vendored under 3rd/. The default dependency mode is auto: CMake uses the local 3rd/ sources when they are present, and fetches only missing dependencies from pinned upstream URLs. Use -DEUI_DEPS_MODE=bundled for strict offline builds, or -DEUI_DEPS_MODE=fetch to force online dependency fetches. HarfBuzz shaping is enabled by default and can be disabled with -DEUI_ENABLE_HARFBUZZ=OFF.

Bundled and fetched dependencies are built for static linking by default, including GLFW. Release packages therefore do not need to ship a GLFW DLL / dylib / so. SDL2 may still be dynamic when you choose a system SDL2 package. The eui_neo target itself is static by default; configure with -DEUI_BUILD_SHARED=ON when you want to build and install it as a shared library.

GLFW is the default window backend. SDL2 is optional and is not vendored. If GLFW is not available or you want to test SDL2, add sdl2 to the build directory name:

cmake -S . -B build-sdl2
cmake --build build-sdl2

If a system SDL2 package is not available, add -DEUI_DEPS_MODE=fetch to download the pinned SDL2 source.

macOS / Linux example:

cmake -S . -B build
cmake --build build
./build/gallery

Explicit render backend examples:

cmake -S . -B build-vk
cmake --build build-vk --target gallery

Build directory suffixes are recognized on first configure: build means GLFW + OpenGL, build-sdl2 means SDL2 + OpenGL, build-vk means GLFW + Vulkan, and build-sdl2-vk means SDL2 + Vulkan. If a build directory already has a CMake cache, delete it or pass -DEUI_WINDOW_BACKEND=... / -DEUI_RENDER_BACKEND=... explicitly.

Windows / PowerShell example:

cmake -S . -B build
cmake --build build --config Release
.\build\Release\gallery.exe

Linux package hint:

sudo apt-get install -y ninja-build libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev libcurl4-openssl-dev
# Optional for -DEUI_WINDOW_BACKEND=sdl2:
sudo apt-get install -y libsdl2-dev

Top-level builds create one executable for each examples/*.cpp page source, such as gallery, chat, and eui_demo. After build, assets/ is copied next to the executable automatically.

Tagged releases (v*) build Windows, Linux, and macOS packages through GitHub Actions and upload runtime and SDK packages as release assets. Runtime packages automatically collect every executable generated from examples/*.cpp.

Use In Your Project

The recommended path is to add EUI-NEO as a CMake subdirectory, use the provided app main source, and write your UI through the public facade header.

Minimal CMake:

cmake_minimum_required(VERSION 3.14)
project(MyProject LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_subdirectory(external/EUI-NEO)

add_executable(my_app
    external/EUI-NEO/core/app/glfw_app_main.cpp
    app.cpp
)
eui_neo_configure_app(my_app)

Minimal app.cpp:

#include "eui_neo.h"

namespace app {

const DslAppConfig& dslAppConfig() {
    static const DslAppConfig config = DslAppConfig{}
        .title("My App")
        .pageId("my_app")
        .windowSize(960, 640);
    return config;
}

void compose(eui::Ui& ui, const eui::Screen& screen) {
    ui.column("root")
        .size(screen.width, screen.height)
        .padding(32.0f)
        .content([&] {
            ui.text("title")
                .text("Hello EUI-NEO")
                .fontSize(28.0f)
                .build();
        })
        .build();
}

} // namespace app

Build:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
./build/my_app

EUI-NEO owns the window, event loop, selected render backend, and asset copying in this setup. For SDL2, Vulkan, FetchContent, custom main loops, or building the bundled examples from a parent project, see the Integration Guide.

Project Layout

assets/       Runtime assets: fonts, PNG, SVG, and icons
components/   Reusable UI components built on top of the DSL
core/         DSL, Runtime, primitives, text, image, network, and platform code
docs/         Implementation notes and API documentation
examples/     Standalone gallery and example application sources
include/      Public include path: eui_neo.h and eui/* facade headers
tests/        Probe sources, fixture apps, and local benchmark notes
3rd/          Vendored third-party build sources and single-file dependencies

Docs

License

EUI-NEO's original source code is licensed under the Apache License 2.0. Third-party code under 3rd/, optional build-time dependencies fetched by CMake, and bundled fonts or icon fonts under assets/ follow their respective upstream licenses and copyright notices.

Star History

Star History Chart

About

EUI-NEO is a cross-platform, high-performance, low-overhead C++17 GPUI framework

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors