LÖVE backend + build target (compat/luajit.lua shims, Roblox build unchanged), examples/example_love, examples/example_shared (same app on Roblox and LÖVE), LuaJIT checksum tests

This commit is contained in:
4DBug
2026-10-08 19:31:22 -05:00
parent 81c5ad9e43
commit 66fa061089
23 changed files with 56780 additions and 17 deletions
+25
View File
@@ -0,0 +1,25 @@
-- Minimal headless `love` for running build/imgui_love.lua under plain LuaJIT (tools/test/love/run.sh).
local ffi = require("ffi")
local W, H = 1920, 1080
local t = 0
local function obj(extra) local o = { release = function() end }; for k, v in pairs(extra or {}) do o[k] = v end; return o end
local function bytedata(n)
local mem = ffi.new("uint8_t[?]", n)
return obj({ getFFIPointer = function() return mem end, getSize = function() return n end })
end
love = {
timer = { getTime = function() return t end, step = function(dt) t = t + dt end },
graphics = {
getDimensions = function() return W, H end,
newImage = function() return obj({ setFilter = function() end, replacePixels = function() end }) end,
newMesh = function() return obj({ setVertices = function() end, setVertexMap = function() end, setTexture = function() end, setDrawRange = function() end }) end,
push = function() end, pop = function() end, setBlendMode = function() end, setColor = function() end,
translate = function() end, setScissor = function() end, draw = function() MOCK_DRAWS = (MOCK_DRAWS or 0) + 1 end,
},
image = { newImageData = function(w, h) return bytedata(w * h * 4) end },
data = { newByteData = function(n) return bytedata(n) end },
keyboard = { isDown = function() return false end, setTextInput = function() end, setKeyRepeat = function() end },
mouse = { setCursor = function() end, getSystemCursor = function() return {} end, setVisible = function() end },
system = { getClipboardText = function() return "" end, setClipboardText = function() end, openURL = function() end },
filesystem = { getInfo = function() return nil end, read = function() return nil end },
}