From 94cc023a056ebc49ed883739e9f42f51598e57a0 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Fri, 3 Apr 2026 09:43:31 -0400 Subject: Replace deprecated function calls --- src/im.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/im.lua') 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() -- cgit v1.3-2-g0d8e