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

39 lines
818 B
C
Raw Normal View History

2022-05-12 13:48:40 +02:00
#include <GL4D/gl4duw_SDL2.h>
2022-05-13 20:57:05 +02:00
#include "animations.h"
2022-05-12 13:48:40 +02:00
// Dimensions initiales de la fenêtre
static int dimensions[] = {1280, 720};
2022-05-13 20:57:05 +02:00
// Animations
static GL4DHanime animations[] = {
{0, NULL, NULL, NULL}
};
// Comportement à la fermeture du programme
static void fermeture(void);
// Comportement au démarrage du programme
void initialisation(void);
2022-05-12 13:48:40 +02:00
int main(int argc, char *argv[]) {
if(!gl4duwCreateWindow(argc, argv, "Démo Anri KENNEL", 10, 10, dimensions[0], dimensions[1], GL4DW_SHOWN)) {
return 1;
}
2022-05-13 20:57:05 +02:00
initialisation();
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;
}
2022-05-13 20:57:05 +02:00
void initialisation(void) {
gl4dhInit(animations, dimensions[0], dimensions[1], initialisationAnimation);
}
2022-05-12 13:48:40 +02:00
2022-05-13 20:57:05 +02:00
void fermeture(void) {
gl4duClean(GL4DU_ALL);
2022-05-12 13:48:40 +02:00
}