Sign in to follow this  
dasan11

glReadPixels

Recommended Posts

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();

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this