I am releasing a big change to the way the UI system works. Previously, the gui was rebuilt each frame, which is what every other GUI does, and this took a decent amount of CPU time. In Graphics programming, there is a fancy term called, Temporal Coherence, which is just another way of saying, “things stay generally the same over time.” In any graphics application, the difference from frame to frame can be small. This is how most video compression works by using previous frames and only recording the difference between frames.
In the gui I wrote, I use the CPU to do all clipping and work. The GPU has no translation, rotation, or any other work to do except to sample a texture. This might seem backward to most, however, this gives several advantages: the number of draw calls is equal to the number of different textures being draw (I use a texture atlas which contains all the needed textures, so the draw call is always 1 for the entire GUI) ; and I can cache the whole last frame drawn. Since I can cache the entire last frame drawn, I only redraw it when a change occurs, giving me a HUGE speed increase. The pic below is 50 open re sizable windows –with tabs, buttons, and text in them– and you can see how fast the GUI is draws on my system.
One thing to note on using the GUI is to make sure and use the Set functions, don’t try to manually set anything otherwise the GUI wont know to redraw itself properly.

Recent Comments