FlatUI
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Enumerations Groups Pages
FlatUI

Overview

FlatUI is an immediate mode C++ GUI library that aims to be a simple, efficient and easy to use way to add menus, HUDs and any kind of other UI to your game or graphical application. It also offers unicode & i18n aware font-rendering.

FlatUI is available as open source from GitHub under the Apache license, v2 (see LICENSE.txt).

Why use FlatUI?

  • Immediate mode - this means that rather than constructing a UI using objects, you do so with simple function calls that determine the structure of the UI each frame. This has many advantages:
    • Less code - simple UIs are simple, and require less setup work.
    • Easy dynamic UIs - no object management when the UI changes (add/remove). A simple if-then suffices to make (part of) a UI visible. No state to get out of sync, no clean-up.
    • Handle events locally - directly next to the code that creates the element, where you have all relevant data available, instead of having to react to an event outside the context of the code that constructed it.
    • Compositional - functions are easier to abstract and compose than objects, allowing you to combine common patterns of UI construction code into functions that capture your usage.
  • Super efficient - the memory usage by the core layouting / rendering code of FlatUI is on the order of a few KB, even in complex UIs, and is transient. Your memory usage will effectively be just whatever textures and fonts you use.
  • Automatic Layout - rather than specifying UI elements in pixels, you specify virtual sizes of things, making it easy to render the same UI on different resolutions and aspect ratios, and allowing it to dynamically adapt to any content. Placement still ensures pixel alignment for maximum crispness in font & image rendering.
  • Style independent - Though we supply sample widgets, it is very easy to make your own with specialized rendering. No complicated templating / skinning required.
  • Designed for games - supports typical game use cases.
  • Unicode and i18n aware - text rendering that builds on HarfBuzz and libunibreak.

Supported Platforms and Dependencies.

FlatUI has been tested on the following platforms:

This library is entirely written in portable C++11 and depends on the following libraries (included in the download / submodules):

Download

Download using git or from the releases page.

Important: FlatUI uses submodules to reference other components it depends upon so download the source using:

git clone --recursive https://github.com/google/flatui.git

Feedback and Reporting Bugs