-- get arg with love2d function love.load(arg) -- Check command line options ssmode = "" for k, v in pairs(arg) do lv = string.lower(v) if lv == "/s" then ssmode = "fullscreen" elseif lv == "/c" then ssmode = "config" elseif lv == "/p" then ssmode = "preview" elseif lv == "/a" then ssmode = "passwordlock" end end if ssmode == "" then ssmode = "none" end min_dt = 1 / 60 next_time = love.timer.getTime() end function love.update(dt) next_time = next_time + min_dt if dt > 0.75 then return end end function love.draw() love.graphics.setCanvas() love.graphics.clear(0, 0, 0.2, 1.0) love.graphics.setColor(1, 1, 1, 1) love.graphics.print("FPS: " .. tostring(love.timer.getFPS()), 10, 10) y = 32 for k, v in pairs(arg) do love.graphics.print(string.format("arg[%d] : %s", k, v), 10, y) y = y + 18 end y = y + 18 love.graphics.print("Mode : " .. ssmode, 10, y) if love.system.getOS() == "Windows" then -- wait local cur_time = love.timer.getTime() if next_time <= cur_time then next_time = cur_time else love.timer.sleep(next_time - cur_time) end end end function love.keypressed(key, isrepeat) if key == "escape" then -- ESC to exit love.event.quit() end end