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

@@ -15,6 +15,11 @@ struct
else
()
fun framebufferSizeCallback mailbox (width, height) =
let val _ = Gles3.viewport (width, height)
in Mailbox.send (mailbox, RESIZE_WINDOW {width = width, height = height})
end
fun registerCallbacks (window, inputMailbox) =
let
val mouseMoveCallback = mouseMoveCallback inputMailbox
@@ -24,6 +29,10 @@ struct
val mouseClickCallback = mouseClickCallback inputMailbox
val _ = Input.exportMouseClickCallback mouseClickCallback
val _ = Input.setMouseClickCallback window
val resizeCallback = framebufferSizeCallback inputMailbox
val _ = Input.exportFramebufferSizeCallback resizeCallback
val _ = Input.setFramebufferSizeCallback window
in
()
end