blob: b40daec4e7ed3a8a6befaaab97cb8bad1b888e89 (
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
33
34
35
|
#include "app.hpp"
#include <Magnum/ImGuiIntegration/Context.hpp>
namespace floormat {
void app::do_key(KeyEvent::Key k, KeyEvent::Modifiers m, bool pressed, bool repeated)
{
//using Mods = KeyEvent::Modifiers;
(void)m;
(void)repeated;
const key x = progn(switch (k) {
using enum KeyEvent::Key;
using enum key;
case W: return camera_up;
case A: return camera_left;
case S: return camera_down;
case D: return camera_right;
case Home: return camera_reset;
case Esc: return quit;
default: return MAX;
});
if (x != key::MAX)
keys[x] = pressed;
}
app::~app()
{
loader_::destroy();
}
} // namespace floormat
|