SDL_UpdateRects optimization

Does SDL_UpdateRects optimize the rects before it updates them?
i.e. in 10,10,100,100 and 50,50,80,80 does it recognize that the second blit
is superfluous?
(superfluous - what a cool word. latin classes were useful after all :slight_smile:

If not, why not call many small [SDL_UpdateRect]s instead of one large
[SDL_UpdateRects]?

Does SDL_UpdateRects optimize the rects before it updates them?
i.e. in 10,10,100,100 and 50,50,80,80 does it recognize that the second blit
is superfluous?

no you have to do it yourself

If not, why not call many small [SDL_UpdateRect]s instead of one large
[SDL_UpdateRects]?

because there’s a cost both for each rectangle and for overdraw.
basically each SDL_UpdateRects() costs

A + B * nrects + sum(i=0…nrects-1: rect[i].h * (C + rect[i].w * D))

where A, B, C, D are constants that depend on your machine