ImGui integration: introduction and acknownledgements #67
Pinned
pthom
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear ImGui is the bloat free immediate GUI library that started it all!
I worked on it in 2020, by providing an interactive manual for it.
ImGui Bundle provides ImGui with lots of additional satellites libraries, in C++ and in Python.
Python bindings
The python bindings are autogenerated and thus provides very close APIs and documentations; so that porting in any direction is easy.
Usage of imgui with python
Its usage in ImGui Bundle, especially in Python is a joy to use; and the auto-completion works like a charm.
Build an app with the standard ImGui workflow
An imgui application in C++ can be ported to python via an almost line by line translation!
For example imgui_example_glfw_opengl3.py is an almost direct port of imgui/example_glfw_opengl3/main.cpp.
Build an app with ImmApp
Alternaltively, ImmApp (immediate App) provides an easy way to create an app with few lines of code:
Technical notes about the python bindings
The generated python bindings follow closely the ImGui API.
The bindings transcription adheres to the following principles:
imgui_bundle.imgui
namespace): see for example TableFlags_ in Python vs ImGuiTableFlags_ in C++(changed, new_value)
in python: see for example slider_float (python) vs SliderFloat (C++)ImGui Fork
The python bindings are based on a fork of ImGui on the imgui_bundle branch (which is based on imgui's docking branch).
This fork adds a few modifications in order to make the automatic bindings generation possible. Here is the diff. Most of these modification are not worth being backported to ImGui, so that this fork will be maintained and regularly rebased on the docking branch.
DPI Handling
One final note: DPI handling is a bit cumbersome with ImGui at this time, and I had to adapt quite a lot of satellite libraries examples so that they render well on windows laptops (where their rendering was broken because the screen scaling is for example 200%).
Maybe it would be interesting to consider adding the following
EmVec2
function to ImGui, so that creating DPI aware apps becomes less wordly (i.e. instead of always multiplying byImGui::GetFontSize()
).Beta Was this translation helpful? Give feedback.
All reactions