JeffJ
Member
Creating a sprite from a surface using sprite_create_from_surface can potentially be slow, depending on the size of the surface and the hardware being utilized, creating a noticeable stall.
I was thinking if it would be feasible to make a sort of async version of sprite_create_from_surface, perhaps using buffers to read the surface in bits at a time, and likewise, create the sprite in the same fashion?
Alternatively you could do the operation on another thread, but to my knowledge that isn't something GMS2 offers any support for.
The idea is simply to let the function take its time in the background (however long needed) and, in turn, avoid the stall / freeze. But I've very little experience with buffers, so I'm not even sure if this would be something you could accomplish with those - both the reading of the surface and the creation of the sprite from that content.
Any thoughts?
I was thinking if it would be feasible to make a sort of async version of sprite_create_from_surface, perhaps using buffers to read the surface in bits at a time, and likewise, create the sprite in the same fashion?
Alternatively you could do the operation on another thread, but to my knowledge that isn't something GMS2 offers any support for.
The idea is simply to let the function take its time in the background (however long needed) and, in turn, avoid the stall / freeze. But I've very little experience with buffers, so I'm not even sure if this would be something you could accomplish with those - both the reading of the surface and the creation of the sprite from that content.
Any thoughts?