views:

45

answers:

1

Hi,

I registered a CALLBACK using:

gluTessCallback(tess, GLU_TESS_COMBINE, (GLvoid(*)()) &scbCombine);

Where scbCombine is a function directly in the same .cpp file:

void CALLBACK scbCombine(const double newVertex[3], const double *neighborVertex[4], const float neighborWeight[4], double **outData)
{
    instanceMDC->cbCombine(newVertex, neighborVertex, neighborWeight, outData);
    printf("scbCombine \n");
}

And when I use test it, "scbCombine \n" is printed in the console!!! And then after calling the CALLBACK function, the tesselator invokes the error callback with the message: "need combine callback" (!!)

I have already two other tesselators in my app, and they work correct. But the last one don't. I compared the code of this one as much as possible with the code of the other one. But I can't see why it doesn't work.

The cbCombine method (without "s" at the beginning) is this:

void MyClass::cbCombine(const double newVertex[3], const double *neighborVertex[4], const float neighborWeight[4], double **outData)
{
    outData = 0;
}

But the setting outData to zero can't be the problem: I did this already with one of the other tesselators...

I'm getting crazy... I have spent already hours to this issue

Thanks

A: 

The problem was the zero, I had to do this:

*outData = new double; // memory-leak, but not as I did it really.
Martijn Courteaux