i have a quick question,
does anybody know if we can use this function like that?
glutDisplayFunc(display); instead
glutDisplayFunc(aClass.display());
(aClass is a class :))is usage above legal?
i have a quick question,
does anybody know if we can use this function like that?
glutDisplayFunc(display); instead
glutDisplayFunc(aClass.display());
(aClass is a class :))is usage above legal?
It is if display() is a static method in C++.
(To be more precise I should probably say that it’s legal if aClass.display() evaluates to a pointer to static method.)
The reason you can’t do that and need to use a static is non-static methods have a ‘this’ parameter i.e. the object this method is being called on. If you are wanting to wrap stuff in a class have a look at this thread.
Flavious and Stuart McDonald ,
thanks, for reply.
and thread is about exactly what i am trying to find out.