Add animations
This commit is contained in:
parent
4bea60dad4
commit
1123b1a6ca
4 changed files with 37 additions and 12 deletions
4
Makefile
4
Makefile
|
@ -20,8 +20,8 @@ PACKNAME = sc_00_07
|
||||||
PROGNAME = demo
|
PROGNAME = demo
|
||||||
VERSION = 1.0
|
VERSION = 1.0
|
||||||
distdir = $(PACKNAME)_$(PROGNAME)-$(VERSION)
|
distdir = $(PACKNAME)_$(PROGNAME)-$(VERSION)
|
||||||
HEADERS =
|
HEADERS = animations.h
|
||||||
SOURCES = window.c
|
SOURCES = window.c animations.c
|
||||||
MSVCSRC = $(patsubst %,<ClCompile Include=\"%\\\" \\/>,$(SOURCES))
|
MSVCSRC = $(patsubst %,<ClCompile Include=\"%\\\" \\/>,$(SOURCES))
|
||||||
OBJ = $(SOURCES:.c=.o)
|
OBJ = $(SOURCES:.c=.o)
|
||||||
DOXYFILE = documentation/Doxyfile
|
DOXYFILE = documentation/Doxyfile
|
||||||
|
|
5
animations.c
Normal file
5
animations.c
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#include "animations.h"
|
||||||
|
|
||||||
|
void initialisationAnimation(void) {
|
||||||
|
/* ... */
|
||||||
|
}
|
9
animations.h
Normal file
9
animations.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef DEMO_ANIMATION_HPP
|
||||||
|
#define DEMO_ANIMATION_HPP 1
|
||||||
|
|
||||||
|
#include <GL4D/gl4dh.h>
|
||||||
|
|
||||||
|
// Comportement avant de lancer les animations
|
||||||
|
void initialisationAnimation(void);
|
||||||
|
|
||||||
|
#endif
|
31
window.c
31
window.c
|
@ -1,27 +1,38 @@
|
||||||
#include <GL4D/gl4dp.h>
|
|
||||||
#include <GL4D/gl4duw_SDL2.h>
|
#include <GL4D/gl4duw_SDL2.h>
|
||||||
|
|
||||||
// Dessine dans la fenêtre
|
#include "animations.h"
|
||||||
static void dessin(void);
|
|
||||||
|
|
||||||
// Dimensions initiales de la fenêtre
|
// Dimensions initiales de la fenêtre
|
||||||
static int dimensions[] = {1280, 720};
|
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[]) {
|
int main(int argc, char *argv[]) {
|
||||||
if(!gl4duwCreateWindow(argc, argv, "Démo Anri KENNEL", 10, 10, dimensions[0], dimensions[1], GL4DW_SHOWN)) {
|
if(!gl4duwCreateWindow(argc, argv, "Démo Anri KENNEL", 10, 10, dimensions[0], dimensions[1], GL4DW_SHOWN)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
initialisation();
|
||||||
|
atexit(fermeture);
|
||||||
|
|
||||||
gl4dpInitScreen();
|
gl4duwDisplayFunc(gl4dhDraw);
|
||||||
gl4duwDisplayFunc(dessin);
|
|
||||||
gl4duwMainLoop();
|
gl4duwMainLoop();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dessin(void) {
|
void initialisation(void) {
|
||||||
gl4dpClearScreen();
|
gl4dhInit(animations, dimensions[0], dimensions[1], initialisationAnimation);
|
||||||
|
}
|
||||||
/* ... */
|
|
||||||
gl4dpUpdateScreen(NULL);
|
void fermeture(void) {
|
||||||
|
gl4duClean(GL4DU_ALL);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue