Home | Documentation | Atomic Chat | Github

ImGUI and nuklear integration


#1



:camel: :camel: :camel: :camel: :camel: :camel: :camel: :camel: :camel: :camel:


#2

Great work!, both of these look solid and usable from C++, nice and clean :thumbsup::thumbsup::thumbsup:

I would like to drop SystemUI (the original Urho3D UI) and use either imgui or Nuklear instead. This only needs to be accessible from C++ to start as we pretty much only use SystemUI for the console and DebugHud, we can temporarily lose the console, and the DebugHud should be easy to get using new UI.

In order to make imgui/Nuklear available to script and consistent with Object model needs to be wrapped (which is consistent with other ThirdParty integrations, the raw API isn’t generally exposed). This shouldn’t be too hard for either of these as they are immediate mode UI systems. I am not suggesting that you need to do this, just mentioning it :slight_smile:

TurboBadger is great and is capable of nice looking/behaving UI for games and applications. The motivation with the immediate mode UI is in quickly generating tool UI and for rapid prototyping.


#3

I am not really sure which is better to pick so i will sum up my thoughts on both:

Nuklear:

  • Con: ansi c sometimes gets in the way by allowing developer to overlook something and causing bugs that might be hard to track down. Relevant because we likely will have to submit PRs to fix issues we bump into.
  • Con: does not support cascading menus, substitute/workaround exists.
  • Con: crash-happy. Although it could be just me…
  • Con: font merging might be broken or is unclear how to use.
  • Con: may be underfeatured.
  • Pro: maintainer is very responsive to feature requests.
  • Pro: Looks way better from the start.
  • Pro: can be skinned easily and produces well-looking results.
  • Pro: No hidden global state, you have to pass context to all functions.
  • Pro: slider widgets properly support datatypes other than float without casting them to float (feature added on my request, see maintainer is really cool guy).

ImGui:

  • Con: makes use of global state, however this is somewhat negated by API allowing to get/set that context.
  • Con: odd API design where static functions are in ImGui namespace and they make use global state instead of just making it all a class (its cpp after all). This is a bit subjective but i think API should be pleasant to use and nice to read.
  • Con: looks rather ugly by default.
  • Con: skinning capabilities are limited.
  • Con: property slider widgets always cast value to float even if slider is for integers or doubles. This causes precision loss in some cases. I requested this fixed in the past but request was denied as maintainer deemed it to be unworthy.
  • Pro: older project and has bigger community.
  • Pro: HDPI support.
  • Pro: supports font merging and we can use FontAwesome icons in main font.

I personally am leaning towards nuklear. Deficiencies can be fixed and missing features can be added. It is more pleasing to the eye and tools look more professional in that industry-standard dark look. Besides we just got a way to render stuff on static transparent non-focusable window and this feature request was basically completed within minutes since issue submission. Now we have all pieces needed to reimplement debug hud and console.