add skeleton for transition

This commit is contained in:
Mylloon 2023-05-19 11:44:09 +02:00
parent 6c19f0e785
commit 9ca3af3b82
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
5 changed files with 56 additions and 0 deletions

View file

@ -14,4 +14,7 @@ void manif(int);
// Crédits de fin // Crédits de fin
void credits(int); void credits(int);
// Transition zoom
void zoom_in(void (*)(int), void (*)(int), Uint32, Uint32, int);
#endif #endif

1
main.c
View file

@ -21,6 +21,7 @@ int main(int argc, char *argv[]) {
// Animations // Animations
GL4DHanime animations[] = {{10000, manif, NULL, NULL}, GL4DHanime animations[] = {{10000, manif, NULL, NULL},
{2000, manif, credits, zoom_in},
{9500, credits, NULL, NULL}, {9500, credits, NULL, NULL},
{0, NULL, NULL, NULL}}; {0, NULL, NULL, NULL}};

4
shaders/zoom_in.fs Normal file
View file

@ -0,0 +1,4 @@
#version 330
void main(void) {
}

4
shaders/zoom_in.vs Normal file
View file

@ -0,0 +1,4 @@
#version 330
void main(void) {
}

44
src/animations.c Normal file
View file

@ -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("<vs>shaders/zoom_in.vs", "<fs>shaders/zoom_in.fs",
NULL);
}
static void zoom_in_draw(void) {}