Okay, as they say now – this week in Airely. I’ve given much thought about Window Management, and especially self-painting of windows in their code.
The System has one Renderer (in terms of SDL), and in each moment of time it has one target – the screen itself or one of the textures of some Window.
Each program (application) in Airely has its own main thread, in which the painting of Windows is done. Therefore, the target of the Renderer is switching back and forth among all windows and the screen. The task of synchronization was not so easy, but the result is very rewarding.
The focusing and ordering of Windws was somehow tricky also, but it is also done and working perfectly. Finally, I can focus windows with mouse and drag them anywhere. This was a long journey of architecturing all mechanisms and learning Rust by the way. In some moment I’ve become fond of Rust’s principles and I am not arguing with it now as much as it was when I started.
The message system, or you may say “event system”, has been advanced further this weekend. I’ve made a translation of SDL’s Events to my own Msg’s, and some of them (mouse move, mouse down and mouse up) are successfully translated from SDL layer to Lua layer, where they are gladly consumed.
You can look at my second video, which will show the “Window Management magic” with focusing and window dragging. Be patient, the magic starts at 0:18 ;)