helps to support top level shaders over gui

This commit is contained in:
Michael Freno
2025-10-29 18:55:40 -04:00
parent 1ebe10dde7
commit 7bbd02d687

View File

@@ -2410,12 +2410,15 @@ function Gui.draw(gameDrawFunc)
gameCanvas = Gui._gameCanvas gameCanvas = Gui._gameCanvas
-- Save the current canvas so we can restore it
local previousCanvas = love.graphics.getCanvas()
love.graphics.setCanvas(gameCanvas) love.graphics.setCanvas(gameCanvas)
love.graphics.clear() love.graphics.clear()
gameDrawFunc() -- Call the drawing function gameDrawFunc() -- Call the drawing function
love.graphics.setCanvas() love.graphics.setCanvas(previousCanvas)
-- Draw game canvas to screen -- Draw game canvas to the previous canvas (or screen if none)
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(gameCanvas, 0, 0) love.graphics.draw(gameCanvas, 0, 0)
end end