PDA

View Full Version : Glut + global variables, arrays



Tresher
08-27-2003, 01:10 AM
Hi,
my problem might be more related to C than to Glut.
I wrote my last program using Glut. As you know Glut offers functions like glutDisplayFunc() that are expecting function pointers, of which function has to do the work. Due to this design philosophy I don`t know how to pass e.g. pointers to those functions, passed to the functions of Glut.
This lead to a terrible interface, since most arrays etc. are declared being global. Is there a way to avoid such a wide interface using Glut??

Thanks,
Tresher.

errno
08-27-2003, 02:45 AM
no.
at least you can store all your arrays in a big struct to clarify the code.