From 14195dac1eda9140192ca07003258715b8b0abd3 Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 10 May 2023 23:59:04 -0500 Subject: implement basic floating-ray character controller --- honey/window.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'honey/window.lua') 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 -- cgit v1.2.1