summaryrefslogtreecommitdiff
path: root/honey/window.lua
diff options
context:
space:
mode:
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