Hi, I'm trying to get an image sequence running.
The performance is very good until the DDR is completly full. After that the GC seems to start working and making some space for new images on RAM. Is there any manual way to free RAM?
Following a code snipped how I'm doing it right now: (maybe something realy simple I'm diong wrong?)
You're loading an image from file every frame, and every frame you discard one i.e. leave in the garbage memory limbo until GC can pick it up. Is it not an option to keep all of them in the memory simultaneously?
img = "synctest_QFHD-DDS/"
start = 0001
ende = 3000
frame = start
function love.load()
-- Don't need to assign to image here, because...
end
function love.update(dt)
collectgarbage()
-- ...if you are using the default love.run, then love.update will be called first, then love.draw second, each "cycle"...
image = love.graphics.newImage(string.format("%s%04d.dds", img, frame)) -- more compact
frame = frame % ende + 1 -- i'd parenthesize these if i were you, operator precedence may be different than you'd expect.
end
function love.draw()
-- ...meaning that this should never error with image being nil.
love.graphics.draw(image, 0, 0, 0, 0.5, 0.5)
end
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.