renderfunc questions

hy there

i call my renderfunction as follows


now i want to give me renderfunc some parameters


but this wont work…how can i do a parametric function? w/o making variables global?



glut don’t allow you to do that. to use parameters in the display function(or idle, reshape …) you have to use global variables.

is there a good reason why this isnt implemented?

hmm…ive done it w/o globals , i used a “fake” render function that does only the following in my case…

void renderFunc(void)

it works



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.

i know…thats the reason why i wrote my fake func above the render func so u can see the relationship between this both