is there any way to copy a SDL surface to another, like creating a backup copy, without modifying the original when the copy is modified? *surface = *original_surface dosnt work. SDL_Surface does not have any constructors, so i cant do anything like surface = new SDL_Surface (original_surface). currently, i am opening the original image constantly, but it takes longer to open the image than for one loop to finish. this causes a lot of lagging, and eventually errors, causing my program to end
is there any way to copy a SDL surface to another, like creating a
Share
You can create a new compatible surface:
And then blit the original into the copy: