Passing parameter to glutKeyboardFunc

Hi all,
I have a bit of a problem. I what to pass an extra parameter to glutKeyboardFunc.
Showing the code will make it easier to explain:


void myKeyboard(unsigned char thekey, int x,int y){

The problem is that I cant find any way of passing array_of_bool to myKeyboard.

I cant declare array_of_bool as a global .

Any suggestions on how to pass array_of_bool to the function???

Thanks in advance.

[This message has been edited by TolTol (edited 12-12-2002).]

Why can’t you make it global? What are you trying to do? There may be other ways to solve your problem than passing it via the function, which is, by the way, not possible.

If you can’t make it global, then other than a different solution to what you are trying to do … the answer is NO, unless …

You edit your GLUT source code and ADD an extra arg to the glutKeyBoardFunc() !!!

Or, perhaps more elegant, add a void* pointer to the end of the window structure, so you can point this to your own data structure which will be carried around on a per window basis …

Oh the need to do SOMETHING with glut …