/Users/riq/progs/cocos2d-iphone/branches/branch-0.7/cocos2d/Primitives.h File Reference

#import <CoreGraphics/CGGeometry.h>
#import <objc/objc.h>

Include dependency graph for Primitives.h:


Functions

void drawPointDeprecated (float x, float y) __attribute__((deprecated))
void drawPoint (CGPoint point)
void drawPoints (CGPoint *points, unsigned int numberOfPoints)
void drawLineDeprecated (float x1, float y1, float x2, float y2) __attribute__((deprecated))
void drawLine (CGPoint origin, CGPoint destination)
void drawPolyDeprecated (float *poli, int points) __attribute__((deprecated))
void drawPoly (CGPoint *vertices, int numOfVertices, BOOL closePolygon)
void drawCircleDeprecated (float x, float y, float radius, float angle, int segs) __attribute__((deprecated))
void drawCircle (CGPoint center, float radius, float angle, int segments, BOOL drawLineToCenter)

Detailed Description

Drawing OpenGL ES primitives.

You can change the color, width and other property by calling the glColor4ub(), glLineWitdh(), glPointSize().

Warning:
These functions draws the Line, Point, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch.

Function Documentation

void drawCircle ( CGPoint  center,
float  radius,
float  angle,
int  segments,
BOOL  drawLineToCenter 
)

draws a circle given the center, radius and number of segments.

void drawCircleDeprecated ( float  x,
float  y,
float  radius,
float  angle,
int  segs 
)

draws a circle given the center, radius and number of segments.

Deprecated:
Use drawCircle() instead. Will be removed in v0.8

void drawLine ( CGPoint  origin,
CGPoint  destination 
)

draws a line given the origin and destination point

void drawLineDeprecated ( float  x1,
float  y1,
float  x2,
float  y2 
)

draws a line given x1,y1 and x2,y2 coordinates

Deprecated:
Use drawLine() instead. Will be removed in v0.8

void drawPoint ( CGPoint  point  ) 

draws a point given x and y coordinate

void drawPointDeprecated ( float  x,
float  y 
)

draws a point given point.

Deprecated:
Use drawPoint() instead. Will be removed in v0.8

void drawPoints ( CGPoint *  points,
unsigned int  numberOfPoints 
)

draws an array of points.

Since:
v0.7.2

void drawPoly ( CGPoint *  vertices,
int  numOfVertices,
BOOL  closePolygon 
)

draws a poligon given a pointer to CGPoint coordiantes and the number of vertices. The polygon can be closed or open

void drawPolyDeprecated ( float *  poli,
int  points 
)

draws a poligon given a pointer to float coordiantes and the number of vertices

Deprecated:
Use drawPoly(vertices, numOfVertices, open) instead


Generated on Tue Jun 9 10:39:27 2009 for cocos2d for iPhone 0.7.3 by  doxygen 1.5.8