Napisałem jako taką funkcję zapisującą obraz w bibliotece DevIL.
void SaveTexture(ILenum Mode, ILenum Type, char * FileName, ILuint Texture)
{
//////////////////////////////
// Mode
// * IL_FILE_OVERWRITE - Possible to override.
// * IL_FILE_ALREADY_EXISTS - Impossible to override.
// Type
// * IL_BMP - Save the image as a Microsoft bitmap (.bmp).
// * IL_JPG - Save the image as a Jpeg (.jpg, .jpeg).
// * IL_PNG - Save the image as a Portable Network Graphics (.png) image.
// * IL_TGA - Save the image as a TrueVision Targa.
// FileName
// * The filename of the file to save to.
// Texture
// * Texture to the save.
//////////////////////////////
// włączenie parametru Mode
ilEnable(Mode);
// wybranie biezacego obrazu
ilBindImage(Texture);
// zapisanie obrazu
ilSave (Type, FileName);
// wyłączenie parametru Mode
ilDisable(Mode);
}
Przy takim wywołaniu:
SaveTexture(IL_FILE_OVERWRITE, IL_PNG, "SaveOne.png", Grass);
tworzy się plik wielkości 1x1.Czy wie ktoś co z tym zrobić?