我正在尝试摆脱代码中的警告,但我被困在这两个上。对于我得到的这部分代码labelWithString:dimensions:alignment:fontName
已弃用
CCLabelTTF *label1 = [CCLabelTTF labelWithString:[NSString stringWithFormat:@"%d",(count+1)] dimensions:CGSizeMake(30,40) alignment:UITextAlignmentRight fontName:@"Arial" fontSize:14];
当我调用这个函数时,在另一段代码中:
glVertexPointer(2, GL_FLOAT, 0, vertices);
我得到函数'glVertexPointer'的隐式声明在c99中无效。
任何人都可以帮忙吗?
到目前为止,这是我包含 glVertexPointer 的代码:ccDrawColor4F(0.0f, 0.0f, 0.0f, 0.2f);
float w = 320.0f;
float h = 27.0f;
float x = (320.0f - w) / 2.0f;
float y = 359.0f - currentScorePosition * h;
GLfloat vertices[4][2];
GLubyte indices[4] = { 0, 1, 3, 2 };
vertices[0][0] = x; vertices[0][1] = y;
vertices[1][0] = x+w; vertices[1][1] = y;
vertices[2][0] = x+w; vertices[2][1] = y+h;
vertices[3][0] = x; vertices[3][1] = y+h;
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position );
kmGLPushMatrix();
glVertexPointer(2, GL_FLOAT, 0, vertices);
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, indices);
kmGLPopMatrix();
ccDrawColor4F(1.0f, 1.0f, 1.0f, 1.0f);