I am trying to set up glfw event callbacks. I haven't found any glfw-rs examples of it yet, unfortunately.
This is what I've been trying to call so far:
glfwSetWindowCloseCallback(
window as *mut GLFWwindow,
Some(|window| {
/* some code (doesn't work without it either) */
})
);
It gives the following mismatched error at `Some(|window|{})`:
note: expected fn pointer `extern "C" fn(*mut glfw_window::glfw::ffi::GLFWwindow)` found closure `[closure@src\platform\glfw\glfw_window.rs:91:22: 95:18]`
label: expected "C" fn, found "Rust" fn
I haven't found any way yet to convert the closure to a C Fn Pointer (GLFWwindowclosefun specifically in my example). There's unfortunately not a single glfw-rs example of the glfwSet*Callback functions that I could find. If anyone's got some resources, that would be helpful too!