ca m´enerve ! !! voici mon code:
/ / header
- include < glut.h>
- include " tga.h"
/ / fonction redimensionnemnt
void reshape(int w, int h)
{
glViewport(0, 0, ( GLsizei) w, ( GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, ( GLdouble) w, 0.0, ( GLdouble) h);
}
/ / fonction d´affichage
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT); / / vide écran
glColor3f(1.0, 1.0, 1.0); / / couleur blanche
glEnable(GL_TEXTURE_2D); / / active les textures
glBindTexture(GL_TEXTURE_2D, 1); / / creation texture
// on trace un carré
glBegin(GL_QUADS);
glTexCoord2i(0, 0); glVertex2i(0, 0);
glTexCoord2i(0, 1); glVertex2i(0, 600);
glTexCoord2i(1, 1); glVertex2i(800, 600);
glTexCoord2i(1, 0); glVertex2i(800, 0);
glEnd();
glFlush(); / / on force l´affichage
glDisable(GL_TEXTURE_2D); / / desactive les textures
glutSwapBuffers(); / / on inverse les buffers
glutPostRedisplay(); / / fenetre redessiné
}
/ / fonction gestion du clavier
void clavier(unsigned char key, int x, int y)
{
switch(key)
{
case 27: / / touche ECHAP
glutDestroyWindow(glutGetWindow());
exit(0);
break;
}
}
/ / fonction principale
int main(int argc, char** argv)
{
glutInit(&, argv); / / init GLUT
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); / / double buffering, couleur RGB
glutInitWindowPosition(0, 0); / / position de depart
glutInitWindowSize(800, 600); / / taille fenetre
glutCreateWindow("Love Demo"); / / creation fenetre
// on charge l´image
loadTGA("data\\coeur.tga", 1);
glClearColor(0.0, 0.0, 0.0, 0.0); / / " vidage" noir
glShadeModel(GL_FLAT); / / pas de degradé
glutDisplayFunc(display); / / fonction d´affichage
glutReshapeFunc(reshape); / / fonction de redimensionnement
glutKeyboardFunc(clavier); / / fonction de gestion du clavier
glutMainLoop(); / / boucle GLUT
return 1;
}
mais j´aimerais que le coeur ( l´image) que l´on voit ki occupe tout la fenetre, arrive mais progressivement... je ne sais pas trop comment faire, aucun tutorial n´explique l´animation ! !!
help ! !!