PDA

View Full Version : Resizing window



Sabudda
21-06-2006, 06:41 AM
Hey,
How to disable possibility of resizing window ?, my program works on x,y co. and if somone change window size it stops working.

I would be greatfull if I get code in Free Pascal.
I'm using glutInitDisplayWindow(), glutCreateWindow().

thx for help

michalis
21-06-2006, 11:39 PM
You can't disable resizing a window when using glut. It's simply not implemented in glut.

You should simply ignore the resize --- i.e. keep the glViewport the same, no matter what size the actual window has.

Alternatively, you could use a hack, by changing window size back to original size each time it's resized. In other words, call glutReshapeWindow from the function you registered in glutReshapeFunc. But this is really an ugly hack.

If you want to write "serious" programs, there are better libraries than glut to initialize OpenGL context. One example is SDL, jedi-sdl bindings allow you to use this from FPC. (Not to mention my own little library that can initialize OpenGL contexts using WGL or GLX or GTK :)