This repository has been archived on 2022-05-19. You can view files and clone it, but cannot push or open issues or pull requests.
DemoGL4D/window.c

42 lines
952 B
C
Raw Normal View History

/* TP8 */
2022-05-12 13:48:40 +02:00
#include <GL4D/gl4duw_SDL2.h>
#include "includes/animations.h"
2022-05-17 22:02:35 +02:00
2022-05-17 22:08:37 +02:00
// Son de fond
2022-05-17 22:02:35 +02:00
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[] = {
{ 6800, cube, NULL, NULL },
{ 8500, voronoi, NULL, NULL },
{ 6000, polygone, NULL, NULL },
2022-05-17 21:04:03 +02:00
{ 0, NULL, NULL, NULL }
};
2022-05-19 02:35:29 +02:00
initialisationMusique(ambiance, "audio/ambiance.mid");
2022-05-17 22:02:35 +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;
}