CLog::addLine("GL_RENDERER: %s",(char *)glGetString(GL_RENDERER));
CLog::addLine("GL_VENDOR: %s",(char *)glGetString(GL_VENDOR));
CLog::addLine("GL_VERSION: %s\n",(char *)glGetString(GL_VERSION));
alors CLog est une classe qu permet d'ecrire dans un fichier texte
si tu as deja une fonction qui le fait c nikel sinon voila le code:
void PrintIntoFile(char* text)
{
char temptext[1024];
va_list ap;
//Initialize variable argument list
va_start(ap, text);
vsprintf(temptext, text, ap);
va_end(ap);
//Open the log file for append
if((log = fopen("log.txt", "wb"))==NULL) return;
fprintf(log,"%s\n", temptext);
//Close the file
fclose(log);
}
ca creer un fichier et ecrit dedans
pour ouvrir et pas le creer si il est deja créé tu met if((log = fopen("log.txt", "a"))==NULL) return; au lieu de if((log = fopen("log.txt", "wb"))==NULL) return;
|