It's been over a year since I last used OpenGL so I'm rusty on the topic.
I have an image that I'm doing some processing on, colour clustering to be specific, and I want to update the image after every loop iteration so I can see the changes as they happen rather than in the end when processing is complete.
This is what happens currently. The original image is displayed, the colour clustering function is executed from the keyboard callback function, the image is processed and the updated image is displayed when program control has left the colour clustering function.
I've tried calling glutPostRedisplay() after every iteration of the clustering algorithm and I've tried using the glutIdleFunc callback with glutPostRedisplay() in there. In both cases, it does not call the display callback until the image has finished processing.
How can I have it update the image (i.e. call the display callback) while the image is processing?