love-loader/ll-min.lua

46 lines
875 B
Lua

-- Minimal Love Loader API
-- Version 3.0
-- (c) Er2 2022 <er2@dismail.de>
-- Zlib License
if not llUsed then
COLDIV = love.getVersion() == 0 and 1 or 255
MOBILE = love.system.getOS() == 'Android'
or love.system.getOS() == 'iOS'
function llHome()
love.event.push('quit', 'restart')
end
if love.getVersion() >= 12 then
local stfn
function love.graphics.stencil(fn) stfn = fn end
function love.graphics.setStencilTest(cmp, val)
if not cmp
then love.graphics.setStencilMode()
else love.graphics.setStencilMode('replace', cmp, val, 1, 1)
stfn()
end
end
end
if MOBILE
then love.window.setFullscreen(true)
end
function love.resize(x, y)
W, H = x, y
if resize then resize(W, H) end
collectgarbage 'collect' -- because new font isn't clears
end
love.resize(love.graphics.getDimensions())
function love.event.quit()
llHome()
end
end