Page 1 of 1

CGapiSurface::DrawLine doesn't clip?

PostPosted: May 25, 2003 @ 6:50am
by mlepage
I wanted to use DrawLine to draw lines between vertices in my simple polygons. However, the polygons may be partly offscreen.

I thought that they would just clip off screen. However, I find that if either end point of the line is off screen, the line does not draw at all.

How can I get clipping behaviour?

Clipping a Line

PostPosted: May 25, 2003 @ 7:07am
by mlepage
Don't worry, I know how to clip a line like I want, I have the Foley graphics book right beside me.

I just want to know if the library provides this functionality before I write my own line drawing functions that clip.

PostPosted: May 26, 2003 @ 9:27am
by Johan
Hi,

GapiDraw does not clip anything. You have to this manually. This is by design and will not change in future versions of the library.

Cohen-Sutherland Clipping Algorithm

PostPosted: May 26, 2003 @ 6:51pm
by mlepage