aboutsummaryrefslogtreecommitdiff
path: root/src/im.lua
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-04-03 09:43:31 -0400
committeriamcheeseman <[email protected]>2026-04-03 09:43:31 -0400
commit94cc023a056ebc49ed883739e9f42f51598e57a0 (patch)
treed11024ecef2eb418e839ad7b281848604edcfaa8 /src/im.lua
parentfbdf8e6807fd4829be8a60f9af45317952b8fc8a (diff)
Replace deprecated function calls
Diffstat (limited to 'src/im.lua')
-rw-r--r--src/im.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/im.lua b/src/im.lua
index d48d4bc..5fda823 100644
--- a/src/im.lua
+++ b/src/im.lua
@@ -66,9 +66,11 @@ local function draw_img(img, x, y, quad)
end
local function draw_stencil(x, y, w, h)
- lg.stencil(function()
- lg.rectangle("fill", x, y, w, h)
- end, "replace", 1)
+ lg.setStencilMode("draw", 0)
+ lg.rectangle("fill", 0, 0, lg.getDimensions()) -- WHY DOESN'T LG.CLEAR() WORK RAAAAAGH
+ lg.setStencilMode("draw", 1)
+ lg.rectangle("fill", x, y, w, h)
+ lg.setStencilMode("test", 1)
end
local function text_cmd(text, x, y, r, g, b)
@@ -417,14 +419,14 @@ function im.end_step()
end
function im.draw()
- lg.setStencilTest("greater", 0)
+ lg.setStencilMode("test", 1)
for _, win in ipairs(wins) do
for _, cmd in ipairs(win.cmds) do
cmd.fn(unpack(cmd.args))
end
win.cmds = {}
end
- lg.setStencilTest()
+ lg.setStencilMode()
end
function im.has_focus()