Answer the question
In order to leave comments, you need to log in
How to throw a pointer to glfwSetKeyCallback in C?
Out of curiosity, I'm trying GLFW, and for processing the keyboard there is a function in it glfwSetKeyCallback(window, key_callback);
and, accordingly, the callback function key_callback is written to process clicks. But it is not clear to me how to pass my data to this function, for example, a pointer to some data.
Answer the question
In order to leave comments, you need to log in
I didn't try GLFW, but do I understand correctly that the function signature allows you to send 4 integers?
Nor is any integer intended for a pointer or reference type.
Philosophically speaking, we can say that the parameters for the callback are formed by the caller, not you.
If you try to hack philosophy ugly, you can try to use a global variable ugly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question