-
renderfunc questions
hy there
i call my renderfunction as follows
glutDisplayFunc(renderfunc);
now i want to give me renderfunc some parameters
glutDisplayFunc(renderfunc(foo,bar));
but this wont work...how can i do a parametric function? w/o making variables global?
bye
apo
-
Junior Member
Regular Contributor
Re: renderfunc questions
glut don't allow you to do that. to use parameters in the display function(or idle, reshape ...) you have to use global variables.
-
-
Junior Member
Regular Contributor
Re: renderfunc questions
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.
-
Re: renderfunc questions
i know...thats the reason why i wrote my fake func above the render func
so u can see the relationship between this both
bye
apo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules