PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

What is the advantage of using SetClipper function?

elevenseventeen · 10 Jul 2006, 01:34 UTC
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!
InexorableTash · 11 Jul 2006, 05:41 UTC
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.