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
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
Mouse event manager.
Definition mouse.h:15
bool button_callback(int button, int action, int mods)
Triggers a button event.
Definition mouse.cpp:27
bool move_callback(dvec2 pos)
Triggers a move event.
Definition mouse.cpp:43
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.
Definition mouse.cpp:24
void init(lua_State *L_)
Definition mouse.h:18
void register_button_callback()
Registers a Lua function called when a button is pressed.
Definition mouse.cpp:22
pos
Definition lua_audio.cpp:17
Definition audio.cpp:7
Definition vec2.h:11