Refactoring of Input Devices

This commit is contained in:
2021-08-30 19:28:43 +02:00
parent e5ccf0879c
commit 20ecb4f1a3
7 changed files with 114 additions and 97 deletions

View File

@@ -0,0 +1,26 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include "InputDeviceController.hpp"
#include "Base/Logger.hpp"
namespace openVulkanoCpp::Input
{
void InputDeviceController::Init(const int index, const std::string& name)
{
InputDevice::Init(InputDeviceType::CONTROLLER, index, name);
pressedButtons = 0;
lastPressedButtons = 0;
for(float& axis : axes)
{
axis = 0;
}
// TODO find controller type from name
Logger::INPUT->info("Initialized controller: id: {0}, name: {1}", index, name);
}
}