add framebufferSize callback (FFI scaffolding and creating new variant of input_message type but don't react to this message in a meaningful way yet)

This commit is contained in:
2024-08-01 23:33:54 +01:00
parent c5d9ed4c69
commit 13063ea2c6
7 changed files with 34 additions and 7 deletions

View File

@@ -10,16 +10,21 @@ void mouseMoveCallback(GLFWwindow *window, double xpos, double ypos) {
mltonMouseMoveCallback((float)xpos, (float)ypos);
}
void mouseClickCallback(GLFWwindow *window, int button, int action, int mods) {
mltonMouseClickCallback(button, action);
}
// Call this from MLton to register key callback with GLFW.
// Call this from MLton to register callback with GLFW.
void setMouseMoveCallback(GLFWwindow *window) {
glfwSetCursorPosCallback(window, mouseMoveCallback);
}
void mouseClickCallback(GLFWwindow *window, int button, int action, int mods) {
mltonMouseClickCallback(button, action);
}
void setMouseClickCallback(GLFWwindow *window) {
glfwSetMouseButtonCallback(window, mouseClickCallback);
}
void framebufferSizeCallback(GLFWwindow *window, int width, int height) {
mltonFramebufferSizeCallback(width, height);
}
void setFramebufferSizeCallback(GLFWwindow *window, int width, int height) {
glfwSetFramebufferSizeCallback(window, framebufferSizeCallback);
}