Skip to main content
GameDev.net gamedev.net
🔒 Locked

glReadPixels

Started by dasan11 Jun 6, 2006 at 8:53 PM 2 replies 1k views
Original Post
dasan11
dasan11
I first use glReadPixels to read the pixels into the memory. Then I use glDrawPixels to draw the pixels on the screen. But I find the color of the picture is just white and black. why? glColor3f(1.0,0.0,0.0);//////////red glBegin();//////////////draw the graphics glVertex3f(); ... glEnd(); glReadPixels(); glDrawPixels(); glSwapBuffers();
Kalidor
Kalidor
Quote:
Original post by dasan11
I first use glReadPixels to read the pixels into the memory.
Then I use glDrawPixels to draw the pixels on the screen.
But I find the color of the picture is just white and black.
why?

glColor3f(1.0,0.0,0.0);//////////red
glBegin();//////////////draw the graphics
glVertex3f();
...
glEnd();
glReadPixels();
glDrawPixels();
glSwapBuffers();
Because you're using weird functions that take no parameters. Post your actual code (including parameters) and we might be able to see what's wrong.
DIB
DIB
You may not have correctly set your pixel transfer mode for either the capture of the buffer or the display of the buffer. Just a thought.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.