Clipping is Cool

Clipping lines
The age old problem of clipping lines is addressed in this article. I first present pixel clipping theory and support routines for the GraphPro library, and then move on into line clipping territory. The Cohen-Sutherland algorithm is used to clip lines.

Transparent Clipping
Some of this clipping stuff is useful, but having to use an extra "C" with each command is irritating. Wouldn't it be nice if we could just turn off or turn on clipping, and use the same calls to draw with and without clipping?

Clipping Rectangular Sprites
The biggest problem with the routines developed in the previous article is the fact that you can't clip them to a region. Because of this, they are practically useless for games. When a sprite goes near the right edge of the screen, it will wrap around to the left side of the screen. If you have a border around your screen, it will destroy your border. Because this is not good, here we will address the issue of clipping sprites.

Clipping RLE Sprites
Here, we attack the interesting problem of clipping RLE sprites. It turns out that it isn't as big of a problem as it originally seems. Clipping RLE sprites doesn't have to take a lot of time, but we can make some optimizations by changing our structures slightly.