Iâve been developing games using SDL 1.2.7 and, in a recent effort to
make my games more user-friendly, Iâve tried to implement in-game
switching from window to fullscreen and vice versa. My primary
development platform is Win32 but I plan to port to OSX and some linux
platforms. I quickly discovered that the only way to successfully
switch from window to fullscreen was to quit the video subsystem,
reinitialize it, and then reopen the window. I talked with a few other
SDL users and they agreed this was the best method.
HOWEVER.
This only seems to work when switching from a window to fullscreen.
When I try to do the reverse the SDL_InitVideo() says there was no
problem, the desktop returns and the window is gone. All that remains
is an icon on the taskbar.
I have been trying to dig into SDL and discover the root of the problem
but I have not had any success yet. I am in the process of trying 1.2.8
to see if the issue is fixed there. I have not yet succeeded in
implementing 1.2.8 or the latest CVS because every time I try to compile
SDL I get the following warnings in MSVC6:
âŚ\src\Video\Windx5\SDL_dx5events.c(171) : warning C4013: 'GetAncestorâ
undefined; assuming extern returning int
âŚ\src\Video\Windx5\SDL_dx5events.c(171) : error C2065: âGA_ROOTâ :
undeclared identifier
âŚ\src\Video\Windx5\SDL_dx5events.c(171) : warning C4047: â=â : âstruct
HWND__ *â differs in levels of indirection from 'int '
âŚ\src\Video\Windx5\SDL_dx5events.c(655) : warning C4047: â=â : âstruct
HWND__ *â differs in levels of indirection from 'int â
Part of this might somehow be due to the fact that I canibalized the
1.2.7 Visual C dsp/dsw files I had because I could not locate them for
1.2.8. They werenât in the distro I got off the official web page and
they werenât in CVS.
If you or anyone you know has a (constructive) solution to my problems,
please reply! I am under a tight deadline and need to get this working.
try just calling SDL_SetVideoMode again with the new flags.
this is supposed to work.
if it doesnât then thatâs a bug.
deiniting and reiniting video may not work as expected.
try just calling SDL_SetVideoMode again with the new flags.
this is supposed to work.
if it doesnât then thatâs a bug.
deiniting and reiniting video may not work as expected.
Switching from full screen to windowed or vice versa definitely doesnât
work on Mac OS X, last I checked. I canât think of a good technical
reason why it shouldnât, but I havenât had time to write a patch.
-bobOn Dec 17, 2004, at 10:45 PM, Jonathan Atkins wrote:
Iâve been developing games using SDL 1.2.7 and, in a recent effort to
make my games more user-friendly, Iâve tried to implement in-game
switching from window to fullscreen and vice versa. My primary
development platform is Win32 but I plan to port to OSX and some linux
platforms. I quickly discovered that the only way to successfully
switch from window to fullscreen was to quit the video subsystem,
reinitialize it, and then reopen the window. I talked with a few other
SDL users and they agreed this was the best method.
The officially recommended way is to just toggle the SDL_FULLSCREEN flag
and reset the video mode. This should work, and if it doesnât, itâs a bug.
I have been trying to dig into SDL and discover the root of the problem
but I have not had any success yet. I am in the process of trying 1.2.8
to see if the issue is fixed there. I have not yet succeeded in
implementing 1.2.8 or the latest CVS because every time I try to compile
SDL I get the following warnings in MSVC6:
You didnât find VisualC.zip? Thatâs the file I used to build the DLL on
the website.
See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment
I have been trying to dig into SDL and discover the root of the problem
but I have not had any success yet. I am in the process of trying 1.2.8
to see if the issue is fixed there. I have not yet succeeded in
implementing 1.2.8 or the latest CVS because every time I try to compile
SDL I get the following warnings in MSVC6:
âŚ\src\Video\Windx5\SDL_dx5events.c(171) : warning C4013: âGetAncestorâ
undefined; assuming extern returning int
âŚ\src\Video\Windx5\SDL_dx5events.c(171) : error C2065: âGA_ROOTâ :
undeclared identifier
âŚ\src\Video\Windx5\SDL_dx5events.c(171) : warning C4047: â=â : âstruct
HWND__ *â differs in levels of indirection from 'int â
âŚ\src\Video\Windx5\SDL_dx5events.c(655) : warning C4047: â=â : âstruct
HWND__ *â differs in levels of indirection from 'int â
Part of this might somehow be due to the fact that I canibalized the
1.2.7 Visual C dsp/dsw files I had because I could not locate them for
1.2.8. They werenât in the distro I got off the official web page and
they werenât in CVS.
If you or anyone you know has a (constructive) solution to my problems,
please reply! I am under a tight deadline and need to get this working.
Thank you all!
Dan R
I had the same problem with GA_ROOT (SDL 1.2.8 source, WinXP, VisualC 5, using
the VisualC.zip downloaded from SDL site). Here is what I did:
In file âSDL-1.2.8\src\video\windx5\SDL_dx5events.câ, add the following after
the #include lines:
// Gary Feng, for compile error: GA_ROOT undefined #ifndef GA_ROOT
//#include <WINUSER.h>
// from WINUSER.h
/*
HWND
WINAPI
GetAncestor(
HWND hwnd,
UINT gaFlags
); #endif
// end Gary Feng
This is copied from WINUSER.h. I tried to include it but somehow it didnât work.
Copying these lines worked for me, though. I didnât have to do anything else. I
guess it links to User32.dll, but I donât care.
I have been trying to dig into SDL and discover the root of the problem
but I have not had any success yet. I am in the process of trying 1.2.8
to see if the issue is fixed there. I have not yet succeeded in
implementing 1.2.8 or the latest CVS because every time I try to compile
SDL I get the following warnings in MSVC6:
âŚ\src\Video\Windx5\SDL_dx5events.c(171) : warning C4013: âGetAncestorâ
undefined; assuming extern returning int
âŚ\src\Video\Windx5\SDL_dx5events.c(171) : error C2065: âGA_ROOTâ :
undeclared identifier
âŚ\src\Video\Windx5\SDL_dx5events.c(171) : warning C4047: â=â : âstruct
HWND__ *â differs in levels of indirection from 'int â
âŚ\src\Video\Windx5\SDL_dx5events.c(655) : warning C4047: â=â : âstruct
HWND__ *â differs in levels of indirection from 'int â
Part of this might somehow be due to the fact that I canibalized the
1.2.7 Visual C dsp/dsw files I had because I could not locate them for
1.2.8. They werenât in the distro I got off the official web page and
they werenât in CVS.
I think youâll find the compilation problem is due to the value of WINVER.
WINUSER.H only prototypes GetAncestor and defines GA_ROOT if WINVER>=0x0500.
For VC6 this is never the case. You need to copy the prototype and define into
the top of the source file. (You canât just set WINVER to 0x0500 as all sorts of
other stuff will be upset.)