write a opengl frame into a PPM using glReadPixels function

Posted by small_potato on Stack Overflow See other posts from Stack Overflow or by small_potato
Published on 2010-03-29T02:09:06Z Indexed on 2010/03/29 2:13 UTC
Read the original article Hit count: 523

Filed under:
|

I am using to use following code to write a frame in opengl to a PPM file:

GLubyte buffer[window_width][window_height][3];
glReadPixels(0, 0, window_width, window_height, GL_RGB, GL_UNSIGNED_BYTE, buffer);

My question is how can I convert Glubyte into unsigned char say unsigned char* c?

© Stack Overflow or respective owner

Related posts about c++

Related posts about glut