I have tested it on two different NVIDIA graphics cards (8000 and 9000 series) and it works fine. This could just be coincidence because the GPUs are faster?
The problem shows up when using the Intel graphics chipset on some of my friends’ laptops. I can also reproduce this when running Windows in VMWare Fusion on my machine with an NVIDIA graphics card.
Here is how I’m loading the texture.
[ get bitmap data ]
unsigned char *pixbuf = new unsigned char[mBmp->GetWidth()*mBmp->GetHeight()*4];
[ populate pixbuf with pixel values ]
glGenTextures (1, &mTexid);
glTexImage2D(GL_TEXTURE_2D, 0, 4, mBmp->GetWidth(), mBmp->GetHeight(), 0, GL_BGRA, GL_UNSIGNED_BYTE, pixbuf);
I call this loading routine exactly once per image. Each texture is wrapped in an SSPic object. Once the loading routine is complete, the SSPic object is added to a vector of SSPic objects used by the drawing thread. A picture can only be in the vector of SSPic objects if its loading routine has returned success (where glFinish is executed). There is proper synchronization with respect to this vector of pictures so that only one of the drawing thread or picture loading thread can be using it at any one time.
Even if you don’t believe me that the synchronization around the vector works, I am only adding the SSPic object to the vector after the loading routine has completed.
Essentially, if the picture is in the shared vector (meaning that it will be drawn), then glFinish must have returned.
What am I missing? Do you need me to give more information? Thanks for your help.