Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. GLuint *image; //...read in image from file
  2. glPixelStorei(GL_UNPACK_SWAP_BYTES,GL_TRUE);
  3.  
  4. //using GLubyte and scaling to GL_UNSIGNED_BYTE
  5. GLubyte * imageScaled = new GLubyte[512*512*3];
  6. gluScaleImage(GL_RGB, col, row, GL_UNSIGNED_INT, image, 512, 512, GL_UNSIGNED_BYTE, imageScaled);
  7. glDrawPixels(512, 512, GL_RGB, GL_UNSIGNED_BYTE, imageScaled);
  8.  
  9. GLuint *image;//...read in image from file
  10. glPixelStorei(GL_UNPACK_SWAP_BYTES,GL_TRUE);
  11.  
  12. //using GLuint and scaling to GL_UNSIGNED_INT
  13. GLuint * imageScaled = new GLuint[512*512*3];
  14. gluScaleImage(GL_RGB, col, row, GL_UNSIGNED_INT, image, 512, 512, GL_UNSIGNED_INT, imageScaled);
  15. glDrawPixels(512, 512,GL_RGB, GL_UNSIGNED_INT, imageScaled);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement