Added ImGuiBackendFlags for backend to expose its capabilities. Added ImGuiBackendFlags_HasGamepad. (#787, #1542)

This commit is contained in:
omar
2018-03-20 20:39:44 +01:00
parent 170f44e6f0
commit dcf7c3d188
4 changed files with 31 additions and 14 deletions

View File

@ -511,6 +511,10 @@ void ImGui_ImplGlfwGL3_NewFrame()
MAP_ANALOG(ImGuiNavInput_LStickDown, 1, -0.3f, -0.9f);
#undef MAP_BUTTON
#undef MAP_ANALOG
if (axes_count > 0 && buttons_count > 0)
io.BackendFlags |= ImGuiBackendFlags_HasGamepad;
else
io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;
}
// Start the frame. This call will update the io.WantCaptureMouse, io.WantCaptureKeyboard flag that you can use to dispatch inputs (or not) to your application.