je me lance ds lopen gl, je copie colle un exemple , je compile (avec vc++) , et la, 0 erreurs! je saute de joie et jessaie dexecuter le prog....21 erreurs ;-(( toutes dans le style
"Cpp1.obj : error LNK2001: unresolved external symbol __imp__glEnable@4"
keskispass?
voila le code si ca vous interresse:
#include <windows.h> // Standard Window header required for all programs
#include <gl\gl.h> // fonctions OpenGL
#include <gl\glaux.h> // Librarie AUX
#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);
}
---------------
Do you serve a purpose,Or purposely serve?