YourGameLib
Loading...
Searching...
No Matches
include
base_internal
yourgame_internal
input.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2019-2024 Alexander Scholz
3
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any damages
6
arising from the use of this software.
7
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
11
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
2. Altered source versions must be plainly marked as such, and must not be
17
misrepresented as being the original software.
18
3. This notice may not be removed or altered from any source distribution.
19
*/
20
#ifndef YOURGAME_INTERNAL_INPUT_H
21
#define YOURGAME_INTERNAL_INPUT_H
22
23
#include <map>
24
#include "
yourgame/input.h
"
25
26
namespace
yourgame_internal
27
{
28
namespace
input
29
{
30
struct
InputValue
31
{
32
InputValue
(
float
v = 0.0f) :
val
(v),
valLast
(v) {}
// default ctor
33
float
val
;
34
float
valLast
;
35
};
36
37
extern
std::map<yourgame::input::Source, InputValue>
inputStates
;
38
43
void
setInput
(
yourgame::input::Source
source,
float
value);
44
49
void
setInput2
(
yourgame::input::Source
source,
float
value);
50
51
void
tickInput
();
52
}
// namespace input
53
}
// namespace yourgame_internal
54
55
#endif
yourgame::input::Source
Source
identifies the source of an input
Definition
input.h:29
yourgame_internal::input::inputStates
std::map< yourgame::input::Source, InputValue > inputStates
Definition
input.cpp:28
yourgame_internal::input::setInput
void setInput(yourgame::input::Source source, float value)
set input value. used for buttons/keys if first input of source occurs, the last (previous) value is ...
Definition
input.cpp:30
yourgame_internal::input::tickInput
void tickInput()
Definition
input.cpp:30
yourgame_internal::input::setInput2
void setInput2(yourgame::input::Source source, float value)
set input value. used for positions/axes or other "continuous" signals if first input of source occur...
Definition
input.cpp:35
yourgame_internal
Definition
file.h:28
yourgame_internal::input::InputValue
Definition
input.h:31
yourgame_internal::input::InputValue::InputValue
InputValue(float v=0.0f)
Definition
input.h:32
yourgame_internal::input::InputValue::val
float val
Definition
input.h:33
yourgame_internal::input::InputValue::valLast
float valLast
Definition
input.h:34
input.h
Generated by
1.9.8