initialisation global of quad
This commit is contained in:
parent
d7036e5b79
commit
2317ee328e
3 changed files with 13 additions and 1 deletions
|
@ -14,6 +14,9 @@ void manif(int);
|
|||
// Crédits de fin
|
||||
void credits(int);
|
||||
|
||||
// Initialisation des transitions
|
||||
void transitions_init(void);
|
||||
|
||||
// Transition zoom
|
||||
void zoom_in(void (*)(int), void (*)(int), Uint32, Uint32, int);
|
||||
|
||||
|
|
2
main.c
2
main.c
|
@ -42,6 +42,8 @@ static void init(void) {
|
|||
|
||||
srand((Uint32)time(NULL));
|
||||
|
||||
transitions_init();
|
||||
|
||||
printf("Bienvenue dans la démo API8 !\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/* Mise-à-jour des animations en fonction du son */
|
||||
static void update_with_audio(void (*)(int), void (*)(int), int);
|
||||
|
||||
static GLuint _zoomin_pId = 0, _zoomin_tId = 0, _zoomin_tex[2];
|
||||
static GLuint _zoomin_pId = 0, _zoomin_tId = 0, _zoomin_tex[2], _quadId = 0;
|
||||
static void zoomin_init(void);
|
||||
static void zoomin_draw(void (*)(int), void (*)(int), Uint32, Uint32, int);
|
||||
static void zoomin_deinit(void);
|
||||
|
@ -18,6 +18,12 @@ static void update_with_audio(void (*a0)(int), void (*a1)(int), int state) {
|
|||
}
|
||||
}
|
||||
|
||||
void transitions_init(void) {
|
||||
if (!_quadId) {
|
||||
_quadId = gl4dgGenQuadf();
|
||||
}
|
||||
}
|
||||
|
||||
void zoom_in(void (*a0)(int), void (*a1)(int), Uint32 t, Uint32 et, int state) {
|
||||
switch (state) {
|
||||
case GL4DH_INIT:
|
||||
|
@ -82,6 +88,7 @@ static void zoomin_draw(void (*a0)(int), void (*a1)(int), Uint32 t, Uint32 et,
|
|||
glUniform1f(glGetUniformLocation(_zoomin_pId, "zoomAmount"),
|
||||
(GLfloat)et / (GLfloat)t);
|
||||
glUniform1i(glGetUniformLocation(_zoomin_pId, "tex"), 0);
|
||||
gl4dgDraw(_quadId);
|
||||
}
|
||||
|
||||
static void zoomin_deinit(void) {
|
||||
|
|
Reference in a new issue