Hello everyone, i'm really disturbed with a issue that i'm working on since two or three days.
Here is the context :
Code :class MyClass { ... }; MyClass::display(void) { ... }
I'v a class MyClass, with a method display(). Then i'm declaring everything for my object that i call object. And what i want to do is some glutDisplayFunc(). So i'm using some wrappers to avoid errors of kind
Code :void (*) () expected instead of void (MyClass::) ()
.. here is a solution for people who were stucked there :
Code :struct MyWrapper { static void display(void) { u->display(); } static MyClass * u; }; MyClass MyWrapper::u = 0; ... int main ( .. ) { ... MyWrapper::u = &object; glutDisplayFunc(MyWrapper::display); ... }
Fortunately i'v passed this issue, but now what i want is implementing multiple MyClass objects in multiple windows..
But modifying the structure by simply trying to make arrays of object or something like that will stuck because of we need a reference to the concerned object. (here is this version)
I'v thought of functions pointers but i'v telled that it will not work.
Thank you for your help.
For the moment i'm using a limited amount of object wich should work until the amount of objects is not dynamically set ..




