diff --git a/Makefile b/Makefile index 913ce28..5c0cbf1 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,8 @@ PACKNAME = sc_00_07 PROGNAME = demo VERSION = 1.0 distdir = $(PACKNAME)_$(PROGNAME)-$(VERSION) -HEADERS = -SOURCES = window.c +HEADERS = animations.h +SOURCES = window.c animations.c MSVCSRC = $(patsubst %,,$(SOURCES)) OBJ = $(SOURCES:.c=.o) DOXYFILE = documentation/Doxyfile diff --git a/animations.c b/animations.c new file mode 100644 index 0000000..2990c86 --- /dev/null +++ b/animations.c @@ -0,0 +1,5 @@ +#include "animations.h" + +void initialisationAnimation(void) { + /* ... */ +} diff --git a/animations.h b/animations.h new file mode 100644 index 0000000..e284405 --- /dev/null +++ b/animations.h @@ -0,0 +1,9 @@ +#ifndef DEMO_ANIMATION_HPP +#define DEMO_ANIMATION_HPP 1 + +#include + +// Comportement avant de lancer les animations +void initialisationAnimation(void); + +#endif diff --git a/window.c b/window.c index ff77e9b..007f3af 100644 --- a/window.c +++ b/window.c @@ -1,27 +1,38 @@ -#include #include -// Dessine dans la fenêtre -static void dessin(void); +#include "animations.h" // Dimensions initiales de la fenêtre static int dimensions[] = {1280, 720}; +// 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); + int main(int argc, char *argv[]) { if(!gl4duwCreateWindow(argc, argv, "Démo Anri KENNEL", 10, 10, dimensions[0], dimensions[1], GL4DW_SHOWN)) { return 1; } + initialisation(); + atexit(fermeture); - gl4dpInitScreen(); - gl4duwDisplayFunc(dessin); + gl4duwDisplayFunc(gl4dhDraw); gl4duwMainLoop(); return 0; } -void dessin(void) { - gl4dpClearScreen(); - - /* ... */ - gl4dpUpdateScreen(NULL); +void initialisation(void) { + gl4dhInit(animations, dimensions[0], dimensions[1], initialisationAnimation); +} + +void fermeture(void) { + gl4duClean(GL4DU_ALL); }