eso, como logro hacer eso, si alguien tiene un link con algun tut o algun demo con codigo que lo haga le rogaria postearlo
de antemano gracias
en cone3d.gamedev.net tienes el codigo exacto
un saludo
En Quake es algo asi:
void SCR_ScreenShotTGA_f (void)
{
byte *buffer;
char tganame[255];
char checkname[MAX_OSPATH];
int i, c, temp;
//
// find a file name to save it to
//
sprintf (checkname, "%s/shots", com_gamedir);
Sys_mkdir (checkname);
sprintf( tganame,"telejano_000.tga");
for (i=0; i<=999; i++)
{
tganame[11-2] = (i/100)%10 + '0';
tganame[11-1] = (i/10 )%10 + '0';
tganame[11-0] = (i )%10 + '0';
sprintf (checkname, "%s/shots/%s", com_gamedir, tganame);
if (Sys_FileTime(checkname) == -1)
break; // file doesn't exist
}
if (i==999)
{
Con_Printf ("SCR_ScreenShot_f: Couldn't create a TGA file\n");
return;
}
buffer = malloc(glwidth*glheight*3 + 18);
if (!buffer)
{
Con_Printf("Not enough ram for screnshot\n");
return;
}
memset (buffer, 0, 18);
buffer[2] = 2; // uncompressed type
buffer[12] = glwidth&255;
buffer[13] = glwidth>>8;
buffer[14] = glheight&255;
buffer[15] = glheight>>8;
buffer[16] = 24; // pixel size
glReadPixels (glx, gly, glwidth, glheight, GL_RGB, GL_UNSIGNED_BYTE, buffer+18 );
// swap rgb to bgr
c = 18+glwidth*glheight*3;
for (i=18; i<c; i+=3)
{
temp = buffer[i];
buffer[i] = buffer[i+2];
buffer[i+2] = temp;
}
COM_WriteFile (va ("shots/%s", tganame), buffer, glwidth*glheight*3 + 18 );
free (buffer);
Con_Printf ("Wrote %s\n", tganame);
}
// Tei - redone screenshots for more shots support