Skip to main content
gamedev.net
🔒 Locked

SDL fullscreen problem

Started by AnjinSan Oct 19, 2003 at 2:56 AM 11 replies 1k views
Original Post
AnjinSan
AnjinSan
Well here is my problem : I made an application using SDL and until now ( for debuging reasons ) I kept it in window mode. But now , when ai try to switch to fullscreen something strange hapens : after a few seconds ( 3-4 ) the program freezes and there is nothing I can do to unblock it. The only solution is the RESET button of my PC. Sometimes CTRL+ALT+DEL works but very rare. Whay is this hapening?
Monder
Monder
If there''s not too much of it post your draw code, there could be something wrong there.
AnjinSan
AnjinSan

Hmm the program is rather big and it has many drawing functions ( made by me ) but all these functions are using at the core the SDL_BlitSurface function and that should work just fine . Anyway here is a function that draws a SDL_Surface to the screen


void DrawImage(SDL_Surface *surf,float x, float y)
{
SDL_Rect Rect;
Rect.x=x;
Rect.y=y;
SDL_BlitSurface(surf,NULL,pScreen,&Rect);

}


oh , and I am using VC7. could this be a problem?

I am intrigued because the same functions work just fine in window mode but they do not in fullscreen.
Maega
Maega
SDL is cross platform. Why would he switch to a platform dependant library?

JTippetts
JTippetts
It''s impossible to even guess what the problem might be without a little more information. My suggestion is to try and find out exactly where it is freezing. Make liberal use of std::cout to display messages as you enter and exit various suspicious functions, and close each one with std::endl so that the line will be flushed, rather than sitting in the buffer while the program happily hangs, denying you enlightenment. A simple macro can easily be written which will output the current File and Line being executed, by writing the __FILE__ and __LINE__ defines.

If you can find exactly where it is hanging up, that would help immensely.



Josh
vertexnormal AT linuxmail DOT org


Check out Golem: Lands of Shadow, an isometrically rendered hack-and-slash inspired equally by Nethack and Diablo.
Monder
Monder
Or just run it through the debugger and look at the call stack when it crashes

Though if your computer is freezing up that probably won''t work so it looks like you''ll have to use VertexNormal''s way, only use fstreams (I''m assuming you''re using C++ here) and remeber to flush the buffer after every write.
cowsarenotevil
cowsarenotevil
Maybe he wants to compile it for other platforms, too? Besides, he''d be just as likely to make this mistake using pure windows code...

Anyway, check to see that you aren''t setting the refresh rate/resolution to something you''re monitor/video card can''t support.
-~-The Cow of Darkness-~-
YoshiN
YoshiN
quote:
Original post by cowsarenotevil
Maybe he wants to compile it for other platforms, too? Besides, he''d be just as likely to make this mistake using pure windows code...

Anyway, check to see that you aren''t setting the refresh rate/resolution to something you''re monitor/video card can''t support.


SDL will emulate resolutions that aren''t supported so I doubt that''s the problem...sounds like it might be a memory problem of some type, are you doing any surface locking/unlocking?

Wakarimasu ka, Anjin-san?
-YoshiXGXCX ''99
gommo
gommo
quote:
Original post by Maega
SDL is cross platform. Why would he switch to a platform dependant library?



so what? Why is that even an issue? AnjinSan didn''t specify he even required cross platform development?

Not picking but I find it interesting how many ppl preach platform development but never ever actually use their solution on multiple platforms?

Like for instance at my work. Most of the developers here work on a realtime reporting system written in java yet the backend is very much tied to MS SQl server, which I find quite ironic.

sigh


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.