EasyImGui is designed to simplify the process of creating desktop applications with the popular Dear ImGui library. It aims to eliminate the common boilerplate code associated with setting up ImGui, allowing developers like you to focus directly on building their graphical user interface. With EasyImGui, you can quickly go from writing your UI code to having a functional desktop application without the need for complex project configurations or relying on specific IDEs like Visual Studio.
- Simplified Setup: Get started quickly without dealing with extensive ImGui backend and windowing boilerplate.
- No Visual Studio Required: Compile and run your projects without needing Visual Studio installed unlike many other ImGui projects.
- Transparent Window Support: Easily enable/toggle a transparent window background, allowing you to create applications where only the ImGui elements are visible.
- Effortless Font and Theme Swapping: Change the look and feel of your application by simply modifying a string to switch between pre-configured fonts and themes.
- Easy Customization: Add your own custom fonts and themes with minimal effort by modifying dedicated configuration files.
- DX9 and Win32 Backends: Currently supports DirectX 9 and Win32 backends for rendering and window management.
- Planned Future Backends: Future plans include adding support for more widely used backends like OpenGL3 and Vulkan with GLFW or/and SDL3.
- A C++ compiler (e.g., MinGW, GCC, Clang)
- CMake
- Clone the repository:
git clone https://github.com/Plinkon/EasyImGui cd EasyImGui - Navigate to the compile directory:
cd compile/windows - Run the desired compile script:
- For a debug build:
CompileDebug.bat
- For a release build:
CompileRelease.bat
- For a debug build:
This will generate the executable in the build directory.
├── assets/
│ └── fonts/ # Fonts that are used in this project
│ └── HELP.md # Help file for adding your own fonts
├── compile/
│ ├── cmake/ # CMake build script
│ └── windows/ # Windows specific compile scripts
| └── build/ # Compiled executables
├── include/
│ ├── easyimgui/ # EasyImGui specific headers
│ │ ├── fonts.h # Font hex data
│ │ ├── globals.h # Global project configuration and variables
│ │ ├── style.h # Style/Theme code
│ │ └── ui.hpp # Your ImGui UI code goes here in the runUI() function
│ └── imgui/ # Dear ImGui source files
│ └── imgui_impl/ # ImGui backend implementations
├── src/
│ └── main.cpp # Main application entry point (usually no modification needed for basic apps)
├── Makefile # Alternative build system (optional)
└── README.md # This file
All your ImGui drawing code should go into the include/easyimgui/ui.hpp file. You can add your windows, widgets, and other ImGui elements within the appropriate function calls provided in this file.
The include/easyimgui/globals.h file contains global configuration options for the project. You can adjust settings like window size, title, and enable features like the transparent background here. You can also add your own global variables that you need access to throughout your UI code.
To add a custom font:
- Obtain your font's hex data as a c arrray. Tutorial in the
assets/fonts/HELP.mdfile - Edit the
include/easyimgui/fonts.hfile and add the array along with a[fontName]Size = [fontNameArraySize]. - Edit the Load Custom Fonts section in
main.cppand follow the format of the other fonts. - You can then easily switch to your new font in the
globals.hfile. (make sure the name in theglobals.hfile is the same as inmain.cpp)
To add a custom theme:
- Edit the
include/easyimgui/style.hfile. - Follow the existing pattern to define a new ImGui style.
- Add your style to the
runStyle()function at the bottom ofstyle.hand follow the format of the other styles. - You can then easily switch to your new theme in the
globals.hfile. (same naming scheme as the fonts but make sure it is the same as infonts.h)
We welcome contributions to EasyImGui! If you have ideas for new features, improvements, fonts, or bug fixes, please feel free to open an issue or submit a pull request/issue.
This project is licensed under the GPLv3 license.
- Dear ImGui - The fantastic immediate mode GUI library that powers this project.