Ok, sorry, i didn't see the difference between GLUtessellatorCallbackAdapter and GLUtessellatorCallback !
Now i'm using GLUtessellatorCallbackAdapter :
private GLUtessellatorCallbackAdapter tesscallback = new GLUtessellatorCallbackAdapter(){
@Override
public void begin(int type) {
GL11.glBegin(type);
}
@Override
public void vertex(Object vertexData) {
double[] vert = (double[]) vertexData;
GL11.glVertex3d(vert[0], vert[1],vert[2]);
}
public void combine(double[] coords, Object[] data, float[] weight, Object[] outData) {
for (int i = 0; i < outData.length; i++) {
double[] combined = new double[6];
combined[0] = (double) coords[0];
combined[1] = (double) coords[1];
combined[2] = (double) coords[2];
outData[i] = combined;
}
}
@Override
public void end() {
GL11.glEnd();
}
public void error(int errnum) {
String estring;
estring = GLU.gluErrorString(errnum);
System.err.println("Tessellation Error Number: " + errnum);
System.err.println("Tessellation Error: " + estring);
}
};
I got now the same errors.
But if I use the function tesselator.gluNextContour(GLU.GLU_EXTERIOR);, I don't get any errors.
tesselator.gluBeginPolygon();
for(List<double[]> poligons_list:vertex){
tesselator.gluNextContour(GLU.GLU_EXTERIOR);
//tesselator.gluTessBeginContour();
for(double[] vertex_list:poligons_list){
tesselator.gluTessVertex(vertex_list, 0, vertex_list);
}
//tesselator.gluTessEndContour();
}
tesselator.gluEndPolygon();
I don't understand why I can't use : tesselator.gluTessBeginContour(); and tesselator.gluTessEndContour(); ?