PDA

View Full Version : how to forbid the view to be redrawed triggered by mouse in glut?



bluestone
06-06-2006, 06:11 AM
I do not want the view to be redrawed after a mouse click in the window or window size change,how to let "glutDisplayFunc()"ignore the mouse action? I want the redraw to be controled only by program code. Can you slove the problem in glut?or please give me some other advice.
thanks!

songho
06-06-2006, 09:48 AM
I think you do not need a redraw callback at all, if you want to call it explicitly.

Here is other option:
Do not call glutPostRedisplay() in your mouse callback.

And do not reset viewport and projection matrix in your reshape callback. Just set your global variable(bool) in order to know when the window is resized. Then, you can change the viewport later when you need to.

Gavin
06-07-2006, 07:12 PM
but if you resize and dont redraw you get the same image in a bigger window, you need to make a hack for this? as in

-- if resize (when dont want redraw) dont redraw
?