   SDL - non game loop app
  Hi,I'm looking for an example of an SDL app that would not take up 100 % CPU and at the same time never use SDL_Delay. I think that it will be necessary to use SDL_ExposeEvent, but I need to know more (therefore, a working example would be the best).Thanks   
  Here is the problem you run into when the app isn't in a loop the main function will read all the way to the end of the program and end! There has to be a loop somewhere to keep the app from finishing, take hello world for example after it executes what it is supposed to do it will end, if you were to put that in a loop it would be infinite until the person running the app closes it out, or has other things in there that change it's behaviour. I hope that helps you out, as stated by the documentation doesn't sound like ExposeEvent would do what it sounds like your asking, "SDL_ExposeEvent is a member of the SDL_Event  union and is used when an event of type SDL_VIDEOEXPOSE  is reported.A VIDEOEXPOSE event is triggered when the screen has been modified outside of the application, usually by the window manager and needs to be redrawn. " Still with no "Game loop" the program will just execute til the end, no cases. You could ask for user input but once those are done it will eventually end without you choosing.   ;SDL_Event event;bool bRun = true;while(bRun){    while(SDL_PollEvent(&event))    {   if(event.type == SDL_QUIT || (event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE))  bRun = false;   else  // Handle others event here    }    GameLogic();    SDL_Flip(pFrameBuffer);}edit : Ohh, I realized you asked for a NON game loop. If there's no constant movements, in this case, you don't have to render always the fastest possible. If you use SDL as a gui, you can simply refresh the screen when there's an event, like a click.In this case, use this instead of a SDL_PoolEvent loop:while(bRun){    // pull motion events (may flood the event queue), not needed    while(SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_MOUSEMOTIONMASK) > 0);    SDL_WaitEvent(&event);    // Handle event    SDL_Flip(pFrameBuffer); // Flip only if event made a graphical change}