Sign in to follow this  

glDrawPixels() problem

This topic is 3594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a little problem with glDrawPixels function. I store in an array of unsigned int (called screen32) an image in RGBA format that I want to display to full screen (with black color as transparent index). I use the following code: glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0,SCREENWIDTH-1,0.0,SCREENHEIGHT-1,-1.0,1.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glViewport(0,0,200,200); glClearColor(0.5, 0.0, 0.0, 1.0); // Red to test transparency glRasterPos2i(0, 0); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_NOTEQUAL, 0); glDrawPixels(SCREENWIDTH, SCREENHEIGHT, GL_RGBA, GL_BYTE, screen32); glFlush; SwapBuffers(h_DC); // Display the scene Unfortunatelly nothing happens, just the background gets red (bacause of calling glClearColor(0.5, 0.0, 0.0, 1.0) to test transparency). Any ideas?

Share this post


Link to post
Share on other sites

This topic is 3594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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