I'm using GLFW for creating OpenGL context and capturing user's input and I wanted to capture whole input actions from other thread than OpenGL context was initially created. Am I able to achieve this by using GLFW开发者_如何转开发, SDL or similar library or need I, for example, use different libraray for each task? And if so, which library would you recommend for capturing input? (it need to be cross-platform). Thanks in advance.
GLFW has good input API and you don't really need to process input in separate thread. If your framerate is high enough, checking input once per frame should be enough (if your frames are taking seconds to render, that may be not the case).
OpenGL and threads don't mix very well. If you really need more threads, the best way would be to send some messages (containing user input informations) from the opengl thread to the thread where you do something with this information.
精彩评论