Exit button

If I try to terminate the execution of my SDL application by pressing the
"cross button" in the upper right part of the window, then nothing

  1. Is it normal that an SDL window doesn’t include this functionality?

If you don’t have an event loop yet. Clicking the “close window” button
causes an SDL_QUIT event:

// … initialize SDL, do whatever

// Event loop…
while( true ) {
SDL_Event event;
if( SDL_PollEvent( &event ) ) {
if( event.type == SDL_QUIT ) break;

// … clean up, SDL_Quit(), etc.

  1. Can I add the functionality by myself without using WinApi or MFC?

Chris Herborth (@Chris_Herborth)
Otaku no Sensei