In Windows, to pump for system messages (for a game, for example) one would roughly do this:
MSG msg;
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
I've never done development on Linux (I'm on Mint v17 at the moment) before, so I'm not sure what the equivalent (if any) would be. I did some self-research on this but didn't find much help, most likely because I am unaware of the proper linux terminology for such concepts.
There is nothing intrinsic (i.e. built into the OS) like that. If you have e.g. X11, you have a similar message loop, where you receive and dispatch messages. Normally, you wouldn't see that message loop though, just as under MS Windows people rarely program on the bare win32 API. Use a so-called windowing toolkit like WxWidgets, Qt, GTK etc.
BTW: You could use an implementation of the win32 API on Linux, too, it's called WINE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With