SDL surface 'culling'

Started by
2 comments, last by Genjix 19 years, 3 months ago
is it worth culling offscreen surfaces inside 'Draw' functions or does SDL do that for you?
Advertisement
It does it for you with the default clipping rectangle.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
From what I remember, it does do the culling/clipping for you. Obviously if you can easily reject a group of blit operations beforehand, then do it. I don't think it's worth checking on a per-blit level however since SDL presumably has reasonably optimised methods for doing just that (or even ignoring it on hardware where it doesn't matter... should such a beast exist).

(Aside: if you want to bypass that, I believe you can call SDL_LowerBlit directly. That might give you a 1% performance increase if you're lucky, and only if you can be confident that everything is definitely within screen boundaries.)

ok, Thanks.

This topic is closed to new replies.

Advertisement