Jump to content
  • Advertisement
Sign in to follow this  
blanky

Input Library

This topic is 4742 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, I have already chosen all the cross platform liraries I like, OpenGL, OpenAL, rakkarsoft, and for window handling GLFW, but now I need one that supports input, I know there's direct input and I like it but it's only microsoft, I'd like to know if you guys know of/recommend any, I wouldn't like to go with SDL but if it's the best then of course I will, GLFW has input but I dont know if it's all taht great, has anyone tried it? Basically I want something as good as direct input but cross platform, thanks.

Share this post


Link to post
Share on other sites
Advertisement
Thanks, but I'm writting OS specific code, should I use OS input? Is GetAsyncKeyState fast? Or should I use GLFW, if I do, and I decide to use GLFW for window handling as well, will it be slower than OS specific? That's almost obvious, but would it be noticeable? Thanks guys.

Share this post


Link to post
Share on other sites
The main reason why you'd be interested in using middleware like GLFW or FreeGlut is that they implement the OS specific code for you. Why write the OS specific code when it's already in your hands? These third party libraries are already writen and have been in maintainance for years now. They are very stable and work very well. It's your choice if you want to write you own, or use SDL/GLFW/FreeGlut/etc. They all accomplish pretty much the same thing in terms of window and input handling.

Share this post


Link to post
Share on other sites
otoh if you use directinput you can asynchronously poll all key states at once which is probably faster than doing it via events, glfw doesn't do that, is there any cross-platform input library that does this (or similar things for other platforms)?

Share this post


Link to post
Share on other sites
I'm not sure, probably SDL? GLFW does this thing called a function callback so it calls a function each time it gets input, and yeah GLFW polls like every 10th of a second or something like that.

Share this post


Link to post
Share on other sites
nope, glfw usually polls on buffer swap, so it only polls once per frame. and you can't use it if you want a separate input thread, because it isn't thread-safe. furthermore internally it just polls the normal windows events. sdl does the same iirc, but it is thread-safe though afaik.

Share this post


Link to post
Share on other sites
What it all comes down to is what's easiest for you to use. Since you're already using GLFW in your application, what's wrong with using it for input as well? GLFW has been proven to work for input in games, so go ahead and use it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!