I am building cross-platform game engine and now I am focused on Input system.
I have written an abstract Input system which passes the messages up and is beeing fed by platform dependent modules, running in separate thread.
In windows I have created "Message-only" window, which feed Input system with messages (translated to platform independent) from RAWINPUT.
Now I am having troubles to figure out how to do similar thing on unix based system. Is there any convenient way to get input (keyup, keydown, mousemove...) from kernel? Or any other way without need showing any window?
EDIT
I do not want to my Input System be dependent on my Renderer. Renderer should just notify input when app focus changed... So I want Input system to run on different thread than renderer.
Usually cross-platform input is achieved by using a wrapper library -- SDL is one that is pretty good at that, and the current version is even BSD licenced.
The advantages of using a wrapper are so big, that even Windows games that use their own solution on Windows tend to use SDL as a wrapper when running on Linux (that was the original reason SDL was created).
So in the worst case, you may keep your libraries on Windows, and use SDL for implementation specifically on *nix systems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With