add tag scene bones
This commit is contained in:
parent
dda5e2cab0
commit
e8a0c35f4a
6 changed files with 51 additions and 5 deletions
|
@ -11,6 +11,9 @@ extern GLuint _dims[];
|
||||||
// Scène de manifestation
|
// Scène de manifestation
|
||||||
void manif(int);
|
void manif(int);
|
||||||
|
|
||||||
|
// Scène du tag sur le mur
|
||||||
|
void tag(int);
|
||||||
|
|
||||||
// Crédits de fin
|
// Crédits de fin
|
||||||
void credits(int);
|
void credits(int);
|
||||||
|
|
||||||
|
|
8
main.c
8
main.c
|
@ -20,9 +20,11 @@ int main(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Animations
|
// Animations
|
||||||
GL4DHanime animations[] = {{10000, manif, NULL, NULL},
|
GL4DHanime animations[] = {{10000, manif, NULL, NULL}, // Manifestation
|
||||||
{2000, manif, credits, zoom_in},
|
{2000, manif, tag, zoom_in}, // Transition
|
||||||
{9500, credits, NULL, NULL},
|
{2000, tag, NULL, NULL}, // Tag
|
||||||
|
{2000, tag, credits, zoom_in}, // Transition
|
||||||
|
{9500, credits, NULL, NULL}, // Crédits
|
||||||
{0, NULL, NULL, NULL}};
|
{0, NULL, NULL, NULL}};
|
||||||
|
|
||||||
gl4dhInit(animations, _dims[0], _dims[1], init);
|
gl4dhInit(animations, _dims[0], _dims[1], init);
|
||||||
|
|
4
shaders/tag.fs
Normal file
4
shaders/tag.fs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#version 330
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
}
|
4
shaders/tag.vs
Normal file
4
shaders/tag.vs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#version 330
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
}
|
|
@ -61,14 +61,13 @@ static void init(void) {
|
||||||
gl4duGenMatrix(GL_FLOAT, matrix_proj);
|
gl4duGenMatrix(GL_FLOAT, matrix_proj);
|
||||||
gl4duGenMatrix(GL_FLOAT, matrix_model);
|
gl4duGenMatrix(GL_FLOAT, matrix_model);
|
||||||
gl4duGenMatrix(GL_FLOAT, matrix_view);
|
gl4duGenMatrix(GL_FLOAT, matrix_view);
|
||||||
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw(void) {
|
static void draw(void) {
|
||||||
static double t0 = 0;
|
static double t0 = 0;
|
||||||
double dt = get_dt(&t0, GL_TRUE);
|
double dt = get_dt(&t0, GL_TRUE);
|
||||||
|
|
||||||
|
glEnable(GL_DEPTH_TEST);
|
||||||
glClearColor(0.2f, 0.2f, 0.8f, 1); // couleur ciel
|
glClearColor(0.2f, 0.2f, 0.8f, 1); // couleur ciel
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glUseProgram(_pId);
|
glUseProgram(_pId);
|
||||||
|
|
34
src/tag.c
Normal file
34
src/tag.c
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
#include "../includes/animations.h"
|
||||||
|
|
||||||
|
static GLuint _pId = 0;
|
||||||
|
|
||||||
|
static void init(void);
|
||||||
|
static void draw(void);
|
||||||
|
|
||||||
|
void tag(int state) {
|
||||||
|
switch (state) {
|
||||||
|
case GL4DH_INIT:
|
||||||
|
init();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GL4DH_DRAW:
|
||||||
|
draw();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void init(void) {
|
||||||
|
_pId = gl4duCreateProgram("<vs>shaders/tag.vs", "<fs>shaders/tag.fs", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void draw(void) {
|
||||||
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
glClearColor(0.2f, 0.2f, 0.2f, 1);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
glUseProgram(_pId);
|
||||||
|
|
||||||
|
glUseProgram(0);
|
||||||
|
}
|
Reference in a new issue