16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 22:59:19 +02:00

build 170708. cursor-based item picking, mouse support for cab controls, rudimentary render modes support in renderer

This commit is contained in:
tmj-fstate
2017-07-09 16:45:40 +02:00
parent d3b812ee9f
commit 9a008ecff5
26 changed files with 1931 additions and 931 deletions

View File

@@ -28,6 +28,10 @@ public:
key( int const Key, int const Action );
void
mouse( double const Mousex, double const Mousey );
void
mouse( int const Button, int const Action );
void
poll();
private:
// types
@@ -45,6 +49,18 @@ private:
typedef std::vector<command_setup> commandsetup_sequence;
typedef std::unordered_map<int, user_command> usercommand_map;
struct mouse_commands {
user_command left;
user_command right;
mouse_commands( user_command const Left, user_command const Right ):
left(Left), right(Right)
{}
};
typedef std::unordered_map<std::string, mouse_commands> controlcommands_map;
struct bindings_cache {
int forward{ -1 };
@@ -66,9 +82,13 @@ private:
// members
commandsetup_sequence m_commands;
usercommand_map m_bindings;
controlcommands_map m_mousecommands;
user_command m_mousecommandleft { user_command::none }; // last if any command issued with mouse
user_command m_mousecommandright { user_command::none };
command_relay m_relay;
bool m_shift{ false };
bool m_ctrl{ false };
double m_updateaccumulator { 0.0 };
bindings_cache m_bindingscache;
std::array<char, GLFW_KEY_LAST + 1> m_keys;
};