diff options
author | Alex Auvolat <alex@adnab.me> | 2017-04-21 18:26:22 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2017-04-21 18:26:22 +0200 |
commit | ed153e6a5b9f001bbe49128e6bc53053f55dd37b (patch) | |
tree | 9a9bbe3551ea1b5de71aa3c358fd13f46c603191 /src/sysapp | |
parent | f8334e283c5eb0efeb4bb8a134041e18388d5f01 (diff) | |
download | kogata-ed153e6a5b9f001bbe49128e6bc53053f55dd37b.tar.gz kogata-ed153e6a5b9f001bbe49128e6bc53053f55dd37b.zip |
Can plot on a surface from lua
Diffstat (limited to 'src/sysapp')
-rw-r--r-- | src/sysapp/login/main.lua | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/sysapp/login/main.lua b/src/sysapp/login/main.lua index dec8b82..50ecd20 100644 --- a/src/sysapp/login/main.lua +++ b/src/sysapp/login/main.lua @@ -1,6 +1,7 @@ local sys = require 'lx.sys' local sysdef= require 'lx.sysdef' local ioctl = require 'lx.ioctl' +local draw = require 'lx.draw' print("Hello, world!") @@ -10,11 +11,22 @@ print("vesa_fd = " .. vesa_fd) local vesa_info = ioctl.fb_get_info(vesa_fd) print("vesa_info = ", vesa_info) +local surface = draw.from_fd(vesa_fd, vesa_info) +for x = 0, 255 do + for y = 0, 255 do + surface:plot(x, y, surface:rgb(x, y, 0)) + end +end + local i = 1 while true do - print(i) + surface:plot(i % (vesa_info.width-3), + i % (vesa_info.height-1), + surface:rgb(i % 256, + (i + 96) % 256, + (i + 2*96) % 256)) i = i + 1 - sys.usleep(1000000) + if i % 100000 == 0 then print(i) end end os.exit() |