2016-10-26 19:45 GMT+02:00 Glenn Cavarlé <[email protected]>:

>
> Yes, your are right.
> What i mean is that it could be interesting if:
> [ SDLEvent => BlEvent ]   is substantially faster than   [ SDLEvent =>
> OSEvent => BlEvent ].
> If the difference is not significant, i think that does not justify to not
> benefit from OSWindow abstractions even if sometime they bring nothing
> more.


If you already thought about Announcements performance and produce
optimized alternative then I think it is critical to get events fast.
Now we have 10 variables which are decoded from int by bit operations:

leftShift rightShift leftAlt rightAlt leftCtrl rightCtrl leftCmd rightCmd
capsLock numLock

And then Bloc encodes them back to int. So for any event we have 20
operations and it is not just primitive calls.
Also OSEvent creation produces own garbage for internal structures which
also take time and memory.

But for me most important is how maintain both hierarchies. You answer Stef
that nothing will change over events during years (nobody invent new one or
not often).
But such argument could never be valid. Code is used, it could has bugs, it
could be improved by itself. People will always need to work with this
code, at least to read it. And it is difficult with two hierarchies which
are managed by double dispatch. Try to follow how concrete BlEvent is
produced.

And there is already some problem. I investigated deeply what happens in
sdl about modifiers and buttons. It is not easy. But I see that some
information becomes lost.
And Bloc also not provides full information from original objects
(modifiers and buttons).
So to fix these issues one needs to modify both hierarchies. First he needs
to decide how decode modifiers from SDL and then how to encode them into
Bloc bits.
And I am sure new issues will be found again and again. It is normal
process.

Reply via email to