PDA

View Full Version : A small problem, please help me...



Zhang Yan
10-22-2001, 04:08 AM
I am really a beginner.
I made a simple "Racing" program in opengl.
I indeed wanted to use double buffer and copy all the part for double buffer from book, but it acted as single buffer, flickered all the time. I do not know where
I was wrong. Please help me.
I indeed write "glutInitDisplayMode(...| GL_DOUBLE)" and "glutSwapBuffers()" in the display callback function.
If you could take the trouble to go to my homepage: "http://ihome.ust.hk/~cszy" to see the program, I will be very grateful.
Thank you very much!

10-22-2001, 05:39 PM
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);

worked for me

Zhang Yan
10-22-2001, 06:41 PM
Thank you very much!
But it doesn't work in my system.
Actually, I use
glGetBooleanv(GL_DOUBLEBUFFER, &bdouble)
and I Found that bdouble=0, which indicates
that maybe I cannot use double buffer at all.
But my supervisor asked me to make double
buffered program on this machine, and she is
very anxious to see.
What can I do?
Thank you again!

Zhang Yan
10-23-2001, 12:16 AM
Thanks for all.
Now I know the error:
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
should be positioned before:
glutInitWindowPosition(0, 0);
glutInitWindowSize(640, 480);
glutCreateWindow("Racing");

^_^