I have a problem with the SDL Events. I have a code which looks like:
while (SDL_PollEvent(&Event)){
OnEvent(&Event);
}
then the OnEvent processes the event and directs it to the proper virtual function. So If I were to hold down the right key button, it would go here.
void Engine::OnKeyDown(SDLKey sym){
switch(sym) {
case SDLK_RIGHT:
x1 += 1;
break;
}
}
The problem is that when I am holding the right button key, it is only running one time. The queue does not stack and keep processing the keydown button. What could be the problem?