Jump to content
  • Advertisement
Gnollrunner

Anyone use Dear ImGUI?

Recommended Posts

I was looking for a GUI API I could use with DirectX11 for my project.  My search led me to Dear ImGui. I was wondering if anyone here has tried it and had any comments on it. I'm mostly interested in HUD stuff but there will be some menus for inventory and the like. Also if you know of some other API that I might look into I would be interested on hearing about that too.

Edited by Gnollrunner

Share this post


Link to post
Share on other sites
Advertisement

> I'm mostly interested in HUD

You'll find feedback from users e.g. on twitter but you need to clarify your use case because "GUI API" can mean ten different things.

It's definitively not designed to be properly skinable. So if you intend to make those UI available to your players and expect them to look like fancy game UI it is not a good choice.

It's designed to be very-high productivity/flexibility/portability for tool making.

Share this post


Link to post
Share on other sites
26 minutes ago, ocornut said:

> I'm mostly interested in HUD

You'll find feedback from users e.g. on twitter but you need to clarify your use case because "GUI API" can mean ten different things.

It's definitively not designed to be properly skinable. So if you intend to make those UI available to your players and expect them to look like fancy game UI it is not a good choice.

It's designed to be very-high productivity/flexibility/portability for tool making.

Well at this point I mainly need something to get going.  Of course I could roll my own but that seems like a lot of work. I want something that is Free, has a C++ binding and the source code is available. I'm open to suggestions.

Share this post


Link to post
Share on other sites

But you are not answering the core question of what you are looking for in a GUI toolkit.

Does it need to be pretty and skinnable?

How UI intensive is your game?

What sorts of control do you need, do you have a mockup or your target UI?

Are you focusing on mouse controls? Do you need keyboard and/or gamepad controls to be function?

How far do you wish to push localization, would you want your UI to show Japanese? Chinese? Arabic? Those languages have different constraints and different GUI won't support them the same way (those 3 are listed here in a typical "easier to harder" fashion).

Are you displaying user-generated strings or only strings that you know ahead of time?

Do you intent to allow users to input text in their language? If so if your game is a fullscreen game you have different constraints as you can't use native IME controls in the same way.

 

I'm genuinely asking this because those different requirements would lead you to radically different solutions. Dear ImGui is good at what it does but it doesn't do everything.

 

Edited by ocornut

Share this post


Link to post
Share on other sites

Techniques aren't mutually exclusive; in a typical game there's a place for using Dear ImGUI for in-game developer tools (property panels, editors, graphs...), whatever 2D overlay rendering your game engine offers to draw a HUD, non GUI related libraries like ICU or Freetype to handle text, generic custom "services" like rendering text to textures, a simple custom GUI framework that fits well with the rest of the game engine for simple GUI with simple variants (e.g. fullscreen menus), and harder to use complex skinnable GUI libraries for complex cases.

Share this post


Link to post
Share on other sites

I use it for all my in-game development tools:
44004181-04aff740-9e13-11e8-898b-87da15e

But we don't use it for HUDs or in-game menus (except our controls editing menu). It's great for making traditional GUIs like you would with WxWidgets, Qt, MFC, WinForms, etc... Our productivity has actually received a massive improvement since we added such an easy-to-use GUI toolkit into our game for tweaking and visualizing data :) 

It does have an API to let you draw any kind of 2D shape that you like (the row of circular dials, above, is a custom-drawn widget), and it does support custom font and drawing text and images wherever you like, so you could do any kind of stylish game HUDs with it... but that's not it's strong point.

Share this post


Link to post
Share on other sites
40 minutes ago, ocornut said:

But you are not answering the core question of what you are looking for in a GUI toolkit.

 

At this point it doesn't have to do much, some buttons a text box etc..... My engine/game is in the very early stages so I don't have the answers to a lot of these questions and in addition I'm not very experienced in writing a game GUI.  My last GUI programming was in MFC and before that X Windows. (X11).  I don't expect someone to come up with the exact fit for what I need because I don't even really know what I need myself.  However if there are any suggestions on stuff I might look into that fits the the requirements of a C++ API, free, and having source code, that would be a lot of help.  I'm not adverse to coding so if it's light weight and I have to do some extra work, it's not a problem. I'm already dealing with DirectX so I'm working at a relatively low level.

Share this post


Link to post
Share on other sites

I recommend it for development in any case, no matter if you use it as a final UI for end users or not. (For a dev tool it will suffice anyways)

To me it is mostly a new form of debugging. At any point in your code you write two lines and get an editable variable so you can quickly test out things. In the same way you can log data on screen in a nice format, which is often more comfortable and quicker than using the debugger.

Seems almost anybody is using it already, for good reasons. Thanks, @ocornut :D

 

Share this post


Link to post
Share on other sites

OK thanks guys. I think I'll go ahead and give it a shot and see how far I can go with it. If it ends up being limiting later, I can always swap it out for something else or write my own.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!