diff --git a/includes/animations.h b/includes/animations.h index 5963fa7..dd7f891 100644 --- a/includes/animations.h +++ b/includes/animations.h @@ -14,4 +14,7 @@ void manif(int); // Crédits de fin void credits(int); +// Transition zoom +void zoom_in(void (*)(int), void (*)(int), Uint32, Uint32, int); + #endif diff --git a/main.c b/main.c index 8c8ac4e..3ed2da8 100644 --- a/main.c +++ b/main.c @@ -21,6 +21,7 @@ int main(int argc, char *argv[]) { // Animations GL4DHanime animations[] = {{10000, manif, NULL, NULL}, + {2000, manif, credits, zoom_in}, {9500, credits, NULL, NULL}, {0, NULL, NULL, NULL}}; diff --git a/shaders/zoom_in.fs b/shaders/zoom_in.fs new file mode 100644 index 0000000..3060f41 --- /dev/null +++ b/shaders/zoom_in.fs @@ -0,0 +1,4 @@ +#version 330 + +void main(void) { +} diff --git a/shaders/zoom_in.vs b/shaders/zoom_in.vs new file mode 100644 index 0000000..3060f41 --- /dev/null +++ b/shaders/zoom_in.vs @@ -0,0 +1,4 @@ +#version 330 + +void main(void) { +} diff --git a/src/animations.c b/src/animations.c new file mode 100644 index 0000000..a59a2fe --- /dev/null +++ b/src/animations.c @@ -0,0 +1,44 @@ +#include "../includes/animations.h" + +/* Mise-à-jour des animations en fonction du son */ +static void update_with_audio(void (*)(int), void (*)(int), int); + +static void zoom_in_init(void); +static void zoom_in_draw(void); + +static void update_with_audio(void (*a0)(int), void (*a1)(int), int state) { + if (a0) { + a0(state); + } + + if (a1) { + a1(state); + } +} + +void zoom_in(void (*a0)(int), void (*a1)(int), Uint32 t, Uint32 et, int state) { + switch (state) { + case GL4DH_INIT: + zoom_in_init(); + break; + + case GL4DH_DRAW: + zoom_in_draw(); + break; + + case GL4DH_UPDATE_WITH_AUDIO: + update_with_audio(a0, a1, state); + break; + + default: + break; + } +} + +static void zoom_in_init(void) { + static GLuint _pId = 0; + _pId = gl4duCreateProgram("shaders/zoom_in.vs", "shaders/zoom_in.fs", + NULL); +} + +static void zoom_in_draw(void) {}