I’m a beginner in openGL lib. I need to write a programme. User can make smaller the window of programme. But I don’t want the user make window smaller than my constant minimum window borders. Now, I can test how much big window is. Therefore I just need to stop the user. How could I do that?
That depends on what system you are using. Are you on Windoww? Are you using MFC? .NET? c#?
Are you on Linux? Are you using the X library?
Are you on a Mac?
Are you using a toolkit like GLUT, freeGLUT, SDL, Qt, wxwwindows, GFLW?
Resizing the window is one thing, you got answer to this above,
and resizing the scene is another.
You can make the drawn objects get smaller and larger by scale matrices. Check this out, from the first lesson, how to setup window in Windows, then later when matrices come into the picture, you will get the idea: http://nehe.gamedev.net/tutorial/lessons_01__05/22004/
I think he means if the user is resizing the window, it cannot be smaller lets say 320x200.
So i think in the ResizeWindow callback function the incoming new width and height should be checked with a simple if statement, if it goes under a certain limit, set it back to the limit.
Yes. I tried again&again to do it with Resize Func. But I never achieved. Now I’m thinking of another thing. I can check instantly what window’s size is. If user attemting to make window smaller than I want, I start a new window and it’s size is my minimum value. But the other window still living. I want to kill the older window! If I could do that, I’d be the happiest guy in the world.
If user attemting to make window smaller than I want, I start a new window and it’s size is my minimum value. But the other window still living. I want to kill the older window! If I could do that, I’d be the happiest guy in the world.
Er, this sounds like madness! Using a sledge hammer to crack a wallnut is the expression that comes to mind!
In your glutReshape call back function you know the requested width and height. Check for the minimum size and if necessary issue a glutReshapeWindow call with the min width or height parameters. There is no need to create extra windows.