Page 1 of 1

What is the advantage of using SetClipper function?

PostPosted: Jul 10, 2006 @ 2:34am
by elevenseventeen
Does SetClipper() function make drawing theoretically faster? For example, since Gapi would no longer need to draw bitmaps, etc that are outside the clipper rect, does this result in a speed improvement overall. If not, what is the reason of SetClipper()? Just trying to understand its purpose.

Thank you!

PostPosted: Jul 11, 2006 @ 6:41am
by InexorableTash
If you don't use SetClipper and try to draw outside of the surface boundaries you'll get an error and nothing will be drawn. With SetClipper the parts inside the clipping region will be drawn and you won't get an error.

Having clipping regions be optional appears to be mostly historical; GapiDraw didn't initially have them. If you're doing your own clipping or precise rendering logic it can be instructive to have failures rather than silent mis-behavior of code during development.

Being able to change clipping regions is really cool, though - consider rendering within a "frame" that's smaller than the surface itself.