summaryrefslogtreecommitdiff
path: root/src/mouseGet.cpp
blob: 503757e412b8948f144fbe8ce32f3e4eb2cb805b (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(SDL_Scancode sc) const
{
	return mousestates[sc];
}

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

bool
FLD::mouseUp(SDL_Scancode sc) const
{
	return !mouseDown(sc);
}

bool
FLD::mousePressed(SDL_Scancode sc) const
{
	return (mouseGet(sc) == InputState::Press);
}

bool
FLD::mouseReleased(SDL_Scancode sc) const
{
	return (mouseGet(sc) == InputState::Release);
}