开发者

issue with glDrawElements

开发者 https://www.devze.com 2022-12-12 05:25 出处:网络
this shows up with the color red: VertexColorSet(&colors[vertexCounter], 1.0f, 0.0f, 0.0f, 1.0f); this shows the color black:

this shows up with the color red:

VertexColorSet(&colors[vertexCounter], 1.0f, 0.0f, 0.0f, 1.0f);

this shows the color black:

VertexColorSet(&colors[vertexCounter], 0.9f, 0.0f, 0.0f, 1.0f);

why is it the color black shouldn't it just be a darker shade of red?

    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);
glDrawE开发者_JS百科lements(GL_TRIANGLES, 3*indexesPerButton*totalButtons, GL_UNSIGNED_SHORT, indexes);

//glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    glDisableClientState(GL_COLOR_ARRAY);


and yes it is black because i used an int instead of a float

0

精彩评论

暂无评论...
验证码 换一张
取 消