Going off the sides is okay (wraparound). The problem is when you cross the mapped file boundary at the beginning or end of the framebuffer. You can go off the bottom a little (about 5 pixels down) because mapping is rounded up to the next 4K boundary. It is easy to do the clipping at the "set pixel" level, but faster to clip the line endpoints.
|