Hi. I´m trying to create some examples of glReadPixels and glCopyPixels but I´m having some problems.
After rendering a scene I use glReadPixels to read a section of the screen and then I pass that pointer to glDrawPixels so I can draw it in a new rastre location. The thing is that it only draws a black square with two gray lines. Also glCopyPixels does´t draw any thing when I try to use it.
I don´t know if it is some driver problem or what am I doing wrong.
Here are the functions:
int w = 127;
int h = 85;
GLubyte* pixels = new GLubyte[w * h * 3]);
glReadPixels(-5, -5, w, h, GL_RGB, GL_UNSIGNED_BYTE, pixels);
glDrawPixels(w, h, GL_RGB, GL_UNSIGNED_BYTE, pixels);
glCopyPixels(-5, -5, 127, 85, GL_COLOR);