mik*_*ney 5 opengl xcode osx-snow-leopard
为什么这只画黑色?
glPushMatrix();
// Check the current color
glColor3i(255, 0, 255);
GLint currentColor[4];
glGetIntegerv(GL_CURRENT_COLOR, currentColor);
//currentColor[0] = 254, 1 = 0, 2 = 254, 3 = doesn't matter
glBegin(GL_QUADS);
glLineWidth(1);
glVertex2f(0, 0);
glVertex2f(WINDOW_WIDTH * .1, 0);
glVertex2f(WINDOW_WIDTH * .1, WINDOW_HEIGHT);
glVertex2f(0, WINDOW_HEIGHT);
glEnd();
glPopMatrix();
Run Code Online (Sandbox Code Playgroud)
mik*_*era 14
从内存来看,我认为glColor3i使用缩放的颜色值来覆盖整个整数范围.因此你的255个值大约等于零......
请改为尝试2147483647.
| 归档时间: |
|
| 查看次数: |
4546 次 |
| 最近记录: |