diff options
author | sanine <sanine.not@pm.me> | 2023-05-10 23:59:04 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-05-10 23:59:04 -0500 |
commit | 14195dac1eda9140192ca07003258715b8b0abd3 (patch) | |
tree | bb4e41153363c791d4a9c7948bc85e0d4f77bc98 /honey/window.lua | |
parent | 26bfc10ad0e8a355e9b02946dd31642f49a6ec60 (diff) |
implement basic floating-ray character controller
Diffstat (limited to 'honey/window.lua')
-rw-r--r-- | honey/window.lua | 6 |
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 |