thanks d_stranz :-) I've been very helpful.
Also for tesselation, I have another piece of code that I found in a project called Stage (player-stage, gazebo), in which we have:
#define FOR_EACH(I,C) for(VAR(I, (C).begin()), ite = (C).end(); (I) != ite; ++(I))
...
gluTessBeginPolygon(tobj, NULL);
FOR_EACH( contour, contours )
{
gluTessBeginContour(tobj);
for( size_t v = 0; v < contour->size(); v += 3 )
gluTessVertex(tobj, &(*contour)[v], &(*contour)[v]);
gluTessEndContour(tobj);
}
//GG-d: start
if (DEBUG)
printf("\nGG-d (1) BlockGroup::BuildDisplayList()\n");
//GG: end
gluTessEndPolygon(tobj);
...
#define FOR_EACH(I,C) for(VAR(I, (C).begin()), ite = (C).end(); (I) != ite; ++(I))
...
gluTessBeginPolygon(tobj, NULL);
FOR_EACH( contour, contours )
{
gluTessBeginContour(tobj);
for( size_t v = 0; v < contour->size(); v += 3 )
gluTessVertex(tobj, &(*contour)[v], &(*contour)[v]);
gluTessEndContour(tobj);
}
//GG-d: start
if (DEBUG)
printf("\nGG-d (1) BlockGroup::BuildDisplayList()\n");
//GG: end
gluTessEndPolygon(tobj);
...
To copy to clipboard, switch view to plain text mode
when it comes to perform "gluTessEndPolygon(tobj);" I have a segmentation fault error.
I tried to debug as you did in the previous example, but it seems perfectly proper, not exceeding in size any variable.
Do you think there is some error in the code that I have reported. If you can help put attached the whole project (always done with QtCreator and MinGW)... I'm literally going crazy
Bookmarks