Have a look at this: https://github.com/Balans097/libFLTK
More as an example, but there is already something to work with.