Antonio Gonzalez
12-16-2010, 12:57 PM
Hey, So I coded some Methods and now I want to save the Image I made in a bin file.
How do I do it?
I mean, I'm thinking that I can declare something like:
FILE *fav;
int screen[640 * 480];
And then with that have a click of the mouse do:
glReadPixels(0,0,winWidth,winHeight,GL_RGB,GL_UNSI GNED_BYTE,screen);
sav=fopen("c:\\test.bin", "w+b");
fwrite(screen, sizeof(screen), sizeof(screen)/1, sav);
fclose(sav);
would that work? Or do I have to read every pixel in the screen?
What are my options?
I'm probably overlooking something big, but I'm out of practice. =p
Thanks in advance.
How do I do it?
I mean, I'm thinking that I can declare something like:
FILE *fav;
int screen[640 * 480];
And then with that have a click of the mouse do:
glReadPixels(0,0,winWidth,winHeight,GL_RGB,GL_UNSI GNED_BYTE,screen);
sav=fopen("c:\\test.bin", "w+b");
fwrite(screen, sizeof(screen), sizeof(screen)/1, sav);
fclose(sav);
would that work? Or do I have to read every pixel in the screen?
What are my options?
I'm probably overlooking something big, but I'm out of practice. =p
Thanks in advance.