Ok so, now that my first iteration was sort of complete - so I thought - I wanted to refine a bit ... and more problems arisen.
Today's quotes come from the [Sweng-gamedev] mailing list, more exactly from the "Why IMGUI arguments fall short" thread. I take something out of Tom Plunket's message which helped quite a lot:
Quote:The idea is that IMGUI holds /no/ state, so the application can be in
control and display exactly what needs to be displayed every frame.
...
IMHO, the place where the IMGUI camp really misses the mark is in
its complete and utter failure to notice the fact that all tools in
our toolboxes have places where they're appropriate, and all tools
have their places where they're inappropriate. IMGUI is not The
Silver Bullet.
...
point to Barrett's article itself; "[t]he most important thing to remember is
that immediate mode doesn't require us to create and destroy the
objects involved." Indeed, because there are no objects, or so the
implication is. But the fallacy of that argument comes clear the
second you take a look at what is actually happening under the hood;
draw instructions are in fact being created, from scratch, every
frame.
I grow increasingly convinced that IMGUI makes sense only for very simple, almost stateless systems. This happens because, as I noted before, allowing the IMGUI library to track state requires pretty strong suppositions - no data shuffling for example.
I also took a way too optimistically approach at this. As the quoted message reads, I had somehow got the idea that but recently it was "The Most Amazing Thing EVAR".
Reading MollyRocket's forum for example, not many posts says IMGUI sucks at this... or at that. This doesn't help. They say why you should go IMGUI instead of RMGUI (and not even very clearly) but they're not saying when you truly want to have RMGUI, with properly accessible, stateful widgets. Maybe they just took for granted everybody knew what a RMGUI would buy, as they've be around quite a while, I don't know, but it certainly would have helped. I have the feeling some of this approach carries on even there.
For example, to carry on the 3D API IM/RM parallel, nobody would ever want - say - to specify shaders per frame because that's expensive. GUIs are not the same case for me but they forget to note that having explicitly persistent state that can be referenced is nice by itself indeed. Even if shader compiling would be free, would you truly want to write SetVertexShader("blah")? I wouldn't.
It turns out that reading the above comments, I figured out I was doing some VERY WRONG things. I'm not going to say what as I find them so dumb to be just embarassing...
Yeah, objects.
Objects are my friends.
I like objects...
I think I will truly have to take a break and start with this "new fresh" point of view.
I post this in the hope someone in the future can find this and avoid falling in the "Most Amazing Thing EVAR" trap that ultimately lead me to wasting so much time and effort.
It turns out that writing an IMGUI library is not quite different from writing an RMGUI one - ok, I admit my previous try at a GUI library has been quite a while ago - with the added complexity of managing the on-the-fly creation.
I hope this helps.
As a side note, this thread helped me so much I really wanted to make a donation to gamedev.net, I was considering that since beginning, but swiftcoder' status made me jump on it.
I am rather sure the expenses generated by this topic are more than covered, yet considering the attention compared to other SW-ENG threads here, I think you should consider dropping a few cents.