glReadPixels在我画一个点时没有更新。glReadPixels没有更新值
glColor3f(1.0f, 0.0f, 0.0f);
glBegin(GL_POINTS);
glVertex2f(x,y);
glEnd();
glReadPixels(x, y, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, pixel);
printf("after coloring %d %d %d\n", (int)pixel[0], (int)pixel[1] , (int)pixel[2]);
的pixel[0]
,pixel[1]
和pixel[2]
的值出来为零,其中作为期望值是255, 0, 0
。帮我解决此问题:)
您能否显示像素的类型? – lnman
像素应该是咬的类型你确定你的声明中有正确的类型吗? –
你确定你的'x,y'对应屏幕'(0,0)'?记住变换矩阵......屏幕左上角是图像原点,那么您的点在那里呈现? – Spektre