- (void) draw{
// draw a simple line
// The default state is:
// Line Width: 1
// color: 255,255,255,255 (white, non-transparent)
// Aliased
ccDrawLine(
// line: color, width, anti-aliased
glLineWidth(
glEnable(GL_LINE_SMOOTH);
glColor4ub(255,0,0,255);
ccDrawLine(
// TIP:
// Since nobody disabled GL_LINE_SMOOTH,
// it will be valid until somone disabled it.
// The followin examples will be drawn using anti-aliasing.
//
// Remember: OpenGL is a state-machine.
// draw big point in the center
glPointSize(64);
glColor4ub(0,0,255,128);
ccDrawPoint(
// draw 4 small points
CGPoint
glPointSize(4);
glColor4ub(0,255,255,255);
ccDrawPoints( points,
// draw a green circle with 10 segments
glLineWidth(16);
glColor4ub(0,
ccDrawCircle(
// draw a green circle with 50 segments with line to center
glLineWidth(2);
glColor4ub(0,
ccDrawCircle(
// open yellow poly
glColor4ub(255,
glLineWidth(10);
CGPoint
ccDrawPoly( vertices,
// closed purble poly
glColor4ub(255,
glLineWidth(2);
CGPoint
ccDrawPoly( vertices2,
// restore original values
glLineWidth(1);
glDisable(GL_LINE_SMOOTH);
glColor4ub(255,255,255,255);
glPointSize(1);
}