Imagination PowerVR SDK Blog

Same code diffrent shows between 1.0 and 1.1


#1
I use the follow code, but this code got a blue square in the opengles1.0,but got black square in

the 1.1 , how could this happen?

 

 

glEnable(GL_COLOR_MATERIAL);
 static GLubyte indicestext[]={0,1,2,1,3,2};
 VERTTYPE pfVerticestext[]= {f2vt(-.5f),f2vt(-.5f),f2vt(0),
  f2vt(+.5f),f2vt(-.5f),f2vt(0),
  f2vt(-.5),f2vt(.5f),f2vt(0),
  f2vt(+.5),f2vt(.5f),f2vt(0)};

 glEnableClientState(GL_VERTEX_ARRAY);
 glVertexPointer(3, VERTTYPEENUM, 0 ,pfVerticestext);


 glDisableClientState(GL_COLOR_ARRAY);
 glColor4x(0,0,65535,65535);


 VERTTYPE LightAmbient[]={0,0,65535,65535};
 
 glLightxv(GL_LIGHT7, GL_AMBIENT, LightAmbient);
 glEnable(GL_LIGHT7);
 glEnable(GL_LIGHTING);
 glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indicestext);


#2

Calling glEnable(GL_COLOR_MATERIAL) anywhere does not seem to work.