I am trying to read the RGB value of a screen pixel doing:
#include "stdafx.h"
#include<windows.h>
#include<stdio.h>
#include <gl\GL.h>
int main(int argc, char** argv)
{
GLubyte color[3];
glReadPixels(800, 800, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &color);
printf("R:%d G:%d B:%d", color[0], color[1], color[2]);
while (1);
}
But it doesn't matter which coordinates I ask for. It always returns me R:204 G:204 B:204
What am I doing wrong?