tags:

views:

68

answers:

2

I'm making a vector drawing application with OpenGL. Is there a way to implement a clipping mask? Ex: if I have Circle A and Circle B, I only want to see the part of circle B which intersects into Circle A's space. Is there a way to do this that isn't very expensif, I do not want to kill my application. Thanks

A: 

Jex,

A quick google search for "clipping mask in openGL" had this as the first result.

Hamy
What about blend function?
Milo
Blending is a different operation, but maybe you could find a blending operator and right set of colors to achieve same effect. However, it restricts your possibilities. Stencil buffer is the correct, established way to solve your problem.
ypnos
+2  A: 

One possibility would be to draw Circle A into the stencil buffer, then draw Circle B.

Jerry Coffin