Skip to content

Instantly share code, notes, and snippets.

@banister
Created November 14, 2009 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save banister/234637 to your computer and use it in GitHub Desktop.
Save banister/234637 to your computer and use it in GitHub Desktop.
#include <IL/il.h>
#include <IL/ilu.h>
#include <stdio.h>
int
main(void)
{
ILuint code, name;
ilInit();
iluInit();
ilEnable(IL_FILE_OVERWRITE);
ilGenImages(1, &name);
ilBindImage(name);
ilLoadImage("texture.png");
iluImageParameter(ILU_FILTER, ILU_SCALE_LANCZOS3);
iluScale(100, 100, 1);
ilSaveImage("thumb.png");
if((code = ilGetError()) != IL_NO_ERROR)
printf(iluErrorString(code));
return 0;
}
devil: devil.o
gcc -L/opt/local/lib/ -lIL -lILU devil.o -o $@
devil.o: devil.c
gcc -I/opt/local/include/ -c devil.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment