I'm thinking about writing an application with a GUI using SDL.
Now you might know that SDL 1.x had the ability to wait for the OS to pass events (like mouse movements, keyboard input and window related things) to the application like this:
- {l Code}: {l Select All Code}
SDL_Event* ev;
while(SDL_WaitEvent(ev)) {
handleEvent(ev)
}
SDL_WaitEvent() would pass control to the OS, blocking the program from executing and therefore would play nice with the scheduler.
In SDL 2 however, this is no longer the case, as it seems that the same function now polls for events every 10 ms internally.
Filtering events also requires a polling loop, so I guess I'd have to accept a polling main loop when using SDL 2.
Do you know if that is still acceptable for a normal application? Is that still sufficient in regards of the scheduler of a modern OS, the CPU usage and therefore fan and battery usage?
Thanks in advance.