J´ai déjà poser ces questions y´a qq temps, mais sans réponse :
L´erreur, c´est : gl/glut.h : No such file or directory
Code : ( juste pour tester si ça marche, je vous rassure ^^ ) :
- include < gl/glut.h>
void InitGL();
void Reshape(int width, int height);
void Draw();
int Win1;
int main( int argc, char *argv[ ], char *envp[ ] )
{
glutInit(&,argv);
glutInitWindowSize(640,480);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
Win1 = glutCreateWindow("Coucou ! ");
InitGL();
glutReshapeFunc(Reshape);
glutDisplayFunc(Draw);
glutMainLoop();
return 0;
}
void Reshape(int width, int height)
{
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45,float(width)/float(height),1,100
);
glMatrixMode(GL_MODELVIEW);
}
void Draw()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0,0,10,0,0,0,0,1,0);
glBegin(GL_TRIANGLES);
glVertex2i(0,1);
glVertex2i(-1,0);
glVertex2i(1,0);
glEnd();
glutSwapBuffers();
glutPostRedisplay();
}
void InitGL()
{
}