podvornyak wrote:Anyway i am trying to evade any OS dependencies, such as include side library. It makes code portable as much as possible. Compiling is painless.
If portability is your goal, then using assembler is certainly not appropriate, unless you plan to include platform-specific versions that can be selected by the compiler.
Once you've formally profiled your code's runtime and identified a section of code that is consuming all your time, and you cannot optimize it in any other way, then and only then is assembly appropriate in my opinion. Premature optimization is the root of all evil.
I suspect your performance issues are not coming from getmouse itself but your use of getmouse. Perhaps you need to compress mouse events. Remember that mouse events can happen many times faster than keyboard events, maybe dozens of times per second during movement. So likely what's happening is your response to the mouse events is happening too slow. So maybe you just need to throw out redundant mouse events.
Look around. There is not much clean and portable code at all. Everyone use windows headers. Even for context initialization. I think it is wrong, and leads to nowhere. Useless and unreadable bunch of code.
Actually portable code is extremely common these days (the FB runtime is a good example). It's certainly readable to those who are familiar with the code.
Your adversion to windows headers is a bit strange. Every single program on Windows requires at least windows.h. At some point every app on any OS has to depend on the OS.