2022-05-12 13:48:40 +02:00
|
|
|
#include <GL4D/gl4duw_SDL2.h>
|
|
|
|
|
2022-05-15 15:16:27 +02:00
|
|
|
#include "includes/animations.h"
|
2022-05-17 22:02:35 +02:00
|
|
|
#include "includes/audio.h"
|
|
|
|
|
|
|
|
static Mix_Music * ambiance = NULL;
|
2022-05-12 13:48:40 +02:00
|
|
|
|
2022-05-13 20:57:05 +02:00
|
|
|
// Comportement à la fermeture du programme
|
2022-05-17 21:04:03 +02:00
|
|
|
void fermeture(void) {
|
2022-05-17 22:02:35 +02:00
|
|
|
liberationMusique(ambiance);
|
|
|
|
|
2022-05-17 21:04:03 +02:00
|
|
|
gl4duClean(GL4DU_ALL);
|
|
|
|
}
|
2022-05-13 20:57:05 +02:00
|
|
|
|
2022-05-12 13:48:40 +02:00
|
|
|
int main(int argc, char *argv[]) {
|
2022-05-17 21:04:03 +02:00
|
|
|
// Dimensions initiales de la fenêtre
|
|
|
|
int dimensions[] = { 1280, 720 };
|
|
|
|
|
2022-05-12 13:48:40 +02:00
|
|
|
if(!gl4duwCreateWindow(argc, argv, "Démo Anri KENNEL", 10, 10, dimensions[0], dimensions[1], GL4DW_SHOWN)) {
|
|
|
|
return 1;
|
|
|
|
}
|
2022-05-17 21:04:03 +02:00
|
|
|
|
|
|
|
// Animations
|
|
|
|
GL4DHanime animations[] = {
|
|
|
|
{ 5000, cube, NULL, NULL },
|
|
|
|
{ 5000, voronoi, NULL, NULL },
|
|
|
|
{ 5000, polygone, NULL, NULL },
|
|
|
|
{ 0, NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2022-05-17 22:02:35 +02:00
|
|
|
initialisationMusique(ambiance, "audio/ambiance.ogg");
|
|
|
|
|
2022-05-15 20:25:16 +02:00
|
|
|
gl4dhInit(animations, dimensions[0], dimensions[1], NULL);
|
2022-05-13 20:57:05 +02:00
|
|
|
atexit(fermeture);
|
2022-05-12 13:48:40 +02:00
|
|
|
|
2022-05-13 20:57:05 +02:00
|
|
|
gl4duwDisplayFunc(gl4dhDraw);
|
2022-05-12 13:48:40 +02:00
|
|
|
gl4duwMainLoop();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|