is it possible to create a fixed size window using glut, so any changes with the window's dimensions will be disregarded.
it's kinda too late for me switching back to SDL or anything similar.
Apparently, it's not possible in a legit way, but you can use glutReshapeWindow
inside your glutReshapeFunc
-callback, to snap it back right after release of mouse. It's quite effective, and to my knowledge the best solution. Only tested with freeglut:
glutReshapeFunc(resize);
void resize(int width, int height) {
// we ignore the params and do:
glutReshapeWindow( 800, 600);
}
Ultimately, no. The best you can do is call glutReshapeWindow
to force it to a particular size whenever you detect that it has been resized. But that's about it. And if you do that, you need to do some infinite loop prevention by ensuring that you only call glutReshapeWindow
if the new size isn't the same as the desired. This won't prevent the user from trying to resize it, but it'll prevent them from succeeding. Possibly.
Remember: GLUT is designed for demo applications and simple test-beds. For such application, the ability to resize the window is pretty standard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With