jkuhlmann / gainput

Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch
http://gainput.johanneskuhlmann.de/
MIT License
857 stars 103 forks source link

Reduce the amount of plattform specific code users have to write #23

Open koraa opened 7 years ago

koraa commented 7 years ago

Hi, I recently got fed up with using the not very C++ish API OIS provides; then I found your lib and started liking the API much more (the lack of * in your example really gives one a feeling of memory safety).

However, when integrating gainput into my code I found that there was rather a lot of plattform specific code I had to write. I used your sample framework as a reference and got it working at some point, but it seems to me, that a lot of code from the samples could simply be pulled into the main library, thereby saving the users of your lib a day of hassle.

Now of course there will be some platform specific code necessary to initialize gainput and assign it the correct window and so on. But even for that I could imagine that 80% of the cases could be solved in a generic way. E.g. to initialize the library one could list the windows opened by the current process and simply attach to the first one.