• Advertisement
Sign in to follow this  

Unable to properly run SDL applications in windows

This topic is 4379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, Whenever i try to run a SDL application in windows the window "freezes", by that i mean nothing is drawn in it and only what was behind the window when the application started is seen in the window (kinda hard to explain :D). I've tried two different versions of SDL and four different DLLs. I've tried both programs written in python and C++, I'v tried wriing them myself and those written by others. I've tried compiling myself and precompiled binaries. Nothing works :'(. SDL works like a charm in KUbuntu linux on the same computer. Intel (yes i know they suck) Pentium M 1.73Ghz 1024MB DDR RAM Intel 915i GM express or whatever it is called.

Share this post


Link to post
Share on other sites
Advertisement
Please write what is the:

- Windows version
- SDL version
- compiler version

Also, it would help if you could post here smallest possible example of a program which reproduces your problem.

Personally, I'm running SDL 1.2.8/1.2.9 apps on Windows XP for about 1,5 year and never had such problems :-) probably there's sth wrong with the way you're handling your events.

Share this post


Link to post
Share on other sites
I know what you are describing. It's how mine behaved when I accidently left out the code to swap the graphics buffers. Have you included this in your render function?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by noteventime
Hello,
Whenever i try to run a SDL application in windows the window "freezes", by that i mean nothing is drawn in it and only what was behind the window when the application started is seen in the window (kinda hard to explain :D).
I've tried two different versions of SDL and four different DLLs.
I've tried both programs written in python and C++, I'v tried wriing them myself and those written by others.
I've tried compiling myself and precompiled binaries.
Nothing works :'(.

SDL works like a charm in KUbuntu linux on the same computer.

Intel (yes i know they suck) Pentium M 1.73Ghz
1024MB DDR RAM
Intel 915i GM express or whatever it is called.


Umm... Happened here also; are you loading something? This might not be the problem, but the only thing I can think of is some kind of infinite loop, or some kind of loading problem...

What compiler, and what windows version?

Does this work?

#include <SDL/SDL.h> // Bah, whatever it is :).

int main(int, char*[]) {
SDL_Init(SDL_INIT_VIDEO);
SDL_Delay(2000);
SDL_Quit();
}



C++

Share this post


Link to post
Share on other sites
Quote:
Original post by Koshmaar
Please write what is the:

- Windows version
- SDL version
- compiler version

Quote:
Original post by Anonymous Poster
What compiler, and what windows version?

Share this post


Link to post
Share on other sites
Quote:
Original post by noteventime
It's not a problem with any programs i write, it's with all applications using SDL, for example ScummVM.


Maybe the dll got screwed somehow. Virus? Replace sdl.dll and see what happens.

Share this post


Link to post
Share on other sites
Yes, I have to most recent drivers from Intel (I updated them about 1½month ago so thay might not be the newest but pretty much).

Share this post


Link to post
Share on other sites
Quote:
Original post by noteventime
I've tried 5 different DLL's.


Maybe it's one of the alternate libs, like sdl-mixer etc. Did you tried replacing those?

Could it be a problem with a device, like a joystic or something?

This is pretty wierd.

PS: Did you scanned your computer for viruses?

Share this post


Link to post
Share on other sites
Try to see if SDL inits successfully or does not. This should help you figure out where your problem is.

Share this post


Link to post
Share on other sites
Quote:
Original post by noteventime
Hello,
Whenever i try to run a SDL application in windows the window "freezes", by that i mean nothing is drawn in it and only what was behind the window when the application started is seen in the window (kinda hard to explain :D).
I've tried two different versions of SDL and four different DLLs.
I've tried both programs written in python and C++, I'v tried wriing them myself and those written by others.
I've tried compiling myself and precompiled binaries.
Nothing works :'(.

SDL works like a charm in KUbuntu linux on the same computer.

Intel (yes i know they suck) Pentium M 1.73Ghz
1024MB DDR RAM
Intel 915i GM express or whatever it is called.


does it work in fullscreen?

Share this post


Link to post
Share on other sites
Quote:
Original post by noteventime
Ahhh....
Apps work in fullscreen but not in windowed. (^_^) One step further.


how complicated must the program be before it wont work:

ie, does something like this work

EDIT: coded from memory, quite possible i've forgotten something


int main(int, char**)
{
if( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
cout << SDL_GetError() << endl;
}
SDL_Surface *screen = SDL_SetVideoMode(300,300,SDL_SWSURFACE);
if( !screen )
{
cout << SDL_GetError() << endl;
}

while(1)
{
SDL_Event event;
while( SDL_PollEvent(&event) )
{
if( event.type == SDL_QUIT )
return 0;
}
SDL_UpdateRect(0,0,0,0); // comment this out if it doesnt work
}
return 0;
}






if that doesnt work then all i can think of is that SDL is trying to do something funky that your graphics card cant do, and it fails.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
rip-off:
That application freezes too.

Share this post


Link to post
Share on other sites
"rip-off:
That application freezes too.
But pressing Esc quits it, so its just a problem with the graphics."

Sorry i forgot to login last time

Pressing Esc quits the program, so it's only a problem woth the graphics.

Share this post


Link to post
Share on other sites
Quote:
Original post by noteventime
"rip-off:
That application freezes too.
But pressing Esc quits it, so its just a problem with the graphics."

Sorry i forgot to login last time

Pressing Esc quits the program, so it's only a problem woth the graphics.


so what does the apllication look like? just has the underneath of whatever program you had before where there should be this application? ( a screenshot could help explain )....

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sure, I'l post a screenshot next time i use Windows. Th only thing in the window is what was behind it when it started.

Share this post


Link to post
Share on other sites
Hi,
Well, I just wanted to say I too have the exact same problem. It also doesn't work in windows mode, and works fine in full screen.

And (surprise, surprise), I also have an Intel 915 card. So, I guess there is a problem with this card driver.
So, did the original poster find a way to get around this?

Thank you very much in advance

Share this post


Link to post
Share on other sites
You could try switching to a different SDL video driver and look what happens. In Windows you can choose between windib (GDI) and DirectX.

You do this either in your code:

putenv("SDL_VIDEODRIVER=windib");

Or go into your System Preferences and add the environment variable there. I forgot if Windows wants you to logout or reboot for this to take effect.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement