HastyBadger is a branch of the excellent widget and GUI library Turbo Badger.

Overview

Branch Notice - HastyBadger

Hasty is not Turbo.

HastyBadger is a branch of the excellent widget and GUI library Turbo Badger. Notabe additions are c++14 and out-of-the box SDL2 / GLES2 / GL3 / Emscripten demos, plus continuous integration to ease community contribution. The aim is to be super user friendly at the cost of being a bit more bloated than TurboBadger.

The HastyBadger is a work in progress, contributions and constructive commentary are welcome!

Current CircleCI build status: CircleCI

Current Github Actions build status: Github Actions

Binaries of the demo programs for most platforms (macOS, Linux, Windows) are available on the Releases page. An online demo of the Emscripten port is here: Emscripten port.

Differences from TurboBadger

Current TODOs

  • create iOS demo
  • code test coverage measures
  • fix/text macos Xcode demo
  • fix Android Demo
  • fix Windows Demo
  • port over last few months of active TB development to HB
  • make the docs prettier, cleanup

Quick Start

$ ./build -h
usage:
 ./build.sh [options]

  -h       this help message
  -o [dir] set build directory      

  -gl      build for open gl
  -gl3     build for open gl3
  -gles2   build for open gles2

  -em      build for emscripten
  -sdl2    build for sdl2
  -glfw    build for glfw

  -v       be more verbose
  -q       be less verbose

The Turbo Badger README

Turbo Badger home: Screenshot ----------------------------------------------------------------------------------- Some of the windows in the Demo application for desktop, using the default skin. ![Default skin](Demo/screenshot/screenshot_01.png) ">

Turbo Badger - Fast UI toolkit for hardware accelerated games & applications.
-----------------------------------------------------------------------------------

I created Turbo Badger because i wanted a small UI toolkit for use in games and
hardware accelerated applications across multiple platforms (that target both
desktop and mobile).

The goal is a toolkit that can be easily integrated into an existing codebase to
make UI with skinning.

It has no dependency on stl, RTTI or exceptions. Compiling without these features
makes footprint very small. Utility classes (such as string, lists, hash table,
etc.) are quite minimal for the basic needs of Turbo Badger itself.

See [integration.txt](integration.txt) for details about integrating image loading,
renderer, font system etc.


BETA notice
-----------------------------------------------------------------------------------

APIs are changed, features improved & added. Be aware that if you use this right
now, you'll probably have to adjust your code to API changes sometimes after
pulling master. Documentation about API changes take place in the git commit
changelog for now ;)


License
-----------------------------------------------------------------------------------

This software is provided 'as-is', without any express or implied warranty. In no
event will the authors be held liable for any damages arising from the use of this
software.

Permission is granted to anyone to use this software for any purpose, including
commercial applications, and to alter it and redistribute it freely, subject to the
following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim
  that you wrote the original software. If you use this software in a product,
  an acknowledgment in the product documentation would be appreciated but is not
  required.

  2. Altered source versions must be plainly marked as such, and must not be
  misrepresented as being the original software.

  3. This notice may not be removed or altered from any source distribution.


What features does it have
-----------------------------------------------------------------------------------

Core:

  * Widgets (many common standard widgets)
  * Text editing widget (With clipboard, undo/redo, styling functionality,
    embedded content (read only)...)
  * Extendable skin system with automatic runtime atlas creation,
    Expand (shadows & glow without nasty margin hacks),
    conditions (simple selectors), overrides, overlays, children, multiple
    pixel density support etc.
  * Automatic widget layout (No need to specify widget dimensions by pixels)
  * Text based UI resource format, supporting conditions etc.
  * Keyboard friendly (tab focus etc.)
  * Message handling, with delayed/timed messages.
  * All containers are scrollable/pannable (automatically from mouse/finger
    interaction, and following focus).
  * Very failproof event handling.
  * Widget connections (synchronize multiple widgets with "widget-values")
  * Language string handling
  * No dependency on stl, exceptions, RTTI
  * Very portable & easy to implement new backends (Image loading, fonts,
    renderer)
  * Support 32/64bit architectures and tested on Windows/Linux/Mac/iOS/Android
  * Uses constexpr by default for all ID comparisions on compilers that support
    it.
  * Unicode support (UTF8)
  * Multiple font systems can be used (Implementations of TBBF, freetype and stbf
    provided)
  * Animation system.
  * Unit tests.


The code design & developing Turbo Badger
-----------------------------------------------------------------------------------

If you try to familiarize yourself with the code, you might notice the heavily used
object `TBID` that may seem like a string. It's actually an uint32 that can be set
from a string (using the strings hash value). It's used for hash keys, as
substitute for enums and all kind of things needing custom IDs.

With compilers supporting C++ 11 `constexpr`, the string to integer conversion is
done compile time.

If you want to add new stuff, here are some hints that will make it easier to get a
pull requests accepted:

  * Do not make it dependant on exceptions, RTTI or stl (or boost or similar)

  * It should not leak or crash if running out of memory.

  * Follow the used code style (4 spaces wide tabs, indentation & whitespace style,
    documentation etc.)

  * Features that may be optional should be optional and not tied to the core.


Creating custom widgets
-----------------------------------------------------------------------------------

Widgets are cheap to create and layout and using many widgets to get what you want
is encouraged. A custom widget should typically not implement any layouting and
drawing of sub-elements if it can be solved by wrapping a TBLayout and other
existing widgets.

Any widget may contain other widgets and may control into which sub-widget other
widgets are inflated from resources (using `TBWidget::GetContentRoot`).

Custom widgets can be inflated from UI resources too. See the use of the
`TB_WIDGET_FACTORY` macro in `tb_widgets_reader.cpp` for examples on how to do
this.


Building the demo
-----------------------------------------------------------------------------------

The demo use GLFW as a submodule for some platform window & input handling.
After the first git clone, you need to run:

	git submodule init
	git submodule update

This will clone GLFW into the right directory.

There is project files for Visual Studio 2012 in Demo/VisualStudio.
For other platforms/compilers, you need to first run cmake to generate makefile or
projects for your favorite IDE.

There's a Sublime Text project for a small Android test app in DemoAndroid with a
custom build & deploy script (Windows .bat file. There's currently no Linux/Mac
scripts).


Author
-----------------------------------------------------------------------------------

Emil Segerås
Web: 
    
       

Turbo Badger home: 
     
      


Screenshot
-----------------------------------------------------------------------------------

Some of the windows in the Demo application for desktop, using the default skin.

![Default skin](Demo/screenshot/screenshot_01.png)


     
    
Comments
  • Fruxo upstream merge

    Fruxo upstream merge

    This is a full merge of current fruxo/master.

    The multi touch API and code has changed, here's a list of what has been taken from each branch:

    • Turbodager: Invoke and event syntax (e.g EVENT_TYPE_TOUCH_* rather than EVENT_TYPE_FINGER )
    • Turbodager: Finger ID handling
    • Hastybadger: Touch Gesture (aka MultiGesture)
    • Hastybadger: Triggering Pointer and Touch events at the same time on touch (with touch boolean) rather than forwarding from Touch->Pointer for a single finger.

    Each commit has been tested with "make sdl2" and an execution of the demo.

    opened by Zomtir 5
  • Windows demo crashes due to

    Windows demo crashes due to "glewInit()" not being called anywhere

    I just got latest code and built with VS 2019 on Windows.

    Running the demo fails because all of the gl function pointers are NULL, to get it running I had to add a call to glewInit() in TBRendererGL c'tor

    Cheers

    opened by Coder666 3
  • Readme rewrite

    Readme rewrite

    I reworked the readme to reflect the current state of things. It is not polished at all and you'll probably the better person in charge to give the wordings your touch.

    On a side note, I copied in the cmake3 check.

    opened by Zomtir 3
  • Building on Windows / ConfigureVS2019.bat

    Building on Windows / ConfigureVS2019.bat

    Here is the contents of a configure batch file ConfigureVS2019.bat I am using on Windows to create the Visual Studio solution files

    @echo off
    @mkdir build-x64
    @pushd build-x64
    cmake ..\ -DTB_BUILD_DEMO=GLFW -G "Visual Studio 16 2019" -A x64
    @popd
    
    @mkdir build-x86
    @pushd build-x86
    cmake ..\ -DTB_BUILD_DEMO=GLFW -G "Visual Studio 16 2019" -A Win32
    @popd
    

    Maybe useful to include a variant of this in the source tree.

    Cheers

    Tom

    opened by Coder666 1
  • STB font renderer Create function signature incorrect

    STB font renderer Create function signature incorrect

    The virtual function STBFontRenderer::Create signature does not match that of the virtual function being overridden in the parent class TBFontRenderer and thus does not comple.

    Requires const char* filename to be replaced with const TBStr& and then a modification is also required in the create function to obtain the filename buffer via the CStr function

    opened by Coder666 1
  • TBProgressSpinner::IsRunning is not const-qualified

    TBProgressSpinner::IsRunning is not const-qualified

    https://github.com/tesch1/turbobadger/blob/123ed5a11f7c583c4342f48744ba081a5d8912ca/src/tb/tb_widgets_common.h#L240-L241

    I guess there is nothing behind this, just an oversight.

    opened by Xeverous 1
  • Tiny fix for builds without TB_IMAGE setup

    Tiny fix for builds without TB_IMAGE setup

    Building with TB_IMAGE set to OFF is producing a compilation error:

    error: ‘g_image_manager’ was not declared in this scope
       && g_widgets_reader && g_image_manager;
                              ^~~~~~~~~~~~~~~
    

    g_image_manager is not defined but used inside the boolean expression in the file tb_core.cpp.

    This error is easy to reproduce by only setting TB_IMAGE to OFF. Working Environment: Linux 4.15.0-45-generic #48-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux Build: g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0

    opened by PearCoding 1
  • Adding sys/auxv.h back to main.cpp to fix missing getauxval and AT_EXECFN

    Adding sys/auxv.h back to main.cpp to fix missing getauxval and AT_EXECFN

    Fixes an error when trying to compile the demo on linux:

    turbobadger/Demo/platform/main.cpp: In Funktion »bool port_main(int, char**)«:
    turbobadger/Demo/platform/main.cpp:72:23: Fehler: »AT_EXECFN« wurde in diesem Gültigkeitsbereich nicht definiert
       72 |         if (getauxval(AT_EXECFN))
          |                       ^~~~~~~~~
    turbobadger/Demo/platform/main.cpp:72:13: Fehler: »getauxval« wurde in diesem Gültigkeitsbereich nicht definiert
       72 |         if (getauxval(AT_EXECFN))
          |             ^~~~~~~~~
    
    opened by Mai-Lapyst 0
  • add TB_LIBSTD, const char * -> TBStr &, fix lib build

    add TB_LIBSTD, const char * -> TBStr &, fix lib build

    • added an option and some code for better libc++ interoperability, mainly auto-conversion of TBStr <-> std::string.
    • changed some function args from (const char *) to (const TBStr &)
    • be clear about TBID vs CTBID
    • fix some build stuff, working toward eliminating build.sh
    opened by tesch1 0
  • Hb cmake cleanup

    Hb cmake cleanup

    Rewrite of the cmake build system. Using modern cmake features. It's much cleaner.

    Also now build all the demo apps on travisci and circleci.

    Can also build the Emscripten version using either SDL2 or GLFW as a backend.

    opened by tesch1 0
  • Android build

    Android build

    The Android demo is upgraded so it can be compiled on Linux.

    The tb_system_sdl.cpp can log for android and the JNI was set up to receive the AssetManager object from Java (not used) and to receive the absolute path of the installed Android app's reserved folder (this path is returned by TBSystem::GetRoot()).

    opened by BalintKoczor 0
  • Render Batching could be improved

    Render Batching could be improved

    The ui skin and the fonts are stored in different textures - thus we have to switch the bound bitmap a lot of times - which results in a rendering the batches even though there would still be enough vertex space left. It would imo be better to render the glyphs to the skin texture - to reduce the state changes and being able to render the whole ui in one draw call.

    opened by mgerhardy 0
  • Hashing is unnecessarily limited to null-terminated strings

    Hashing is unnecessarily limited to null-terminated strings

    TBID::Set(const char*) uses this code (while loop assumes null-termination):

    https://github.com/tesch1/turbobadger/blob/123ed5a11f7c583c4342f48744ba081a5d8912ca/src/tb/tb_hash.cpp#L12-L25

    This is an unnecessary limitation because for example, it can not be used with std::string_view.

    opened by Xeverous 7
Owner
Michael Tesch
write compile run repeat
Michael Tesch
This is a thin c-api wrapper programmatically generated for the excellent C++ immediate mode gui Dear ImGui.

cimgui This is a thin c-api wrapper programmatically generated for the excellent C++ immediate mode gui Dear ImGui. All imgui.h functions are programm

Victor Bombi 22 Jul 5, 2021
Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.

libui: a portable GUI library for C This README is being written. Status It has come to my attention that I have not been particularly clear about how

Pietro Gagliardi 10.4k Jan 2, 2023
NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x/DirectX11[12]/Vulkan

NanoGUI NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x/DirectX11[12]/Vulkan. It supports automatic layout generation, stateful

dalerank 73 Dec 22, 2022
This is a collection of widgets and utilities for the immediate mode GUI (imgui) that I am developing for the critic2 GUI

ImGui Goodies This is a collection of widgets and utilities for the immediate mode GUI (imgui) that I am developing for the critic2 GUI. Currently, th

null 95 Nov 19, 2022
Minimalistic C++/Python GUI library for OpenGL, GLES2/3, Metal, and WebAssembly/WebGL

NanoGUI NanoGUI is a minimalistic cross-platform widget library for OpenGL 3+, GLES 2/3, and Metal. It supports automatic layout generation, stateful

Mitsuba Physically Based Renderer 1.2k Dec 28, 2022
A barebones single-header GUI library for Win32 and X11.

luigi A barebones single-header GUI library for Win32 and X11. Building example Windows Update luigi_example.c to #define UI_WINDOWS at the top of the

Nakst 235 Dec 30, 2022
raygui is a simple and easy-to-use immediate-mode-gui library.

raygui is a simple and easy-to-use immediate-mode-gui library.

Ray 2k Dec 30, 2022
Examples, tutorials and applications for the LVGL embedded GUI library

Examples, tutorials and applications for the LVGL embedded GUI library

LVGL 441 Nov 11, 2022
FlatUI is a immediate mode C++ GUI library for games and graphical applications.

FlatUI is a immediate mode C++ GUI library for games and graphical applications. Go to our landing page to browse our documentation.

Google 610 Dec 23, 2022
Elements C++ GUI library

Elements C++ GUI library Introduction Elements is a lightweight, fine-grained, resolution independent, modular GUI library. Elements is designed with

Cycfi Research 2.5k Dec 30, 2022
A single-header ANSI C immediate mode cross-platform GUI library

Nuklear This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed a

Immediate Mode UIs, Nuklear, etc. 6.7k Dec 24, 2022
A library for creating native cross-platform GUI apps

Yue A library for creating native cross-platform GUI apps. Getting started Documentations FAQ Development Examples Sample apps (with screenshots) Muba

Yue 2.8k Jan 7, 2023
Minimalistic GUI library for OpenGL

NanoGUI NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x or higher. It supports automatic layout generation, stateful C++11 lamb

Wenzel Jakob 4.2k Jan 1, 2023
Cross-platform GUI library

Harbour Nuklear backend This backend provides support for Nuklear. It works on on all supported platforms with an OpenGL backend, including iOS and An

Rafał Jopek 2 Jan 19, 2022
Fishui - CutefishOS GUI library, based on Qt Quick.

FishUI FishUI is a GUI library based on QQC2 (Qt Quick Controls 2), every Cutefish application uses it. Features Light and Dark Mode Borderless window

CutefishOS 200 Dec 30, 2022
libui-ng: a portable GUI library for C

libui-ng: a portable GUI library for C Fork of andlabs/libui. This README is being written. Status See CHANGELOG.md Old announcements can be found in

null 289 Jan 7, 2023
Nana is a C++ standard-like GUI library

Nana C++ Library Linux (gcc 8.3.0 and 9.2) including (nana-demos) Windows (Microsoft (R) Build Engine version 15.9.21) Nana is a C++ standard-like GUI

Jinhao 2.1k Jan 3, 2023
Addon widgets for GUI library Dear ImGui.

ImGui-Addons Addon widgets for GUI library Dear ImGui. File Dialog A simple cross-platform file dialog that uses dirent interface for reading director

null 286 Jan 7, 2023
GWork is a skinnable, embeddable GUI library with an extensive control set

GWork is a skinnable, embeddable GUI library with an extensive control set. Control rendering is abstracted, and can be implemented by any application wishing to use the library. Gwork (pronounced "gw-orc") is a fork of the GUI library GWEN. It was forked to fix issues with GWEN and add new features.

Bill Quith 198 Nov 24, 2022