More input
This commit is contained in:
parent
6bc5f4656e
commit
1676867489
@ -51,6 +51,16 @@ void onCursorPosCallback(GLFWwindow *window, double x, double y) {
|
||||
|
||||
kekData.activeCamera->rotateYaw(xoff);
|
||||
kekData.activeCamera->rotatePitch(yoff);
|
||||
|
||||
for(std::pair<InputListener, MouseCallback> cb : kekData.mouseCallbacks) {
|
||||
cb.second(window, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
void onKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) {
|
||||
for(std::pair<InputListener, KeyCallback> cb : kekData.keyCallbacks) {
|
||||
cb.second(window, key, scancode, action, mods);
|
||||
}
|
||||
}
|
||||
|
||||
int init() {
|
||||
|
@ -6,9 +6,9 @@
|
||||
|
||||
namespace kek {
|
||||
|
||||
typedef generic_callable_t<GLFWwindow *> PeriodicCallback;
|
||||
typedef generic_callable_t<GLFWwindow *> KeyCallback;
|
||||
typedef generic_callable_t<GLFWwindow *, double, double> MouseCallback;
|
||||
typedef generic_callable_t<GLFWwindow *> PeriodicCallback; // periodicCallback(GLFWwindow *window)
|
||||
typedef generic_callable_t<GLFWwindow *, int, int, int, int> KeyCallback; // keyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
|
||||
typedef generic_callable_t<GLFWwindow *, double, double> MouseCallback; // mouseCallback(GLFWwindow *window, double x, double y)
|
||||
|
||||
typedef unsigned int InputListener;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user