Improve GUI system
So, I notices a couple of flaws in the current gui system that need to be addressed:
-
ints are used, but half pixels exist -
A lot of things are tick aligned (remove Pollable
) -
onChildChange
is often called -
its not thread safe but is used in that way and pretends to be -
memory allocations are extremely high -
a lot of code is too complex and not readable -
custom render methods (with custom offset) are faulty and do not allow for proper scrolling -
animations are really really slow (custom shaders don't work) and it is always rerendering all parent elements during animation (because cache is disabled) -
some elements are mutable during the rendering (e.g. change size, see FadingTextElement
) -
a lot of tests are missing and must be added -
maxSize vs prefMaxSize vs prefSize vs size -
maxSize is spamming parent calls -
margin vs padding, not really implemented -
don't update gui framebuffer when gui did not update -
optimize cache size -
sometimes things are one frame behind (like debug screen resizing) -
LayoutedGUIElement
vsGUIMeshElement
To fix 2-4 the best thing is to not call forceSilentApply
when something changes, instead an "apply" should be scheudled to be done before it is rendered the next time.
Edited by Moritz Zwerger