Hi, I am a beginner to the OpenGL stuff and I’ve got a small but tricky problem. I’m probably missing something obvious, and I apologise if the answer is in a FAQ somewhere…anywho, here we go.
The problem is getting the window to refresh, ie. update the image, when I want it to. I know the code is working resonably well because changing the size of the window causes the new image to be displayed.
I just can’t get it to happen without user intervention.
I’m using GLUT on Irix (a unix-type thing) and also Linux (SuSE) in various versions.
Here is my display callback:
/* Clear all pixels */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDrawPixels(width, height, GL_RGB, GL_UNSIGNED_BYTE, image); glutSwapBuffers(); glFinish();
The glutSwapBuffers and glFinish calls are just my desparate attempts to get it to work. Double buffering is not vital and I’ll be happy to do without it…
Can somebody help me??? Please!!!
PS. I AM using glutPostRedisplay at the point where I want the display updated (just after the image array has been filled in).