SDL_SetWindowFullscreen fails to set window to fullscreen mode yet still returns 0

This code never gives me an error message, but never switches to/from
fullscreen mode either:
while(SDL_WaitEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
return 0;
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case ‘f’:
fullscreen = !fullscreen;
if (SDL_SetWindowFullscreen(event.key.windowID, fullscreen) != 0) {
printf (“Unable to switch window to fullscreen mode:
%s\n”, SDL_GetError());
SDL_ClearError();
}
break;
case ‘q’:
case SDLK_ESCAPE:
return 0;
}
break;
case SDL_WINDOWEVENT:
switch (event.window.event) {
case SDL_WINDOWEVENT_RESIZED:
printf(“Window %u resized to %d x %d.\n”,
event.window.windowID, event.window.data1, event.window.data2);
break;
case SDL_WINDOWEVENT_CLOSE:
SDL_HideWindow(event.window.windowID);
return 0;
}
break;
}
}

Also, the SDL_WINDOW_FULLSCREEN flag, when used with SDL_CreateWindow,
produces a window with no border or window decorations centered in the
middle of the screen instead of a fullscreen window.

The full test program is attached.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: fullscreentest.c
Type: text/x-csrc
Size: 1714 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090730/2fa66b67/attachment.c

Yeah, the fullscreen stuff isn’t completely implemented yet, although I’ll
fix the API call to return the correct status. What platform are you
running on?

Thanks!On Thu, Jul 30, 2009 at 2:25 AM, Kenneth Bull wrote:

This code never gives me an error message, but never switches to/from
fullscreen mode either:
while(SDL_WaitEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
return 0;
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case ‘f’:
fullscreen = !fullscreen;
if (SDL_SetWindowFullscreen(event.key.windowID, fullscreen) !=
0) {
printf (“Unable to switch window to fullscreen mode:
%s\n”, SDL_GetError());
SDL_ClearError();
}
break;
case ‘q’:
case SDLK_ESCAPE:
return 0;
}
break;
case SDL_WINDOWEVENT:
switch (event.window.event) {
case SDL_WINDOWEVENT_RESIZED:
printf(“Window %u resized to %d x %d.\n”,
event.window.windowID, event.window.data1, event.window.data2);
break;
case SDL_WINDOWEVENT_CLOSE:
SDL_HideWindow(event.window.windowID);
return 0;
}
break;
}
}

Also, the SDL_WINDOW_FULLSCREEN flag, when used with SDL_CreateWindow,
produces a window with no border or window decorations centered in the
middle of the screen instead of a fullscreen window.

The full test program is attached.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

2009/8/2 Sam Lantinga :

Yeah, the fullscreen stuff isn’t completely implemented yet, although I’ll
fix the API call to return the correct status.? What platform are you
running on?

Linux Mint 7 Gloria x64 (based on Ubuntu 9.04 Jaunty) on an Athlon 64.
video driver would be x11

Sam Lantinga <slouken libsdl.org> writes:

Yeah, the fullscreen stuff isn’t completely implemented yet, although I’ll
fix the API call to return the correct status.? What platform are you running
on?Thanks!

What’s a good way of learning when the fullscreen stuff is working? I’m
running on Vista SP2(32) with Nvidia 8800 GTX.

Walt Niehoff <waltniehoff stny.rr.com> writes:

Sam Lantinga <slouken libsdl.org> writes:

Yeah, the fullscreen stuff isn’t completely implemented yet, although I’ll
fix the API call to return the correct status.? What platform are you
running
on?Thanks!

What’s a good way of learning when the fullscreen stuff is working? I’m
running on Vista SP2(32) with Nvidia 8800 GTX.


SDL mailing list
SDL lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’ve had success in implementing fullscreen/windowed toggling simply by
introducing a mode flag that indicates which mode I ought to be in and
selecting the appropriate value for the flags parameter in SDL_SetVideoMode.
My calls to SDL_SetVideoMode are only in my resize event handler. Oh, I
forgot to mention that this is for OpenGL rendering. I was surprised at how
fast the mode switching was!

Walt