-- Things go very bad if the canvas gets too large.
-- Even though it's in memory, LÖVE seems to use memory in the graphics card to write graphics to it.
-- If the canvas is too big to fit in graphics card memory, you get an unrecoverable error.
-- So I try to keep it from getting too large. But with a hard-coded constant because
-- I don't know how to measure how much graphics memory a computer has.
-- It might not protect older computers.
-- This is the place to experiment with if you run into an error about SDL limits and contacting Kartik.
local w = math.min(16000, Global_viewport.w)
local h = math.min(16000, Global_viewport.h)
Canvas = love.graphics.newCanvas(w, h)