Iphone 元素问题
这将以红色显示:Iphone 元素问题,iphone,opengl-es,Iphone,Opengl Es,这将以红色显示: VertexColorSet(&colors[vertexCounter], 1.0f, 0.0f, 0.0f, 1.0f); 这将显示黑色: VertexColorSet(&colors[vertexCounter], 0.9f, 0.0f, 0.0f, 1.0f); 为什么它是黑色的?它不应该只是一个较深的红色阴影吗 glEnableClientState(GL_COLOR_ARRAY); glColor4f(1.0f, 1.0f, 1.0f,
VertexColorSet(&colors[vertexCounter], 1.0f, 0.0f, 0.0f, 1.0f);
这将显示黑色:
VertexColorSet(&colors[vertexCounter], 0.9f, 0.0f, 0.0f, 1.0f);
为什么它是黑色的?它不应该只是一个较深的红色阴影吗
glEnableClientState(GL_COLOR_ARRAY);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glVertexPointer(2, GL_FLOAT, 0, vertexes);
glColorPointer(4, GL_FLOAT, 0, colors);
glDrawElements(GL_TRIANGLES, 3*indexesPerButton*totalButtons, GL_UNSIGNED_SHORT, indexes);
//glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glDisableClientState(GL_COLOR_ARRAY);
是的,它是黑色的,因为我用了int而不是float谢谢,我试过了,但你得等几天才能接受答案。