From 3648181f8e216e0b72245a19b5e8f71a050a95ab Mon Sep 17 00:00:00 2001 From: wan-may Date: Sat, 23 Mar 2024 17:03:36 -0300 Subject: [PATCH] Upgrade LOVE to version 11.5 --- src/renderer/main.lua | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/renderer/main.lua b/src/renderer/main.lua index e98c0f1..6f564d8 100644 --- a/src/renderer/main.lua +++ b/src/renderer/main.lua @@ -1,9 +1,46 @@ +local love = assert( love ) +local lg = love.graphics local time = 0 +local text = "" + +--Set up the canvas. +assert( lg.getCanvasFormats( false ).stencil8, "Error: 8-bit stencil buffers not supported on this system." ) +local stencil = love.graphics.newCanvas( + 25, + 50, + { + type = "2d", + format = "stencil8", + readable = false, + msaa = 0, + dpiscale = 1, + mipmaps = "none", + }) + +local canvas = love.graphics.newCanvas( + lg.getWidth(), + lg.getHeight(), + { + type = "2d", + format = "rgba8", + readable = true, + msaa = 0, + dpiscale = 1, + mipmaps = "none", + }) function love.update(dt) time = time + dt end function love.draw() - love.graphics.print( time ) + lg.setCanvas{{canvas}, depthstencil = {stencil}} + lg.setColor( 1,1,1,1 ) + lg.rectangle( "fill", 0, 0, 400, 400 ) + lg.setCanvas() + lg.draw( canvas ) +end + +function love.textinput(t) + text = text..t end \ No newline at end of file