I have found another issue which is causing problems on low spec PCs (e.g. laptops with built in / shared memory graphics devices).
If you overload the allocated memory (e.g. with several hundred or thousands of sprites), whilst it will be OK that time with smooth FPS, you can sometimes close the game and the game has an exit fault (appcrash).
Subsequent running the game again gives very stuttery and torn screen update which can't be fixed unless you either reboot machine or flush out video card e.g. change desktop resolution a couple of times.
Game works properly again one more time, then back to stutter / screen tear after exit (and appcrash).
I added a proper quit function for clean exit which includes deleteallsprites() and deleteallimages() and problem appears to have gone when I do this.
Is there any way to expose some commands for initialising video memory or flushing GPU ? Perhaps
I am testing on an i3 laptop which has plenty of CPU for the job, but the GPU is intel(HD) graphics with "only" 512Kb memory. Would be nice to pin down what causes the behaviour as I can't really only specify high spec graphics cards for relatively simple 2D games.
There must be something not right with the auto-cleanup / deallocation of sprites of other things sent to the GPU. In some tests I did, it seemed to be around the 8192 sprites count (not necessarily drawn sprites either - I think I was only drawing about 300-400 sprites at the time).