I have created a program with flames that get darker the “older” they are, and white objects in the scene as well. When I run the program on all of my computers it works perfectly, though when I run it on my friends computer all the white objects turn the color of the last drawn flame. I have made sure to use glColor3f(1,1,1) before all of my white objects yet it still has the same effect. Is there something I have to initialize on some machines using glut that I don’t on others?
Make a glBlendFunc(GL_SRC_ALAPHA, GL_ONE_MINUS_SRC_ALPHA) call, this should be the default but there may be a driver problem that produces a difference on his graphics card.
If he has a really old card or some crappy Intel freeD chipset it may never be fixed, sometimes you encounter simple problems where stuff is just broke especially on PCs.
Oh wait, ALL the stuff changes color? That is just a state leak. Remember that whatever state is left in the graphics system is used for the next object or the next frame. At the start of your frame or each object you need to make sure you have the right state applied including color lighting texture etc. There are different ways of doing this, one is to make sure you leave things in good shape at the end of the last frame, but it’s a common problem to see color leak onto other objects.
Try to be efficient about it, don’t change state more often than you need to.
What do you mean by change state. I noticed that in most source code after the glClear(); call they have a call to glLoadIdentity();. Would I get this effect if I didn’t call glLoadIdentity();