I worte a very simple progam in C using SDL on the Microsoft
Visual Studio.NET compiler/Win 2k and it works just fine but
when I compile the same program using Microsoft Visual Studio
6, SDL_QUIT does not work [when I try to close the Application
windows by clicking on the (x) ]
I have made the project as “Mulithreaded” and I am currently
using SDL-1.0.8.
Any Hints ?
Please find the code attached.
-gary
int main (int argc, char **argv)
{
#ifdef __TEST__
SDL_Surface *screen;
SDL_Event event;
int quit = 0;
/* Initialize SDL */
if ( SDL_Init(SDL_INIT_VIDEO) < 0)
die();
atexit(SDL_Quit);
/* Set window title */
SDL_WM_SetCaption("foo", "foo");
/* load the images */
load_images();
/* setting the video mode as 640x480 native depth
* not in full screen to start with
*/
screen = SDL_SetVideoMode(400, 100, 0,
SDL_HWSURFACE/|SDL_ANYFORMAT/);
if (screen == NULL)
die();
SDL_EnableUNICODE(1);
while (!quit) {
SDL_PollEvent(&event);
switch(event.type) {
//case SDL_KEYDOWN:
case SDL_KEYUP:
// blit images depending on the key pressed
blit_image(screen, event);
break;
case SDL_QUIT:
quit = 1;
break;
default:
break;
}
}
I worte a very simple progam in C using SDL on the Microsoft
Visual Studio.NET compiler/Win 2k and it works just fine but
when I compile the same program using Microsoft Visual Studio
6, SDL_QUIT does not work [when I try to close the Application
windows by clicking on the (x) ]
I have made the project as “Mulithreaded” and I am currently
using SDL-1.0.8.
Any Hints ?
Try using SDL 1.2.7, which was just released.
See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment
I think I had a similar sort of problem. Try using exit(); after SDL_Quit.
I think that fixed it for me. Although I’m new to this so don’t put too
much faith in what I just said.
I worte a very simple progam in C using SDL on the Microsoft
Visual Studio.NET compiler/Win 2k and it works just fine but
when I compile the same program using Microsoft Visual Studio
6, SDL_QUIT does not work [when I try to close the Application
windows by clicking on the (x) ]
I have made the project as “Mulithreaded” and I am currently
using SDL-1.0.8.
Any Hints ?
Please find the code attached.
-gary
int main (int argc, char **argv)
{
#ifdef __TEST__
SDL_Surface *screen;
SDL_Event event;
int quit = 0;
/* Initialize SDL */
if ( SDL_Init(SDL_INIT_VIDEO) < 0)
die();
atexit(SDL_Quit);
/* Set window title */
SDL_WM_SetCaption(“foo”, “foo”);
/* load the images */
load_images();
/* setting the video mode as 640x480 native depth
not in full screen to start with /
screen = SDL_SetVideoMode(400, 100, 0,
SDL_HWSURFACE/|SDL_ANYFORMAT*/);
if (screen == NULL)
die();
SDL_EnableUNICODE(1);
while (!quit) {
SDL_PollEvent(&event);
switch(event.type) {
//case SDL_KEYDOWN:
case SDL_KEYUP:
// blit images depending on the key pressed
blit_image(screen, event);
break;
case SDL_QUIT:
quit = 1;
break;
default:
break;
}
}