Suggestions for simple GUI items in Magnum app

147 views
Skip to first unread message

Andy Somogyi

unread,
Oct 22, 2017, 6:48:13 PM10/22/17
to Magnum C++/OpenGL Graphics Engine
Hi, 

Any suggestions for super simple GUI items like buttons, sliders, etc. in a Magnum app. 

My eventual goal is to use a native UI (Cocoa on OSX, WPF on Windows, GTK on Linux), and hook my app up to a gl window contained within the native app. 

But for dev purposes, I’d just like something ridiculously simple, maybe a few edit boxes, and buttons. I’d rather not spend a great deal of time figuring out how to use a UI toolkit that will only be used for development / demo purposes. 

Couple I’ve looked at are:

Nuklear — simple, but convoluted API
Imgui — not bad, not sure how easy to use with Magnum
NanoGUI — looks good, nice API, but crazy dependencies (I’m NOT, I say, I’m NOT willing to have a Eigen dependency) 
Any other choices ???

I’ve used GLUI in the past, I think it looks good and easy to use, but would require too much work to update for GLFW


Vladimír Vondruš

unread,
Oct 26, 2017, 5:30:05 PM10/26/17
to Andy Somogyi, Magnum C++/OpenGL Graphics Engine
Hey,

sorry for the late reply, wanted to prepare an online demo so I'm not presenting a vaporware and the dependencies of that have kinda blown up so I spent the past three days on that :/ :D

Magnum has a work-in-progress, super simple UI library in the magnum-extras repo. I was not yet able to create a full-blown documentation with tutorials for it and the functionality is currently limited to buttons, text input and modals, but I promise there will be more once I get back to it again.

It has an online WebGL / WebAssembly demo if you want to check it out (but it's not publicly advertised yet): http://magnum.graphics/showcase/magnum-ui-gallery/

.. and on that page you should be also able to get to the documentation for it and to source code of that demo. That demo is currently the best way to get to know how the API is used as an overview documentation is currently nonexistent.

Other options, if you would hate the above :) (they are also mentioned in main repository README):

- there's a "Dear ImGUI" port to Magnum: https://github.com/denesik/MagnumImguiPort
- and a libRocket integration: https://github.com/miguelmartin75/Magnum-libRocket

Regards
mosra

______________________________________________________________
> Od: Andy Somogyi <andy.s...@gmail.com>
> Komu: Magnum C++/OpenGL Graphics Engine <magnum...@googlegroups.com>
> Datum: 23.10.2017 00:48
> Předmět: [magnum] Suggestions for simple GUI items in Magnum app
>http://www.cs.unc.edu/%7Erademach/glui/ <http://www.cs.unc.edu/~rademach/glui/>
>
>
>--
>You received this message because you are subscribed to the Google Groups "Magnum C++/OpenGL Graphics Engine" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to magnum-engin...@googlegroups.com.
>To post to this group, send email to magnum...@googlegroups.com.
>Visit this group at https://groups.google.com/group/magnum-engine.
>For more options, visit https://groups.google.com/d/optout.
>
>

Andy Somogyi

unread,
Oct 26, 2017, 6:21:23 PM10/26/17
to Vladimír Vondruš, Magnum C++/OpenGL Graphics Engine
Hey, thanks for the reply, but I actually ended up going a different route. 

Even for simple stuff, I found imgui to be an unmitigated piece of crap. I had a hard and bitter fight with imgui, but after wrestling with it for several days, I came to the conclusion that it’s far more trouble than it’s worth. Nanogui only slightly better, but crap also, and I’m not willing to put up with the Eigen dependency (Nanogui brings in Eigen for literally a vector class, that’s kind of like using an atomic bomb to swat a fly). 

I came to the same conclusion that John Novak did: all cross-platform GUIs are crap. 


I’m of the opinion now that the easiest way to have decent UI widgets is to use the native toolkit. That does *not* mean that your app does not have to be cross-platform, in fact, if done correctly, I’d say that 99% of your app can be completely cross platform, even the visualization / rendering. Only a very thin wrapper needs to be made that hooks up user input to your core, cross-platform logic. 

So, what I’m doing now is I managed to get GLFW working in a Cocoa app. It’s super simple to create a quick Cocoa app in Xcode, just drop some widgets on a form, hook up the message handlers, and have these just call my app, which opens a GLFW window, and draws stuff to it. Once I get all the details worked out, I’ll do the same with a WPF app on Windows, and a GTK app on Linux. 
Reply all
Reply to author
Forward
0 new messages