#include "SDL_error.h" #include "SDL_video.h" #include "includes/animations.h" // Son de fond static Mix_Chunk *_ambiance = NULL; // Dimensions initiales de la fenêtre GLuint _dims[] = {1280, 720}; // Comportement à la fermeture du programme static void closure(void) { freeMusic(_ambiance); gl4duClean(GL4DU_ALL); printf("Merci du visionnage !\n"); } int main(int argc, char *argv[]) { if (!gl4duwCreateWindow(argc, argv, "Demo API8 2023", GL4DW_POS_CENTERED, GL4DW_POS_CENTERED, _dims[0], _dims[1], GL4DW_OPENGL | GL4DW_SHOWN)) { fprintf(stderr, "Erreur lors de la création de la fenêtre.\n"); return 1; } initMusic(_ambiance, "audio/ambiance.mid"); // Animations GL4DHanime animations[] = {{10000, manif, NULL, NULL}, {9000, credits, NULL, NULL}, {0, NULL, NULL, NULL}}; gl4dhInit(animations, _dims[0], _dims[1], NULL); atexit(closure); gl4duwDisplayFunc(gl4dhDraw); if (SDL_GL_SetSwapInterval(-1)) { fprintf(stderr, "Erreur VSync : %s\n", SDL_GetError()); } gl4duwMainLoop(); return 0; }