我有需要的方法voxContext*和回调glfwSetMouseButtonCallback。我的回调函数是void(*inputFunc)(voxContext* ctx, GLFWwindow* window, int button, int action, int mods). 我不能在glfwSetMouseButtonCallback. 我可以更改参数顺序吗?
当涉及到 GLFW 时,您通常使用以下方法将一些内部数据结构与每个窗口相关联:
void glfwSetWindowUserPointer (GLFWwindow *window, void *pointer);
void* glfwGetWindowUserPointer (GLFWwindow *window);
Run Code Online (Sandbox Code Playgroud)
在创建窗口时或任何时候设置用户指针,然后在回调中检索和使用它。