Frog,
Sorry so late with the reply. I got your email and reviewed the code. Just a few mistakes, but here’s the working version:
#include<gl\glaux.h>
void SetupRC()
{
glClearColor(0.0f,0.0f,1.0f,1.0f);
glColor3f(1.0f,0.0f,0.0f);
}
void CALLBACK ChangeSize(GLsizei w,GLsizei h)
{
GLfloat nRange=50.0f;
if (h==0)
h=1;
glViewport(0,0,w,h);
glColor3f(1.0f,0.0f,0.0f);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w<= h)
glOrtho(-nRange,nRange, -nRangeh/w, nRangeh/w, -nRange,nRange);
else
glOrtho(-nRangew/h,nRangew/h, -nRange, nRange, -nRange,nRange);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void CALLBACK RenderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
auxWireTeapot(50.0f);
glBegin(GL_POINTS);
glVertex3f(10.0f,10.0f,0.0f);
glVertex3f(10.0f,10.0f,-10.0f);
glEnd();
glFlush();
}
void main()
{
auxInitDisplayMode(AUX_SINGLE|AUX_DEPTH|AUX_RGBA);
auxInitPosition(100,100,400,400);
auxInitWindow(“fenetre 3d”);
auxReshapeFunc(ChangeSize);
SetupRC();
auxMainLoop(RenderScene);
}
From there you can see what I added. You never referenced SetupRC(), you didn’t set the reshape function, and I added a window size function. Other than that, it works great.
Feel free to email me if you have further questions, or post on this board so others can learn along with you.
Oh, je parle un peu, mais je ne sais pas plus des paroles. Je pense que c’est sont un peu des personnes qui parlez en Francais ici.
Glossifah