lua program to change screen resolution

This commit is contained in:
Florian Nücke 2013-11-29 21:35:38 +01:00
parent 40755b9279
commit e837c43cf6

View File

@ -0,0 +1,22 @@
local args = shell.parse(...)
if #args == 0 then
print(component.gpu.getResolution())
return
end
if #args < 2 then
print("Usage: resolution [<width> <height>]")
return
end
local w = tonumber(args[1])
local h = tonumber(args[2])
if not w or not h then
print("invalid width or height")
return
end
local result, reason = component.gpu.setResolution(w, h)
if not result then
print(reason)
end