C:/Users/Math/Documents/Training/main.c:69: undefined reference to `_auxInitDisplayMode@4' C:/Users/Math/Documents/Training/main.c:70: undefined reference to `_auxInitPosition@16' C:/Users/Math/Documents/Training/main.c:71: undefined reference to `_auxInitWindowA@4' C:/Users/Math/Documents/Training/main.c:73: undefined reference to `_auxReshapeFunc@4' C:/Users/Math/Documents/Training/main.c:74: undefined reference to `_auxMainLoop@4'
#include <windows.h> #include <gl\gl.h> #include <gl\glaux.h> #include <math.h> #define largeur 250 #define hauteur 250 GLfloat clipHeight; GLfloat clipWidth; void setupRC() { glClearColor(0.0f, 0.0f, 0.0f, 1.0f ); glShadeModel(GL_SMOOTH); //glShadeModel(GL_FLAT); glFrontFace(GL_CW); glEnable(GL_DEPTH_TEST); } void CALLBACK Main_part(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glBegin(GL_POINTS); glVertex2f(-10.0f,-10.0f); glEnd(); glColor3f(1.0f,0.0f,1.0f); glBegin(GL_LINES); glVertex3f(-10.0f,-10.0f,-50.0f); glVertex3f(100.0f,100.0f,50.0f); glEnd(); glBegin(GL_TRIANGLES); //la ligne coupe le triangle et est partiellement cachée glColor3f(0.0f,1.0f,0.0f); glVertex3f(0.0f,130.0f,0.0f); glColor3f(0.0f,0.0f,1.0f); glVertex3f(0.0f,0.0f,0.0f); glColor3f(1.0f,0.0f,0.0f); glVertex3f(130.0f,0.0f,0.0f); glEnd(); glFlush(); } void CALLBACK Reshape(GLsizei w, GLsizei h) //si il y a un changement de taille de la fenetre ... { GLfloat Near = -100.0f; GLfloat Far = 100.0f; if (h 0) h 1; glViewport(0,0,w,h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); if (w<=h) { clipWidth = (GLfloat)largeur * h/w; clipHeight = (GLfloat)hauteur; } else { clipWidth = (GLfloat)largeur; clipHeight = (GLfloat)hauteur * w/h; } glOrtho( -clipWidth/2, clipWidth/2, -clipHeight/2, clipHeight/2, Near, Far); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } void main(void) { auxInitDisplayMode(AUX_SINGLE | AUX_RGBA | AUX_DEPTH); auxInitPosition(100,100,largeur,hauteur); auxInitWindow("Test"); setupRC(); auxReshapeFunc(Reshape); auxMainLoop(Main_part); }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question