티스토리 뷰

my Programing/iPhone

drawSolidPoly

Gandawon 2010. 1. 27. 13:36
  
void drawSolidPoly( CGPoint *poli, int points, BOOL closePolygon )
{
	glVertexPointer(2, GL_FLOAT, 0, poli);
	glEnableClientState(GL_VERTEX_ARRAY);
	glDrawArrays(GL_TRIANGLE_FAN , 0, points);
	glDisableClientState(GL_VERTEX_ARRAY);
}


Primitive Flag       Description
GL_POINTS            A point is placed at each vertex.
GL_LINES             A line is drawn for every pair of vertices that are given.
GL_LINE_STRIP        A continuous set of lines are drawn. After the first
                     vertex, a line is drawn between every successive vertex
                     and the vertex before it.
GL_LINE_LOOP         This is the same as GL_LINE_STRIP except that the start and end
                     vertices are connected as well.
GL_TRIANGLES         For every triplet of vertices, a triangle is drawn with corners
                     specified by the coordinates of the vertices.
                     It begins with v0,v1,v2 then v3,v4,v5 and so on.
GL_TRIANGLE_STRIP    After the first 2 vertices, every successive vertex uses the
                     previous 2 vertices to draw a triangle.
                     It begins with v0,v1,v2 then v1,v2,v3 then v2,v3,v4 and so on.
GL_TRIANGLE_FAN      After the first 2 vertices, every successive vertex uses the
                     previous vertex and the first vertex to draw a triangle.
                     This is used to draw cone-like shapes
                     It begins with v0,v1,v2 then v0,v2,v3 then v0,v3,v4 and so on.
GL_QUADS             Draws a series of quadrilaterals (four sided polygons)
                     beginning with v0,v1,v2,v3 then v4,v5,v6,v7 and so on
GL_QUAD_STRIP        Does a series of quadrilaterals beginning with
                     v0,v1,v3,v2 then v2,v3,v5,v4 then v4,v5,v7,v6 and so on
GL_POLYGON           Draws a polygon using the points v0,v1,...,vn
                     as vertices. n must be at least 3, or nothing is drawn.



'my Programing > iPhone' 카테고리의 다른 글

iPhone SDK 구버젼 받기 ...  (0) 2010.07.03
peakPowerForChannel  (0) 2010.01.28
UIAcceleration  (0) 2010.01.20
아이폰에 어플 올리기!! 성공!  (0) 2010.01.20
아이폰 개발자 등록없이 앱 올리기 ...펌  (0) 2010.01.18
댓글