title: SDL_PollEvent indepth
body: <p>Here is a part of SDL2 code</p>
  
  <p>SDL main function</p>
  
  <pre><code>int main(int argc,char *argv[])
  {
       ...
       ...
       bool quit=false;
       SDL_Event e;
       while(!quit)  ///First while (say)
       {
              while(SDL_PollEvent(&amp;e)) ///Second while (say)
              {
                  if(e.type==SDL_QUIT)
                  {
                      quit=true;
                  }
                  handleEvent(e) ;///Function for executing certain event
              }
  
              ...
              SDL_RenderPresent((SDL_Renderer)renderer);
       }
  
    }
  </code></pre>
  
  <p>My question is,what does this SDL_PollEvent() actually do ,and suppose an event occur does the execution goes out of the second while() and call the SDL_RenderPresent() or it waits for all the events to take poll and then SDL_RenderPresent() is called , i am totally confused ?</p>