SDL 1.2.4 and ToggleFullscreen

This used to work under linux with SDL 1.2.3… but when I upgraded to
1.2.4 and recompiled an app i’m working on, SDL_WM_ToggleFullScreen no
longer works…

This used to work under linux with SDL 1.2.3… but when I upgraded to
1.2.4 and recompiled an app i’m working on, SDL_WM_ToggleFullScreen no
longer works…

Can you reproduce this with the test applications in the SDL source archive?
What version of X server are you running?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I think I found the problem… Just not sure why!!!
I have this proc definition
bool set_videomode(SDL_Surface *screen, int width, int height int bpp)
and in there I use this call to set the video display
screen = SDL_SetVideoMode(width, height, bpp, SDL_OPENGL);
within the function it is non NULL…
however after the function returns screen is still NULL… (I initialized
it to NULL)

I altered my togglefullscreen code to use SDL_GetVideoSurface and it
works… but why is my screen variable not being set?
It’s probably some REALLY simple STUPID thing.On Wed, 24 Apr 2002 00:42:56 -0500, Sam Lantinga wrote:

This used to work under linux with SDL 1.2.3… but when I upgraded to
1.2.4 and recompiled an app i’m working on, SDL_WM_ToggleFullScreen no
longer works…

Can you reproduce this with the test applications in the SDL source
archive? What version of X server are you running?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I think I found the problem… Just not sure why!!!
I have this proc definition
bool set_videomode(SDL_Surface *screen, int width, int height int bpp)
and in there I use this call to set the video display
screen = SDL_SetVideoMode(width, height, bpp, SDL_OPENGL);
within the function it is non NULL…
however after the function returns screen is still NULL… (I initialized
it to NULL)

Are you trying to pass screen back to the calling function:

that is:

SDL_Surface *screen;
set_videomode(screen, …);
// now (screen) is set to the new surface

If that’s what you’re doing, you C is incorrect:

SDL_Surface *screen;
set_videomode(&screen, …);

And inside set_videomode():

*screen = SDL_SetVideoMode( … );

–ryan.

That’s kinda what I thought… but the weird thing is… things were
working before I upgraded to SDL 1.2.4… Wonder if the 1.2.3
SDL_FullScreen call ignored the SDL_Surface * parameter?
well I just got rid of that argument as I don’t need it anymore…
Thanks…On Mon, 29 Apr 2002 00:00:39 -0500, Ryan C. Gordon wrote:

I think I found the problem… Just not sure why!!! I have this proc
definition
bool set_videomode(SDL_Surface *screen, int width, int height int bpp)
and in there I use this call to set the video display screen =
SDL_SetVideoMode(width, height, bpp, SDL_OPENGL); within the function
it is non NULL…
however after the function returns screen is still NULL… (I
initialized it to NULL)

Are you trying to pass screen back to the calling function:

that is:

SDL_Surface *screen;
set_videomode(screen, …);
// now (screen) is set to the new surface

If that’s what you’re doing, you C is incorrect:

SDL_Surface *screen;
set_videomode(&screen, …);

And inside set_videomode():

*screen = SDL_SetVideoMode( … );

–ryan.