Ce programme charge un enseble d'animation a partir d'un fichier de configuration au format xml et d'un certain nombre d'image donnée.
int main( int argc, char *argv[] ){
int width = 640, height = 480;
int x_walk = 0, y = 0, x_run = 100;
const char* book_file_path = "animation_book.xml";
if( ! book ){
fprintf( stderr, "Failed to load the file %s\n", book_file_path );
exit(1);
}
int sound = 0;
while(
&touche, NULL, NULL,
NULL, NULL,
NULL, NULL, NULL,
NULL
touche != MLV_KEYBOARD_ESCAPE
){
20,150,
"Laissez la touche k appuyee pour entendre le son des animations.",
);
if( touche==MLV_KEYBOARD_k ){
if( sound ){
sound = 0;
}else{
sound = 1;
}
touche = MLV_KEYBOARD_NONE;
}
}
return 0;
}