[SDL] Resize of Screen (Crash!)

Andrea 'Psycho' Nardinocchi microsoftwindows2003 at gmail.com
Wed Feb 22 08:13:17 PST 2006


HI People!

I tried to change the screen resolution in my application (compiled  
under MacOS X), and .. it crashes!
Well, I'm still a newbie, but the guilty code is that :

[...]
int CSubsystem::InitScreen (bool FullScreen) {
	if (Initialized && !Locked) {
		if (FullScreen) Screen = SDL_SetVideoMode(ResX, ResY, Bpp,  
SDL_HWSURFACE|SDL_FULLSCREEN|SDL_RESIZABLE);
		else Screen = SDL_SetVideoMode(ResX, ResY, Bpp, SDL_HWSURFACE| 
SDL_RESIZABLE);
		if (!Screen) return 1;
	} else return 1;
	return 0;
}
[...]
int CSubsystem::ResizeScreen (unsigned int ResX, unsigned int ResY,  
unsigned int Bpp, bool FullScreen) {
	if (Initialized && !Locked) {
		this->ResX = ResX;
		this->ResY = ResY;
		this->Bpp  = Bpp;
		if (InitScreen(FullScreen) > 0) return 1;
	} else return 1;
	return 0;
}
[...]
if (Screen.InitScreen(false) > 0) return 1;
<do something here ... >
if (Screen.GetSizeX() < 1024) if (Screen.ResizeScreen(1024, 768, 32,  
false) > 0) return 1;
[...]

When changing resolution, the window frame changes its size but  
doesn't show any content and the program freezes.
I can't find errors :(

Any ideas ?
Bye, and Thanks again for your patience :-P

Andrea "mad Psycho" Nardinocchi --------- www.psychogames.net ---------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060222/84d5be1b/attachment.htm>


More information about the SDL mailing list