There is this site...
... where they explain how to draw an antialiased line.
Exactly what I want!
but...
I don't understand how to achieve that for a simple line. I have found the online version of the book (the article is kind of derived from the book), i have downloaded the sample code (showing a stick figure doing fancy moves), but there is so much mambojambo going on... some strange python script... circles as png-images and as header files, almost everything is written in cpp, files i copy to my project produce lots of errors that i can't resolve properly and so on and so on. And I think I don't need all of that fancy stuff, since I only want to draw lines in a simple cocos2d based app [Btw.... I didn't want to use AA, but my lines are thicker than 5px which makes them have ugly holes when connected (f.e. in a circle made of several lines) so that I must use AA as it seems].
So does someone have or found a tiny little piece of runnable sample code using the principle explained in the linked article ?
Notes:
In the picture you see the holes:
Here you will find the code of the mentioned stickman (AA Lines): http://examples.oreilly.com/9780596804831/readme.html#AaLines
This is how I draw my circles:
int segments = 80; CGFloat width = 100; CGFloat height = 100; CGPoint center = ccp(800,200); glDisable(GL_TEXTURE_2D); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_COLOR_ARRAY); //glEnable(GL_LINE_SMOOTH); // doesn't work on device glTranslatef(center.x, center.y, 0.0); glLineWidth(3.0f); GLfloat vertices[segments*2]; int count=0; for (GLfloat i = 0; i < 360.0f; i+=(360.0f/segments)) { vertices[count++] = (cos(degreesToRadian(i))*width); vertices[count++] = (sin(degreesToRadian(i))*height); } glVertexPointer (2, GL_FLOAT , 0, vertices); glDrawArrays (GL_LINE_LOOP, 0, segments); glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_2D);