Click to See Complete Forum and Search --> : OpenGL fixed window size


rbha311
February 12th, 2009, 09:46 PM
Hi,

I wanted help in keeping the size of the openGL constant so the user of the application could not resize it by dragging the corners. I'm not sure how i can keep the window size fixed or whether there are any specific functions that allow the window to be a fixed size.

Thanks

kake_fisk
February 13th, 2009, 08:35 AM
Try this:

glutReshapeFunc(NULL);

I'm not sure if it will work..

Lindley
February 13th, 2009, 04:05 PM
That's not something OpenGL can control; it has to be done at the level of the windowing system.

I rather doubt the above will work properly, or the GLUT is sufficiently flexible to allow it at all. Using another windowing system you might have a better chance.

rbha311
February 16th, 2009, 05:58 AM
Thanks, passing null to the function was a good idea and seems like a very obvious choice and it let me pass a null to it too but apparently it didn't fix the window size, i was still able to resize the window. I think I might have to look for an API for one of the header files that might have window creation routines.

Lindley
February 17th, 2009, 08:51 AM
Using Win32 directly with WGL will definitely allow it. That may not be the easiest way, though. Most GUI toolkits will have such an option, and most can be interfaced with OpenGL pretty easily too.

Mike Harnad
February 17th, 2009, 08:52 AM
You will need to handle WM_SIZING or WM_SIZE to prevent the user from resizing an OpenGL window. Or, you can change the window style in the resource editor to prevent a resizing border.