So i just started learning SDL and came across "Event driven programming", just wanted to be sure if i understood the tutorial correcly. So lets say by adding:
SDL_Event event;
i add lets say a container that keeps track of every event i do? After that i start using:
while ( program == true )
{
while(SDL_PollEvent(&event)
{
if ( event.type == SDL_QUIT )
{
program = false;
}
}
}
If i understand correcly, in the second loop we say that while theres some sort of event ( and we send a list of events ) do the loop and if it happens that one of those events type is SDL_QUIT then the program will terminate. I think i understand it good enough but would like to hear something about the event handling in the SDL that i dont know about or correct me if im wrong.