I'm having a hard time making my window a fixed size. I realize this
is not an OpenGL issue, but I've tried other forums and no one even
replied. I'm trying to prevent users from resizing my window and
according to my searches, there *is* a way to do this via glut, but I
haven't had any success with any of the explanations that I found.
For instance, I tried this ("reshape" is my function that is
registered via "Glut.glutReshapeFunc(reshape);"):
void reshape(GLsizei width, GLsizei height) // the reshape function
{
// FORCE it to be 800 by 600
glViewport(0,0,800,600) ;
glMatrixMode(GL_PROJECTION);
glLoadIdentity() ;
glOrtho(0.0f,800,600,0.0f,-1.0f,1.0f);
glMatrixMode(GL_MODELVIEW) ;
glLoadIdentity() ;
}
or
void reshape(GLsizei width, GLsizei height) // the reshape function
{
// FORCE it to be 800 by 600
Glut.glutReshapeWindow(800, 600);
}
Both of these cases don't work. The user can still resize my window.
Note that glutReshapeWindow works, as long as it's not in the reshape
function...
(I got the above examples from the following topics:)
http://www.gamedev.net/community/forums/topic.asp?topic_id=467668
http://www.gamedev.net/community/forums/topic.asp?topic_id=114801
Is there a way to do this via glut? (I'm using C#, if that helps any)
thanks.
I don't use GLUT but the first thing I would do is to look for
CreateWindow call in GLUT and see what flags the window style gets.
You want to disable the resize control, it's one bit in the ws flags.
See if you can affect the flags's value with GLUT from client side, if
not, modify the GLUT source code and recompile the library.
> Hi,
>
> I'm having a hard time making my window a fixed size. I realize
> this is not an OpenGL issue, but I've tried other forums and no
> one even
> replied. I'm trying to prevent users from resizing my window
> and according to my searches, there *is* a way to do this via
> glut, but I haven't had any success with any of the
> explanations that I found.
Don't use GLUT then. That's something you can't to reliably with
GLUT. For applications like that I recomment using SDL, which
creates fixed size windows by default.
Wolfgang
I should have listed to your advice, Wolfgang and tried SDL first...
Thank you guys!