Help with input

I am making a simple program that creates a window and you press escape to exit.
my main problem is I cant x out the program when I put if (event.type == SDL_QUIT) in main.
The relative code in my program is as follows, any help would be great.

in my main I call

Code:

SDL_Event event;
while( quit == false )
{
while( SDL_PollEvent( &event ) )
{
input.check_key(quit);
}
}

in my input class I call

Code:

bool input::check_key(bool)
{
if (key[SDLK_ESCAPE])
{
return true;
}
if (event.type == SDL_QUIT)
{
quit = true;
}
}

and input.h looks like this

Code:

class input
{
public:
bool check_key(bool);
Uint8 *key;
};

Is “quit” a global? Or is it the name of the anonymous parameter to
check_key()? Is event() global? Can you show us their declarations?On 23 April 2010 01:44, cndr.mike <cndr.backup at yahoo.com> wrote:

I am making a simple program that creates a window and you press escape
to exit.
my main problem is I cant x out the program when I put if (event.type ==
SDL_QUIT) in main.
The relative code in my program is as follows, any help would be great.