Hi Werker's,
if you want to take screenshots you can use the SaveBuffer() function on the Backbuffer(), thats an easy way.
But what about the naming?
My Game NightFist is slowly growing and i want to document my progress with screenshots.
Therefore i took a few minutes to find an easy solution to create good names.
Here is my way
#include <time.h>
#include <string>
// Take Screenshot?
if( KeyHit( KEY_F12 ) )
{
//
// Create the name and save it (using the format 'NightFist_2009_12_06-13_59_42.jpg'
//
// Variablen init
time_t mTime = time( NULL ); // Time
tm *mDate = localtime( &mTime ); // DateTime Structure
char cBuf[40]; // copy Buffer
// Now Create the TimeStamp for the file
sprintf( cBuf, "%4d_%2d_%2d-%2d_%2d_%2d", mDate->tm_year + 1900, mDate->tm_mon + 1, mDate->tm_mday, mDate->tm_hour, mDate->tm_min, mDate->tm_sec );
// Start with the Prefix
std::string strName = "NightFist_";
// Then the Timestamp
strName += cBuf;
// and the ending
strName += ".jpg";
// Save Buffer
SaveBuffer( BackBuffer(), (str)strName.c_str(), 85 );
}
have fun and let us see your screenshots
cu
Oliver