nngn
Loading...
Searching...
No Matches
mouse.h
Go to the documentation of this file.
1#ifndef NNGN_INPUT_MOUSE_H
2#define NNGN_INPUT_MOUSE_H
3
4#include "math/vec2.h"
5
6struct lua_State;
7
8namespace nngn {
9
15class MouseInput {
16public:
17 enum class Action : std::uint8_t { PRESS = 1, RELEASE = 0 };
18 void init(lua_State *L_) { this->L = L_; }
30 bool button_callback(int button, int action, int mods);
33private:
34 lua_State *L = {};
35 int button_cb = {}, move_cb = {};
36};
37
38}
39
40#endif
bool button_callback(int button, int action, int mods)
Triggers a button event.
bool move_callback(dvec2 pos)
Triggers a move event.
int move_cb
Definition: mouse.h:35
Action
Definition: mouse.h:17
int button_cb
Definition: mouse.h:35
lua_State * L
Definition: mouse.h:34
void register_move_callback()
Registers a Lua function called when the mouse position changes.
void init(lua_State *L_)
Definition: mouse.h:18
void register_button_callback()
Registers a Lua function called when a button is pressed.
pos
Definition: lua_audio.cpp:17
Definition: audio.cpp:7
Definition: vec2.h:11