At the moment this is the case:
- ipad 4gen (I think) - running fast
- imac M1 - running fast (window and full screen)
- old macbook air (target machine at the moment), window mode running fast, fullscreen not.
When I use an Image (not using text), then fullscreen is 60FPS, when I use a Text object it is 34FPS.
This is only the case when using full screen.
Another fact is that in window mode the cpu around 7% mem 94MB. fullscreen cpu 87% mem 245MB.
main.lua
Code: Select all
fonts = {
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt"),
love.graphics.newFont("font/impact-32-255_255_255.fnt")
}
texts = {}
canvas = {}
redraw = {}
for _, font in pairs(fonts) do
table.insert(texts, love.graphics.newText(font, "test"))
table.insert(canvas, love.graphics.newCanvas())
table.insert(redraw, true)
end
function drawCanvas(index)
if redraw[index] == false then
return
end
love.graphics.clear()
love.graphics.setBlendMode("alpha", "alphamultiply")
love.graphics.setColor(1, 0, 0)
love.graphics.rectangle("fill", love.math.random(50, 400), love.math.random(50, 400), 100, 100)
love.graphics.draw(texts[index], love.math.random(50, 400), love.math.random(50, 400))
redraw[index] = false
end
function love.load()
for index, canvas in pairs(canvas) do
canvas:renderTo(
function()
drawCanvas(index)
end
)
end
end
function love.draw()
love.graphics.print("FPS: " .. tostring(love.timer.getFPS()), 10, 10)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.setBlendMode("alpha", "premultiplied")
for _, canvas in pairs(canvas) do
love.graphics.draw(canvas)
end
love.graphics.setBlendMode("alpha", "alphamultiply")
end
function love.keypressed(key, unicode)
if key == "escape" then
love.event.quit()
end
end
Code: Select all
function love.conf(t)
t.identity = "Font"
t.title = "Font"
t.appendidentity = false -- Search files in source directory before save directory (boolean)
t.version = "11.4" -- The LÖVE version this game was made for (string)
t.console = false -- Attach a console (boolean, Windows only)
t.accelerometerjoystick = false -- Enable the accelerometer on iOS and Android by exposing it as a Joystick (boolean)
t.externalstorage = true -- True to save files (and read from the save directory) in external storage on Android (boolean)
t.gammacorrect = false -- Enable gamma-correct rendering, when supported by the system (boolean)
t.audio.mic = false -- Request and use microphone capabilities in Android (boolean)
t.audio.mixwithsystem = true -- Keep background music playing when opening LOVE (boolean, iOS and Android only)
t.window.icon = nil -- Filepath to an image to use as the window's icon (string)
t.window.width = 800 -- The window width (number)
t.window.height = 600 -- The window height (number)
t.window.borderless = false -- Remove all border visuals from the window (boolean)
t.window.resizable = false -- Let the window be user-resizable (boolean)
t.window.minwidth = 1 -- Minimum window width if the window is resizable (number)
t.window.minheight = 1 -- Minimum window height if the window is resizable (number)
t.window.fullscreen = true -- Enable fullscreen (boolean)
t.window.fullscreentype = "desktop" -- Choose between "desktop" fullscreen or "exclusive" fullscreen mode (string)
t.window.usedpiscale = true -- Enable automatic DPI scaling (boolean)
t.window.vsync = 1 -- Vertical sync mode (number)
t.window.msaa = 0 -- The number of samples to use with multi-sampled antialiasing (number)
t.window.depth = nil -- The number of bits per sample in the depth buffer
t.window.stencil = nil -- The number of bits per sample in the stencil buffer
t.window.display = 1 -- Index of the monitor to show the window in (number)
t.window.highdpi = false -- Enable high-dpi mode for the window on a Retina display (boolean)
t.window.x = 600 -- The x-coordinate of the window's position in the specified display (number)
t.window.y = nil -- The y-coordinate of the window's position in the specified display (number)
t.modules.audio = true -- Enable the audio module (boolean)
t.modules.data = true -- Enable the data module (boolean)
t.modules.event = true -- Enable the event module (boolean)
t.modules.font = true -- Enable the font module (boolean)
t.modules.graphics = true -- Enable the graphics module (boolean)
t.modules.image = true -- Enable the image module (boolean)
t.modules.joystick = false -- Enable the joystick module (boolean)
t.modules.keyboard = true -- Enable the keyboard module (boolean)
t.modules.math = true -- Enable the math module (boolean)
t.modules.mouse = true -- Enable the mouse module (boolean)
t.modules.physics = false -- Enable the physics module (boolean)
t.modules.sound = true -- Enable the sound module (boolean)
t.modules.system = true -- Enable the system module (boolean)
t.modules.thread = true -- Enable the thread module (boolean)
t.modules.timer = true -- Enable the timer module (boolean), Disabling it will result 0 delta time in love.update
t.modules.touch = true -- Enable the touch module (boolean)
t.modules.video = true -- Enable the video module (boolean)
t.modules.window = true -- Enable the window module (boolean)
end
(not possible to upload .fnt files)
Code: Select all
info face="Impact" size=-32 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=0,0 outline=0
common lineHeight=30 base=36 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4
page id=0 file="impact-32-255_255_255_0.png"
chars count=101
char id=32 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=6 page=0 chnl=15
char id=33 x=129 y=21 width=8 height=25 xoffset=1 yoffset=11 xadvance=9 page=0 chnl=15
char id=35 x=0 y=74 width=20 height=23 xoffset=0 yoffset=13 xadvance=20 page=0 chnl=15
char id=36 x=25 y=26 width=17 height=31 xoffset=0 yoffset=8 xadvance=18 page=0 chnl=15
char id=37 x=77 y=0 width=22 height=25 xoffset=0 yoffset=11 xadvance=22 page=0 chnl=15
char id=38 x=86 y=48 width=19 height=22 xoffset=0 yoffset=14 xadvance=18 page=0 chnl=15
char id=39 x=9 y=248 width=6 height=8 xoffset=0 yoffset=11 xadvance=6 page=0 chnl=15
char id=40 x=135 y=190 width=9 height=25 xoffset=1 yoffset=11 xadvance=10 page=0 chnl=15
char id=41 x=126 y=46 width=9 height=25 xoffset=0 yoffset=11 xadvance=10 page=0 chnl=15
char id=42 x=0 y=248 width=9 height=8 xoffset=0 yoffset=11 xadvance=9 page=0 chnl=15
char id=43 x=34 y=122 width=17 height=16 xoffset=0 yoffset=15 xadvance=17 page=0 chnl=15
char id=44 x=41 y=109 width=5 height=8 xoffset=0 yoffset=31 xadvance=5 page=0 chnl=15
char id=45 x=15 y=248 width=9 height=5 xoffset=0 yoffset=23 xadvance=9 page=0 chnl=15
char id=46 x=16 y=241 width=6 height=5 xoffset=0 yoffset=31 xadvance=6 page=0 chnl=15
char id=48 x=83 y=105 width=15 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=49 x=59 y=84 width=11 height=25 xoffset=0 yoffset=11 xadvance=12 page=0 chnl=15
char id=50 x=100 y=21 width=16 height=25 xoffset=0 yoffset=11 xadvance=16 page=0 chnl=15
char id=51 x=16 y=141 width=16 height=25 xoffset=0 yoffset=11 xadvance=17 page=0 chnl=15
char id=52 x=0 y=148 width=16 height=25 xoffset=0 yoffset=11 xadvance=16 page=0 chnl=15
char id=53 x=0 y=173 width=16 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=54 x=0 y=198 width=16 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=55 x=116 y=21 width=13 height=25 xoffset=0 yoffset=11 xadvance=13 page=0 chnl=15
char id=56 x=0 y=223 width=16 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=57 x=16 y=166 width=16 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=58 x=36 y=106 width=5 height=16 xoffset=1 yoffset=20 xadvance=6 page=0 chnl=15
char id=59 x=36 y=87 width=5 height=19 xoffset=1 yoffset=20 xadvance=6 page=0 chnl=15
char id=60 x=48 y=238 width=16 height=16 xoffset=1 yoffset=15 xadvance=17 page=0 chnl=15
char id=61 x=86 y=70 width=16 height=9 xoffset=1 yoffset=19 xadvance=17 page=0 chnl=15
char id=62 x=128 y=229 width=16 height=16 xoffset=1 yoffset=15 xadvance=17 page=0 chnl=15
char id=63 x=16 y=191 width=16 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=64 x=27 y=0 width=25 height=26 xoffset=0 yoffset=11 xadvance=25 page=0 chnl=15
char id=65 x=70 y=80 width=18 height=25 xoffset=-1 yoffset=11 xadvance=16 page=0 chnl=15
char id=66 x=16 y=216 width=16 height=25 xoffset=1 yoffset=11 xadvance=18 page=0 chnl=15
char id=67 x=32 y=141 width=16 height=25 xoffset=1 yoffset=11 xadvance=18 page=0 chnl=15
char id=68 x=32 y=166 width=16 height=25 xoffset=1 yoffset=11 xadvance=18 page=0 chnl=15
char id=69 x=110 y=179 width=12 height=25 xoffset=1 yoffset=11 xadvance=13 page=0 chnl=15
char id=70 x=122 y=179 width=12 height=25 xoffset=1 yoffset=11 xadvance=13 page=0 chnl=15
char id=71 x=32 y=191 width=16 height=25 xoffset=1 yoffset=11 xadvance=18 page=0 chnl=15
char id=72 x=32 y=216 width=16 height=25 xoffset=1 yoffset=11 xadvance=18 page=0 chnl=15
char id=73 x=70 y=24 width=7 height=25 xoffset=1 yoffset=11 xadvance=9 page=0 chnl=15
char id=74 x=123 y=146 width=10 height=25 xoffset=0 yoffset=11 xadvance=11 page=0 chnl=15
char id=75 x=0 y=97 width=17 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=76 x=124 y=204 width=11 height=25 xoffset=1 yoffset=11 xadvance=12 page=0 chnl=15
char id=77 x=0 y=49 width=21 height=25 xoffset=1 yoffset=11 xadvance=23 page=0 chnl=15
char id=78 x=88 y=79 width=15 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=79 x=48 y=138 width=16 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=80 x=64 y=209 width=15 height=25 xoffset=1 yoffset=11 xadvance=16 page=0 chnl=15
char id=81 x=20 y=88 width=16 height=28 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=82 x=79 y=209 width=15 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=83 x=51 y=109 width=16 height=25 xoffset=0 yoffset=11 xadvance=17 page=0 chnl=15
char id=84 x=80 y=183 width=15 height=25 xoffset=0 yoffset=11 xadvance=15 page=0 chnl=15
char id=85 x=48 y=163 width=16 height=25 xoffset=1 yoffset=11 xadvance=18 page=0 chnl=15
char id=86 x=41 y=84 width=18 height=25 xoffset=-1 yoffset=11 xadvance=17 page=0 chnl=15
char id=87 x=0 y=0 width=27 height=25 xoffset=0 yoffset=11 xadvance=26 page=0 chnl=15
char id=88 x=48 y=188 width=16 height=25 xoffset=0 yoffset=11 xadvance=15 page=0 chnl=15
char id=89 x=17 y=116 width=17 height=25 xoffset=-1 yoffset=11 xadvance=15 page=0 chnl=15
char id=90 x=110 y=154 width=13 height=25 xoffset=0 yoffset=11 xadvance=13 page=0 chnl=15
char id=91 x=126 y=71 width=8 height=25 xoffset=1 yoffset=11 xadvance=9 page=0 chnl=15
char id=93 x=134 y=71 width=8 height=25 xoffset=0 yoffset=11 xadvance=9 page=0 chnl=15
char id=94 x=24 y=241 width=16 height=13 xoffset=0 yoffset=11 xadvance=15 page=0 chnl=15
char id=95 x=77 y=46 width=19 height=2 xoffset=-1 yoffset=39 xadvance=18 page=0 chnl=15
char id=97 x=64 y=234 width=16 height=21 xoffset=0 yoffset=15 xadvance=16 page=0 chnl=15
char id=98 x=94 y=208 width=15 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=99 x=80 y=234 width=16 height=21 xoffset=0 yoffset=15 xadvance=16 page=0 chnl=15
char id=100 x=48 y=213 width=16 height=25 xoffset=0 yoffset=11 xadvance=17 page=0 chnl=15
char id=101 x=96 y=233 width=16 height=21 xoffset=0 yoffset=15 xadvance=16 page=0 chnl=15
char id=102 x=126 y=120 width=10 height=25 xoffset=0 yoffset=11 xadvance=9 page=0 chnl=15
char id=103 x=64 y=185 width=16 height=24 xoffset=0 yoffset=15 xadvance=17 page=0 chnl=15
char id=104 x=95 y=158 width=15 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15
char id=105 x=135 y=46 width=7 height=25 xoffset=1 yoffset=11 xadvance=9 page=0 chnl=15
char id=106 x=42 y=26 width=9 height=28 xoffset=-1 yoffset=11 xadvance=9 page=0 chnl=15
char id=107 x=95 y=183 width=15 height=25 xoffset=1 yoffset=11 xadvance=15 page=0 chnl=15
char id=108 x=137 y=0 width=7 height=25 xoffset=1 yoffset=11 xadvance=9 page=0 chnl=15
char id=109 x=77 y=25 width=23 height=21 xoffset=1 yoffset=15 xadvance=25 page=0 chnl=15
char id=110 x=105 y=46 width=15 height=21 xoffset=1 yoffset=15 xadvance=17 page=0 chnl=15
char id=111 x=112 y=233 width=16 height=21 xoffset=0 yoffset=15 xadvance=16 page=0 chnl=15
char id=112 x=96 y=130 width=15 height=24 xoffset=1 yoffset=15 xadvance=17 page=0 chnl=15
char id=113 x=79 y=159 width=16 height=24 xoffset=0 yoffset=15 xadvance=17 page=0 chnl=15
char id=114 x=134 y=169 width=11 height=21 xoffset=1 yoffset=15 xadvance=11 page=0 chnl=15
char id=115 x=122 y=0 width=15 height=21 xoffset=0 yoffset=15 xadvance=15 page=0 chnl=15
char id=116 x=133 y=145 width=10 height=24 xoffset=0 yoffset=12 xadvance=10 page=0 chnl=15
char id=117 x=111 y=125 width=15 height=21 xoffset=1 yoffset=15 xadvance=17 page=0 chnl=15
char id=118 x=98 y=104 width=16 height=21 xoffset=-1 yoffset=15 xadvance=14 page=0 chnl=15
char id=119 x=99 y=0 width=23 height=21 xoffset=-1 yoffset=15 xadvance=21 page=0 chnl=15
char id=120 x=114 y=99 width=15 height=21 xoffset=0 yoffset=15 xadvance=14 page=0 chnl=15
char id=121 x=80 y=134 width=16 height=24 xoffset=-1 yoffset=15 xadvance=14 page=0 chnl=15
char id=122 x=115 y=67 width=11 height=21 xoffset=0 yoffset=15 xadvance=11 page=0 chnl=15
char id=123 x=58 y=54 width=12 height=30 xoffset=0 yoffset=11 xadvance=12 page=0 chnl=15
char id=124 x=36 y=57 width=5 height=30 xoffset=2 yoffset=11 xadvance=9 page=0 chnl=15
char id=125 x=103 y=70 width=12 height=29 xoffset=0 yoffset=11 xadvance=12 page=0 chnl=15
char id=169 x=0 y=25 width=25 height=24 xoffset=0 yoffset=12 xadvance=25 page=0 chnl=15
char id=174 x=52 y=0 width=25 height=24 xoffset=0 yoffset=12 xadvance=25 page=0 chnl=15
char id=196 x=52 y=24 width=18 height=30 xoffset=-1 yoffset=6 xadvance=16 page=0 chnl=15
char id=209 x=21 y=57 width=15 height=31 xoffset=1 yoffset=5 xadvance=17 page=0 chnl=15
char id=214 x=70 y=49 width=16 height=31 xoffset=1 yoffset=5 xadvance=17 page=0 chnl=15
char id=220 x=42 y=54 width=16 height=30 xoffset=1 yoffset=6 xadvance=18 page=0 chnl=15
char id=223 x=64 y=134 width=16 height=25 xoffset=1 yoffset=11 xadvance=18 page=0 chnl=15
char id=228 x=0 y=122 width=16 height=26 xoffset=0 yoffset=10 xadvance=16 page=0 chnl=15
char id=241 x=64 y=159 width=15 height=26 xoffset=1 yoffset=10 xadvance=17 page=0 chnl=15
char id=246 x=67 y=109 width=16 height=25 xoffset=0 yoffset=11 xadvance=16 page=0 chnl=15
char id=252 x=109 y=208 width=15 height=25 xoffset=1 yoffset=11 xadvance=17 page=0 chnl=15