SDL_QUIT does not work with VC6

Hi,

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;
	}
}

#endif // TEST

return 0;

}

Hi,

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.

~Matt> ----- Original Message -----

From: piyush, garyali (IE10) [mailto:Piyush.Garyali@honeywell.com]
Sent: Sunday, February 22, 2004 11:14 PM
To: sdl at libsdl.org
Subject: [SDL] SDL_QUIT does not work with VC6

Hi,

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;
}
}

#endif // TEST

return 0;
}


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl