minor refactor
This commit is contained in:
parent
9d7816a286
commit
3187243a7d
@ -8,6 +8,8 @@ using runnable = std::function<void()>;
|
|||||||
template<class T> using supplier = std::function<T()>;
|
template<class T> using supplier = std::function<T()>;
|
||||||
template<class T> using consumer = std::function<void(T)>;
|
template<class T> using consumer = std::function<void(T)>;
|
||||||
|
|
||||||
|
using KeyCallback = std::function<bool()>;
|
||||||
|
|
||||||
// data sources
|
// data sources
|
||||||
using wstringsupplier = std::function<std::wstring()>;
|
using wstringsupplier = std::function<std::wstring()>;
|
||||||
using doublesupplier = std::function<double()>;
|
using doublesupplier = std::function<double()>;
|
||||||
|
|||||||
@ -247,7 +247,7 @@ runnable lua::create_runnable(State* L) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
supplier<bool> lua::create_simple_handler(State* L) {
|
KeyCallback lua::create_simple_handler(State* L) {
|
||||||
auto funcptr = create_lambda_handler(L);
|
auto funcptr = create_lambda_handler(L);
|
||||||
return [=]() -> bool {
|
return [=]() -> bool {
|
||||||
getglobal(L, LAMBDAS_TABLE);
|
getglobal(L, LAMBDAS_TABLE);
|
||||||
|
|||||||
@ -574,7 +574,7 @@ namespace lua {
|
|||||||
}
|
}
|
||||||
|
|
||||||
runnable create_runnable(lua::State*);
|
runnable create_runnable(lua::State*);
|
||||||
supplier<bool> create_simple_handler(lua::State*);
|
KeyCallback create_simple_handler(lua::State*);
|
||||||
scripting::common_func create_lambda(lua::State*);
|
scripting::common_func create_lambda(lua::State*);
|
||||||
scripting::common_func create_lambda_nothrow(lua::State*);
|
scripting::common_func create_lambda_nothrow(lua::State*);
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "delegates.hpp"
|
||||||
#include "typedefs.hpp"
|
#include "typedefs.hpp"
|
||||||
#include "input.hpp"
|
#include "input.hpp"
|
||||||
|
|
||||||
@ -20,8 +21,6 @@ class Events {
|
|||||||
static uint currentFrame;
|
static uint currentFrame;
|
||||||
static bool cursor_drag;
|
static bool cursor_drag;
|
||||||
public:
|
public:
|
||||||
using KeyCallback = std::function<bool()>;
|
|
||||||
|
|
||||||
static int scroll;
|
static int scroll;
|
||||||
static glm::vec2 delta;
|
static glm::vec2 delta;
|
||||||
static glm::vec2 cursor;
|
static glm::vec2 cursor;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user