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