as you can see i use the SDL_Delay(); to make the program stay open for 4 seconds, but how can i make it stay open untill the user presses the exit button in the top right corner of the program?
Basically you wait for events (I think the function you want is SDL_WaitEvent, or SDL_PollEvent -- I forget the exact names) and then process them as they're received. When the user closes the program it will sent an SDL_Quit event. Once you receive that event you can exit the loop and thus the program.
There are examples in the SDL docs. Just look for SDL_WaitEvent.
Hi
Eeesh, you're having some problems with that SDL stuff :(
All I can say is these examples are all working perfectly on my system and I can't see anything wrong with any of the source code. For the record, that's CrunchBang Linux (32-bit) with g++ version 4.4.5.
Do you have a Linux install kicking around anywhere so you could try that? I wonder if the problem lies somewhere with your compiler/SDL libraries setup.
the program kinda works on my system as well(windows 7). but it kinda freezes for the first 3-4 seconds and after that it does not respond. but i can exit the window using the exit thing. but it still dont respond in a way just pops up a window saying it doesen't respond an ask me if i want to exit (like any other program that does not respond.
i am starting to suspect that i have not installed sdl correctly, or that i have a wrong version installed.
i am using visual studio 2010 compiler and the 2005 version of sdl. (i could not find any version older than that)