diff options
| author | s-ol <s+removethis@s-ol.nu> | 2025-03-21 12:02:30 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-21 12:41:48 +0000 |
| commit | 36f651c4e01143790b398cda3b5862cd7128e888 (patch) | |
| tree | 3646609a745ebed9e8a07c20faecb5edf43c2cc4 /alv/copilot | |
| parent | lib: separate glsl-view video/tsv-input ops (diff) | |
| download | alive-36f651c4e01143790b398cda3b5862cd7128e888.tar.gz alive-36f651c4e01143790b398cda3b5862cd7128e888.zip | |
lib: add love/tsv-output
Diffstat (limited to 'alv/copilot')
| -rw-r--r-- | alv/copilot/love/init.moon | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/alv/copilot/love/init.moon b/alv/copilot/love/init.moon index 83a45bf..f21e11d 100644 --- a/alv/copilot/love/init.moon +++ b/alv/copilot/love/init.moon @@ -25,14 +25,30 @@ class LoveCopilot extends CLICopilot @key_releases = T.str\mk_evt! @textinput = T.str\mk_evt! + w, h = love.window.getMode! + @window_size = vec2\mk_sig { w, h } + + @tsv_canvas = nil + draw: => - love.graphics.origin! + love.graphics.reset! love.graphics.clear! + if @tsv_canvas + love.graphics.setCanvas @tsv_canvas.canvas + love.graphics.clear! + for id, list in pairs @drawlist for fn in *list fn! + if @tsv_canvas + love.graphics.reset! + + @tsv_canvas\send! + love.graphics.setBlendMode "alpha", "premultiplied" + love.graphics.draw @tsv_canvas.canvas + love.graphics.present! run: => @@ -62,6 +78,8 @@ class LoveCopilot extends CLICopilot @textinput\set a, true when 'keyreleased' @key_releases\set a, true + when 'resize' + @window_size\set { a, b } --else -- print "unhandled: '#{name}'", a,b,c,d,e,f |
