PDA

View Full Version : Forcing a redisplay



pjbibby
03-09-2001, 02:28 AM
Is there any whay to do this in OpenGL?

Here's the problem:
I'm displaying a picture of contours (using glDrawPixels) and would like the user to enter a height for each contour. The way I've tried doing this was changing the colour of the contour in memory, calling glutPostRedisplay, and then doing a scanf. However, the display function is not getting done until after the scanf, and so the contour is not getting highlighted. This also has unpleasant side affects - when you enter the data in an xterm the OpenGL window isn't getting repainted and looks a mess. This is because glutPostRedisplay doesn't force a display.

So, i thought this may be something to do with threads (not that I've any idea of how OpenGL uses them), and tried doing a while loop between the glutPostRedisplay and the scanf, the condition for the while loop being a flag I'd set in the display function. i.e. you'd know when the display function had been called. But this doesn't work either!

I'd be very grateful for any help,

Paul