| > I think it’s a good demonstration that this kind of architecture can work well over an extended period. I think for me the figure is about 8 years of development of 1 GUI software, with MVVM and .NET. > implicit assumptions about the platform here with the reference to styling It's 2021, pretty much all of them support styling now. > I was saying that web-based GUIs might have moved from rendering graphical content using one of the plugins a few years ago to rendering it using one of the native technologies today, without necessarily changing the content itself. None of them were able to reuse much code while switching just the renderer: ActiveX written in C++, Flash in ActionScript. > the GUI framework you are describing does not exist WPF and UWP definitely exist. I think modern HTML+CSS can do that too, but I ain't a web nor electron developer and not sure. > ultimately you still need code to define the way the layout should animate according to whatever rules your system uses It's the matter how you define them. When you offload playing animations to a framework, you tell the framework which properties to animate and how: define function of time (typically supported ones include step functions, polylines, and Bezier), pass metadata about timing and repeats, etc. That's for the hard case when animations depend on the data, when they do not they're made offline by art people. > Can you clarify? When you do them manually, i.e. computing functions of time and changing visuals, following happens. 1. Your code runs at refresh rate of the monitor, typically 60Hz, but for high-end gaming monitors can be 240Hz. Even if you aren't animating anything, this alone prevents certain power saving modes from engaging. 2. If you manually change positions of things not just color, your updates gonna invalidate layout. 3. There're multiple ways of measuring time with different tradeoffs about precision and when it's running versus paused. A framework is in a better position because it drives the main loop. It knows how many nanoseconds passed since the last frame. It knows when to render at 240Hz and when to sleep on GetMessage() because there's nothing to update. If it knows which properties are animated, it can integrate animations with layout for reasonable performance cost. |
Great. As I said before, there are many different architectures that can work well.
None of them were able to reuse much code while switching just the renderer: ActiveX written in C++, Flash in ActionScript.
But if you’re calling that renderer from JavaScript that has already done everything except the rendering, which would be the case with the kind of architecture I was describing if you were just using the plugin for the final rendering layer…
It's the matter how you define them. When you offload playing animations to a framework, you tell the framework which properties to animate and how: define function of time (typically supported ones include step functions, polylines, and Bezier), pass metadata about timing and repeats, etc. That's for the hard case when animations depend on the data, when they do not they're made offline by art people.
Right. But where do you get those data-driven paths from so you can use them as your key frames to drive your animation? That is what is generated in the presentation data layer in this example. No GUI framework can do this for you, because no GUI framework knows the rules of your system for how to lay out a particular diagram and how a transition between states should appear.
Actually moving lines or rotating text or whatever is then little more than an implementation detail, which can be done manually by the presentation layers or handed off to some platform-provided animation system, as the situation dictates.
Your code runs at refresh rate of the monitor, typically 60Hz, but for high-end gaming monitors can be 240Hz. Even if you aren't animating anything, this alone prevents certain power saving modes from engaging.
This seems like such an extreme case that it’s no longer very useful as an example. Who is using a 240Hz high-end gaming monitor, wanting our UI to produce animations that can keep up with that frequency of updates, yet concerned about some unspecified power saving mode not engaging if we do the maths manually when it would have engaged if the work had been delegated to some system service?
If you manually change positions of things not just color, your updates gonna invalidate layout.
We’re talking about immediate mode rendering. What “layout” is there to invalidate?