View Full Version : renderfunc questions
07-16-2003, 02:37 AM
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?
07-16-2003, 04:36 AM
glut don't allow you to do that. to use parameters in the display function(or idle, reshape ...) you have to use global variables.
07-16-2003, 06:54 AM
is there a good reason why this isnt implemented?
hmm...ive done it w/o globals http://www.opengl.org/discussion_boards/ubb/smile.gif, i used a "fake" render function http://www.opengl.org/discussion_boards/ubb/wink.gif that does only the following in my case...
it works http://www.opengl.org/discussion_boards/ubb/smile.gif
07-16-2003, 11:07 PM
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.
07-17-2003, 12:42 AM
i know...thats the reason why i wrote my fake func above the render func http://www.opengl.org/discussion_boards/ubb/wink.gif so u can see the relationship between this both http://www.opengl.org/discussion_boards/ubb/wink.gif
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.