Run a love program with no GUI screen [resolved]
Posted: Wed Aug 10, 2016 2:36 pm
I know the question sounds a bit demented, but I am trying to write a bunch of emulators, some of which need a GUI and some don't.
I could use pure lua, but I really like the love callback mechanism as it provides "scheduler" in its update() callback.
So for the emulators that need the GUI its great, but for the emulators that don't need the GUI I still get the blank window that appears - I kind of just don't want it to appear (or just be hidden).
Is that possible? I have provided my code, but I don't think it makes a difference to this question... here is an example anyway (note no GUI stuff):
I could use pure lua, but I really like the love callback mechanism as it provides "scheduler" in its update() callback.
So for the emulators that need the GUI its great, but for the emulators that don't need the GUI I still get the blank window that appears - I kind of just don't want it to appear (or just be hidden).
Is that possible? I have provided my code, but I don't think it makes a difference to this question... here is an example anyway (note no GUI stuff):
Code: Select all
-- TCP Controller
local socket = require("socket")
-- UPDATED AFTER POST:
-- Dont need a GUI
function love.conf(t)
t.window = nil
end
-- UPDATE END
-- Startup
function love.load()
udp = socket.udp()
udp:setsockname("*", 53474)
udp:settimeout(0)
end
-- Scheduler
function love.update()
-- Check for UDP data
data, ip, port = udp:receivefrom()
if data then
print("Received: ", data, ip, port)
print("Reply...")
udp:sendto(data, ip, port)
end
end