summaryrefslogtreecommitdiff
path: root/src/mouseGet.cpp
blob: f26e8008f63e5697a7276129e8718413395e3cd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "FLD.hpp"

FLD::InputState
FLD::mouseGet(Uint8 btn) const
{
	return mousestates[btn];
}

bool
FLD::mouseDown(Uint8 btn) const
{
	const auto state = mouseGet(btn);
	return (state == InputState::Down || state == InputState::Press);
}

bool
FLD::mouseUp(Uint8 btn) const
{
	return !mouseDown(btn);
}

bool
FLD::mousePressed(Uint8 btn) const
{
	return (mouseGet(btn) == InputState::Press);
}

bool
FLD::mouseReleased(Uint8 btn) const
{
	return (mouseGet(btn) == InputState::Release);
}