我是OpenGLES的新手,想画一个点,但没有结果,这是我的draw方法
-(void) draw
{
[super draw];
if(!isBackgroundInited)
{
glDisable(GL_TEXTURE_2D);
glEnable(GL_POINTS);
ccDrawColor4B(100,100,100,255);
ccPointSize(2);
[self drawDots];
isBackgroundInited=YES;
glDisable(GL_POINTS);
glEnable(GL_TEXTURE_2D);
}
}
-(void) drawDots
{
CGSize activeArea=CGSizeMake(winSize.width-2*margin, winSize.height-2*margin);
float xMargin=activeArea.width/dotsCount;
float yMargin=activeArea.height/dotsCount;
float yPosition=margin;
for(int i =0;i<10;i++)
{
float xPosition=margin;
for (int j=0;j<10;j++)
{
ccDrawPoint(CGPointMake(xPosition, yPosition));
xPosition+=xMargin;
}
yPosition+=yMargin;
}
}