Hmm, I tested, and apparently, you must pass the SDL_RESIZABLE flag to the
video mode on THE VERY FIRST TIME IT IS INITIALIZED OR ELSE IT WONT WORK.
My code was setting:
/* Create a 640x480 OpenGL screen */
if ( SDL_SetVideoMode(640, 480, 0, SDL_RESIZABLE | SDL_OPENGL) == NULL )
{
fprintf(stderr, “Unable to create OpenGL screen: %s\n”,
SDL_GetError());
SDL_Quit();
exit(2);
}
on the very first initialization. And I was hitting SDLK_p to actually
change the video mode with this code in an SDL_Event while loop:
case SDLK_p:
/* Create a 640x480 OpenGL screen */
if ( SDL_SetVideoMode(800, 600, 0, SDL_RESIZABLE |
SDL_OPENGL) == NULL ) {
fprintf(stderr, “Unable to create OpenGL
screen: %s\n”, SDL_GetError());
SDL_Quit();
exit(2);
}
/* Set the title bar in environments that support
it */
SDL_WM_SetCaption(“CAD VIEWER TEST”, NULL);
/* Loop, drawing and checking events */
InitGL(800, 600);
break;
It does seem odd and could possibly be a bug. Why wouldn’t it enable the
maximize button after changing video modes with the P key? Is it because it
has lost touch with the window manager at that point? It’s apparently not
intuitive in the way it operates, as I would think that the maximize button
would become active and grayed depending on what video mode is set…
It works now that I put it in the first initialization, thanks Donny. Now Is
this a bug or merely a “feature”? 