[SDL] SDL_UpdatesRects - how to use it right

Nathaniel J Fries nfries88 at yahoo.com
Fri Mar 15 17:12:23 PDT 2013

Pixel-level collision detection might be less simple in SDL 2.0; but aside for that it should be a fairly straightforward switch.

However, my recommendation with regards to optimizing SDL_UpdateRects would be to check for intersections with other rects each time you add a rect to be updated; and then replace that rect with the union of the two rects. Some extra pixels might get updated, but far less than the union of all the rects.

Nate Fries

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130315/ceb9b1cd/attachment-0009.htm>

More information about the SDL mailing list