Hi guys,
How should I make an event loop for a game using Xlib on Linux?
I have tried using XNextEvent as some documentation suggests and that seems to block until it has any events to return.
Then I tried to use XCheckMaskEvent which apparently does almost the same as XNextEvent and it doesn't block, but I ran into problems when trying to handle the close button of the window, turns out the events fired by the close button can't be captured by XCheckMaskEvent so I had to make another loop to see if that event was there, anyway it was nasty.
I have seen some people suggest an approach similar to select function in sockets programming but I can't understand that yet so I would like to avoid that one if possible.
Thanks!