Jump to content
  • Advertisement
Sign in to follow this  
Jimmy Valavanis

glDrawPixels() problem

This topic is 3896 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!