I’m writing a paint program for my university project.
The display call-back function in my program is only supposed to clear the screen (drawing onto the screen is done by the mouse and mouse-motion call-back routines whenever a certain state is entered.)
Now as most of the readers will know- a reshape on a GLUT window will call the display call-back function as GL/GLUT determines that the screen contents need to be updated. My canvas too is of a certain size and width - reshaping to a lesser size would require scaling or otherwise reslut in loss of info. Hence I want to restrict the user from resizing the window. Can I give a dummy call-back function for resize (it’s suposed to wok in all contexts).
Is there any other possible or better solution?
Should I switch to win32 for the same?
I was also facing the same problem yesterday. I got a cheap solution for that. In your reshape callback, simply call
where width and height are the initial size of your window. So even though you can drag the window borders, it would again resize to the original size.without damaging your contents.