Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

edwinnie

glPixelMap & glPixelTransfer

This topic is 5217 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

hihi i was playing around with those 2 functions but cant seem to get them to work...
GLuint maskvalues[256];
GLubyte pixels[10][10][4];

for(int i=0; i<128; i++)
  maskvalues[i] = 255;
for(int i=128; i<256; i++)
  maskvalues[i] = 0;

for(int i=0; i<10; i++)
{
  for(int j=0; j<10; j++)
  {
    pixels[i][j][0] = 255;
    pixels[i][j][1] = 255;
    pixels[i][j][2] = 255;
    pixels[i][j][3] = 255;
  }
}

glPixelTransferi(GL_MAP_COLOR, true);
glPixelMapuiv(GL_PIXEL_MAP_B_TO_B, 256, maskvalues);

glRasterPos2i(100,100);
glDrawPixels(10, 10, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
thx! Edwinz

Share this post


Link to post
Share on other sites
Advertisement

  • 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!