Canvas VS Directly drawing to the screen
Posted: Sun Aug 12, 2018 3:46 pm
I have a project where I'm drawing 25 lines on the screen, I thought a canvas would increase the performance of this task but I'm actually getting poorer results
How come this?
Performs better than this?
I'm using FPS as a benchmark:
Without canvas:
With canvas:
Any help is appreciated
How come this?
Code: Select all
function love.draw()
line5() --This has 25 draw lines inside
end
Code: Select all
function love.load()
canvas = love.graphics.newCanvas(800, 600)
love.graphics.setCanvas(canvas)
love.graphics.clear()
line5() --This has 25 draw lines inside
love.graphics.setCanvas()
end
function love.draw()
love.graphics.draw(canvas)
end
Without canvas:
Code: Select all
FPS: 205
FPS: 205
FPS: 207
FPS: 211
FPS: 206
FPS: 206
FPS: 206
FPS: 209
FPS: 209
FPS: 204
FPS: 208
FPS: 203
FPS: 205
Code: Select all
FPS: 156
FPS: 167
FPS: 151
FPS: 157
FPS: 167
FPS: 159
FPS: 175
FPS: 181
FPS: 181
FPS: 181
FPS: 183
FPS: 173
FPS: 172