🔒 Locked
SDL fullscreen problem
Advertisement
Original Post
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?
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.
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.
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.
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.
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.
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.
Anyway, check to see that you aren''t setting the refresh rate/resolution to something you''re monitor/video card can''t support.
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?
Check the surface, check pScreen before every blit...
[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
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.
Advertisement
