Skip to content

MyGUI/mygui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5,342 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyGUI logo

CI

MyGUI is a cross-platform library for creating graphical user interfaces (GUIs) for games and 3D applications. It is written in C++17 and is designed to be fast, flexible, and easy to integrate with various rendering engines.

Showcase | Projects using MyGUI

Features

  • Wide widget set: buttons, edit boxes, combo boxes, lists, tree controls, item boxes, tab controls, scroll bars, progress bars, windows, and more
  • Multiple render backends: Direct3D 9, Direct3D 11, OpenGL (legacy), OpenGL 3.x, OpenGL ES 2.0, Ogre and OgreNext
  • Skin system: fully customizable widget appearance via XML-based skin definitions
  • Layout system: load UI layouts from XML files at runtime; includes a visual Layout Editor
  • Tools: built-in editors for layouts, skins, images, and fonts
  • Font rendering: TrueType fonts via FreeType, bitmap fonts, and MSDF (multi-channel signed distance field) font support
    • Five hinting modes: native, auto-hint, no-auto-hint, monochrome, and disabled
    • Dynamic kerning with per-pair spacing adjustments
    • Configurable Unicode code point ranges with inclusion and exclusion support
    • Text effects: shadow, colour, selection highlighting, cursor, word wrap, and alignment
    • MSDF shaders for OpenGL 3.x, OpenGL ES, DirectX 11, Ogre, OgreNext (GLSL, HLSL, Metal, SPIR-V)
    • Visual FontEditor tool for authoring and previewing font definitions
  • Platform support: Windows, Linux, macOS; also runs in the browser via Emscripten
  • Localization: built-in language string management
  • Animation: configurable widget controllers for fades, slides, and more

Rendering Backends

Backend CMake ID
Dummy (no-op) 1
Ogre 3
OpenGL (legacy) 4
Direct3D 9 5
Direct3D 11 6
OpenGL 3.x 7
OpenGL ES 2.0 (Emscripten) 8
OgreNext 9

Select a backend with the -DMYGUI_RENDERSYSTEM=<id> CMake option.

Build

Requirements

  • CMake ≥ 3.22
  • C++17 compiler
  • SDL2 for tools and demos
  • FreeType (optional, enabled by default)
  • One of the render systems

Quick start

git clone https://github.com/MyGUI/mygui.git
cd mygui
cmake -S . -B build -DMYGUI_RENDERSYSTEM=7
cmake --build build

Usage in your project

After installing MyGUI, use it from your CMake project with modern targets:

find_package(MyGUI REQUIRED)
target_link_libraries(myapp PRIVATE MyGUI::MyGUI MyGUI::OgrePlatform)

Available targets:

Target Description
MyGUI::MyGUI Core library
MyGUI::OgrePlatform Ogre backend
MyGUI::OpenGLPlatform OpenGL backend
MyGUI::OpenGL3Platform OpenGL 3.x backend
MyGUI::OpenGLES OpenGLES backend
MyGUI::DirectXPlatform Direct3D 9 backend
MyGUI::DirectX11Platform Direct3D 11 backend
MyGUI::OgreNextPlatform OgreNext backend

Build options:

Option Default Description
MYGUI_RENDERSYSTEM 7 (OpenGL 3.x) Render backend
MYGUI_USE_FREETYPE ON Enable FreeType font rendering
MYGUI_MSDF_FONTS OFF Enable MSDF font support
MYGUI_BUILD_DEMOS ON Build demo applications
MYGUI_BUILD_TOOLS ON Build layout/skin/font/image editors
MYGUI_BUILD_UNITTESTS OFF Build complex demos and tests
MYGUI_BUILD_WRAPPER OFF Build C# bindings (Windows only)
MYGUI_BUILD_TEST_APP OFF Build test application

Tools

MyGUI ships with several visual editors under Tools/:

  • LayoutEditor — WYSIWYG layout designer (produces .layout XML files)
  • SkinEditor — widget skin creator
  • ImageEditor — image resource editor
  • FontEditor — font resource editor

Documentation

  • Website: http://mygui.info/
  • API docs: build with cmake --build build --target api-docs (requires Doxygen)

Code formatting

This project uses clang-format to enforce a consistent C++ code style. Before committing, run the formatting check:

Scripts/run-clang-format.py

Use --fix to format files in-place:

Scripts/run-clang-format.py --fix

To run the check automatically on every commit, install pre-commit:

pip install pre-commit
pre-commit install

The pre-commit hook is optional — it skips automatically if clang-format is not installed.

License

This project is licensed under the MIT License — see COPYING.MIT for details.

Links

About

Fast, flexible and simple GUI.

Resources

License

Stars

834 stars

Watchers

66 watching

Forks

Packages

 
 
 

Contributors