How to do intersection of 2 contours?

Hi, I would like to get the vertices of the intersection of 2 contours. Which I believe is a computational geometry problem. I have been reading about gluTessCallback() which seems to be able to do exactly what I want (even though I don’t understand how winding numbers get assigned for more complicated cases). Anyway when I started writing the code it seems it’s using __stdcall calling convention and I’m using __cdecl.

I haven’t been able to find code on how to get the thing working. And when searching I read that glu’s implementation is quite outdated.

So what do people use these days? Is glu tesselation still usable today? Any libraries you can recommend? Any simple papers that solve this problem?

Thanks.

I just finished a project using GLU to do almost exactly that.

Do you run the examples that come from the “Red Book”? (AKA OpenGL Programming Guide?)

I was using an example that comes from:
http://www.glprogramming.com/red/chapter11.html
And other tutorials on the subject seem to be using the exact same code. As I mentioned the problem is GLU code seems to specify __stdcall calling convention, and I can’t change my whole program to use that convention just because of a few functions.

I stumbled on someone else’s code that works around the error I mentioned by casting the function pointers using:
(void (__stdcall*)(void))
So I seem to have solved my problem.

Overall this seems like a very clumsy interface. The function pointer casting to void * (void) doesn’t fill me with confidense. Anyone have any comments on GLU Tesselation? Does it work well? Is this what people generally use to render concave polygons and solving other problems?

You should not have this problem if you are basing it on recent Red book examples - That link is very old. You are supposto to do this:

void CALLBACK BeginCallback(GLenum type)

Note the “CALLBACK” parameter on the function definition. (on windows this resolves to __stdcall)