Poll controllers on a separate thread on Windows.

This means controllers will sample more than the game fps, and will work
whenever keyboards do.
This commit is contained in:
Unknown W. Brackets committed 2014-03-23 23:46:10 -07:00
1 parent b589d3b170
commit b641ced7e0
5 files changed
+112 -20

No files matched your search

+4 -13
View File
@@ -129,22 +129,13 @@ void UpdateScreenScale(int width, int height) {
}
static inline void UpdateRunLoop() {
NativeUpdate(input_state);
{
{
#ifdef _WIN32
lock_guard guard(input_state.lock);
input_state.pad_buttons = 0;
input_state.pad_lstick_x = 0;
input_state.pad_lstick_y = 0;
input_state.pad_rstick_x = 0;
input_state.pad_rstick_y = 0;
host->PollControllers(input_state);
UpdateInputState(&input_state);
#endif
}
NativeUpdate(input_state);
lock_guard guard(input_state.lock);
EndInputState(&input_state);
}
if (globalUIState != UISTATE_EXIT) {
NativeRender();
}