2

I am trying to compile my project after switching to cocos2d 2.0.3 and I keep getting this error. (Use of undeclared identifier 'glColor4f') Is there something else that I should use instead of this method.

glColor4f(1.0f,1.0f,1.0f,1.0f);
Stephen
  • 499
  • 9
  • 28

3 Answers3

2

You can use ccDrawColor4F as a replacement.

ccDrawColor4F(1.0f, 1.0f, 1.0f, 1.0f);
Ben Trengrove
  • 8,191
  • 3
  • 40
  • 58
0

As far as I know, cocos2d 2.0 uses OpenGL ES 2.0, that does not have such function. You can use glColorPointer instead.

Morion
  • 10,495
  • 1
  • 24
  • 33
  • `glColorPointer` doesn't exist in OpenGLES2.0 either. You probably mean `glVertexAttribPointer`. – Tim Sep 10 '12 at 19:08
0
DrawPrimitives::setDrawColor4F(r, g, b, a);
Joseph
  • 1,458
  • 15
  • 20