the reason is … there is probably no reason.
your solution works well but your parameters won’t stay static. so you’ll have to use global vars to access them.
maybe you should try another window “manager”. try SDL.
SDL don’t have an implemented main loop, you have to code it. it’s you who call the display func so you can pass parameters to the callback.