love-loader/ll-min.lua

52 lines
1014 B
Lua
Raw Normal View History

-- Minimal Love Loader API
2022-07-08 18:09:39 +00:00
-- Version 3.0
-- (c) Er2 2022 <er2@dismail.de>
-- Zlib License
2022-04-28 18:35:21 +00:00
if not llUsed then
COLDIV = love.getVersion() == 0 and 1 or 255
if love.system
then MOBILE = love.system.getOS() == 'Android'
or love.system.getOS() == 'iOS'
else MOBILE = false
end
2022-07-08 18:09:39 +00:00
function llHome()
love.event.push('quit', 'restart')
end
if love.getVersion() >= 12 then
function love.graphics.stencil(fn)
love.graphics.setColorMask(false)
love.graphics.setStencilMode('replace', 'always', 1)
fn()
love.graphics.setColorMask(true)
end
2022-07-08 18:09:39 +00:00
function love.graphics.setStencilTest(cmp, val)
if cmp
then love.graphics.setStencilMode('keep', cmp, val)
else love.graphics.setStencilMode()
2022-07-08 18:09:39 +00:00
end
end
end
if MOBILE
then love.window.setFullscreen(true)
end
2022-04-28 18:35:21 +00:00
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