summaryrefslogtreecommitdiff
path: root/honey/window.lua
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-05-10 23:59:04 -0500
committersanine <sanine.not@pm.me>2023-05-10 23:59:04 -0500
commit14195dac1eda9140192ca07003258715b8b0abd3 (patch)
treebb4e41153363c791d4a9c7948bc85e0d4f77bc98 /honey/window.lua
parent26bfc10ad0e8a355e9b02946dd31642f49a6ec60 (diff)
implement basic floating-ray character controller
Diffstat (limited to 'honey/window.lua')
-rw-r--r--honey/window.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/honey/window.lua b/honey/window.lua
index e2b9fb2..a940ba4 100644
--- a/honey/window.lua
+++ b/honey/window.lua
@@ -155,6 +155,9 @@ end
function Window.setCursorPosCallback(self, cb)
return glfw.SetCursorPosCallback(self.win, cb)
end
+function Window.setScrollCallback(self, cb)
+ return glfw.SetScrollCallback(self.win, cb)
+end
function Window.setInputMode(self, mode, value)
@@ -177,6 +180,9 @@ function Window.bindEvents(self, db)
self:setFramebufferSizeCallback(function(_, width, height)
ecs.script.dispatch(db, "onFramebufferSize", {window=self, width=width, height=height})
end)
+ self:setScrollCallback(function(_, xoffset, yoffset)
+ ecs.script.dispatch(db, "onScroll", {window=self, xoffset=xoffset, yoffset=yoffset})
+ end)
end